Commit 8220aba7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

component/python-2.7, component/python3: fix readline termcap library detection.

parent 70d6ba0a
Pipeline #30997 failed with stage
......@@ -9,6 +9,7 @@ extends =
../openssl/buildout.cfg
../patch/buildout.cfg
../readline/buildout.cfg
../sed/buildout.cfg
../sqlite3/buildout.cfg
../zlib/buildout.cfg
../file/buildout.cfg
......@@ -49,6 +50,8 @@ patches = ${python2.7-lib-patches:patches}
${:_profile_base_location_}/pytracemalloc_pep445.patch#9f3145817afa2b7fad801fde8447e396
url =
http://www.python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz
pre-configure =
${sed:location}/bin/sed -i -e "s/if 'curses' in ln:/if 'curses' in ln.split(os.sep)[-1]:/" setup.py
configure-options =
--enable-ipv6
--enable-unicode=ucs4
......
......@@ -10,6 +10,7 @@ extends =
../ncurses/buildout.cfg
../openssl/buildout.cfg
../readline/buildout.cfg
../sed/buildout.cfg
../sqlite3/buildout.cfg
../util-linux/buildout.cfg
../xz-utils/buildout.cfg
......@@ -30,6 +31,8 @@ executable = @@LOCATION@@/bin/${:_buildout_section_name_}
url =
https://www.python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz
pre-configure =
${sed:location}/bin/sed -i -e "s/if 'curses' in ln:/if 'curses' in ln.split(os.sep)[-1]:/" setup.py
configure-options =
--enable-ipv6
--without-ensurepip
......
  • Eek a new core dependency. And I also discover that sed -i is not posix, so if you don't want to use system sed this way, whereas even busybox sed supports -i:

    • Do you have in mind to use ${sed:location}/bin/sed everywhere else ?
    • I'd prefer something else like patch, or since we already depend on perl for openssl:
    ${perl:location}/bin/perl -pi -e "s/(if 'curses' in ln):/\$1.split(os.sep)[-1]:/" setup.py

    Apart from that, I'd simplify a little:

    ${perl:location}/bin/perl -pi -e "s/(if 'curses' in ln):/\$1.split()[0]:/" setup.py

    And is there also a plan to detect illegal use of system binaries ? What's the point imposing ourselves such constraints ?

    /cc @jerome

  • I didn't use patch because python3/buildout.cfg contains several python versions and we may not be able to use the same patch in some versions. But I'm OK to rewrite using perl instead.

    And I used slapos sed only because we already have it in slapos.

    Anyway your proposal of using .split()[0] is simpler.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment