I think I got it this time: ---
#!/bin/sh
patch --dry-run "$@" > /dev/null 2>&1 ; patchstatus=$?
if test "$patchstatus" == "0" ; then
if [ "$1" = "-v" ] || [ "$1" == "--help" ] ; then
patch "$@" ; patchstatus=$?
else
patch --dry-run "$@" | grep -e "patching file" | \
sed -e 's/patching file //' | \
sed -e 's/^.*$/& &.timestamp/' | xargs touch -r
patch "$@" ; patchstatus=$?
find . -type f -name "*.timestamp" | \
sed -e 's/.timestamp//' | \
sed -e 's/^.*$/&.timestamp &/' | xargs touch -r
find . -type f -name "*.timestamp" -exec rm -f {} \;
fi
else
patch "$@" ; patchstatus=$?
fi
exit "$patchstatus"
---
It preserves patch(1)'s normal behavior as much as possible, while keeping us
from rebuilding autoconf/automake and info files due to modified timestamps.
If only this could be used as an alias.
robert
pgpVGnxOASeWr.pgp
Description: PGP signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-chat FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
