Skip to content

Commit

Permalink
While patching shebangs in source, keep the modification date
Browse files Browse the repository at this point in the history
Otherwise this triggers automake/autoconf/m4 dependencies that
are redundant because of the trivial change.
  • Loading branch information
domenkozar committed Jan 8, 2015
1 parent 512fbb2 commit 1eeb4b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/build-support/setup-hooks/patch-shebangs.sh
Expand Up @@ -59,7 +59,9 @@ patchShebangs() {
echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""
# escape the escape chars so that sed doesn't interpret them
escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g')
mod_time=$(stat --format=%y "$f")
sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"
touch -d "$mod_time" "$f"
fi
fi
done
Expand Down

0 comments on commit 1eeb4b3

Please sign in to comment.