diff options
author | Michael Haubenwallner <haubi@gentoo.org> | 2017-03-02 10:37:19 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2017-07-02 09:30:59 -0700 |
commit | f4f1caaeb37825c01a2092d11bec4f932772bd38 (patch) | |
tree | 310cc9176e1c4b7d6e7b1aa5e78648ab89ac3466 | |
parent | portage/dep/depcheck.py: Whitespace, add indentation level after newline (diff) | |
download | portage-f4f1caaeb37825c01a2092d11bec4f932772bd38.tar.gz portage-f4f1caaeb37825c01a2092d11bec4f932772bd38.tar.bz2 portage-f4f1caaeb37825c01a2092d11bec4f932772bd38.zip |
econf: multijob-safe shebang tweaking
Using econf in parallel for multiple configurations (multilib, or
ncurses' wide+narrow), both may try to fix configure's shebang.
On Cygwin at least, this may cause 'sed -i' to fail with:
sed: cannot rename /.../work/ncurses-6.0/sedXZsjI6: Permission denied
Instead of 'sed -i', better use 'mv -f' towards the original file.
-rw-r--r-- | bin/phase-helpers.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index e1dcfd5e8..4b9b12b70 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -572,14 +572,14 @@ econf() { if [ -x "${ECONF_SOURCE}/configure" ]; then if [[ -n $CONFIG_SHELL && \ "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then - # preserve timestamp, see bug #440304 - touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die + cp -p "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die sed -i \ -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \ - "${ECONF_SOURCE}/configure" \ + "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" \ || die "Substition of shebang in '${ECONF_SOURCE}/configure' failed" - touch -r "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" "${ECONF_SOURCE}/configure" || die - rm -f "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" + # preserve timestamp, see bug #440304 + touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die + mv -f "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" "${ECONF_SOURCE}/configure" || die fi if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ |