econf: preserve configure timestamp, bug #440304
authorZac Medico <zmedico@gentoo.org>
Mon, 4 Feb 2013 17:53:22 +0000 (09:53 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 4 Feb 2013 17:53:22 +0000 (09:53 -0800)
bin/phase-helpers.sh

index 383f9ff5e2bf401286e15d71d8efde2a3dbef6d3..7426229a6c0d69a213a377f695dd2bb3c13ea750 100644 (file)
@@ -439,8 +439,13 @@ econf() {
        if [ -x "${ECONF_SOURCE}/configure" ]; then
                if [[ -n $CONFIG_SHELL && \
                        "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
-                       sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
+                       sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" "$ECONF_SOURCE/configure" > \
+                               "$ECONF_SOURCE/configure._portage_tmp_.$$" || \
                                die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
+                       # preserve timestamp, see bug #440304
+                       touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || die
+                       mv "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
+                       chmod +x "$ECONF_SOURCE/configure" || die
                fi
                if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
                        find "${WORKDIR}" -type f '(' \