From 75b469eace9a0dbd5187cb78531ed064ec29a461 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 5 Feb 2013 00:39:30 -0800 Subject: [PATCH] econf: teak timestamp preservation Use the sed -i so we can keep the same inode, avoiding potential issues with loss of file metadata. --- bin/phase-helpers.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 7426229a6..d278dd670 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -439,13 +439,12 @@ 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:" "$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 + sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \ + die "Substition of shebang in '$ECONF_SOURCE/configure' failed" + touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die + rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$" fi if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ -- 2.26.2