diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/apatch.in | 1 | ||||
-rw-r--r-- | scripts/patchfns.in | 3 | ||||
-rwxr-xr-x | scripts/rpatch.in | 16 |
3 files changed, 10 insertions, 10 deletions
diff --git a/scripts/apatch.in b/scripts/apatch.in index 034773e..3ec72e4 100755 --- a/scripts/apatch.in +++ b/scripts/apatch.in @@ -107,6 +107,7 @@ apatch() else touch .pc/$patch~refresh fi + touch .pc/$patch/.timestamp if [ "$(shopt -s nullglob ; echo .pc/$patch/*)" = "" ] then echo $"Patch $patch appears to be empty, applied" diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 8b0f3af..2ddf7ac 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -400,7 +400,8 @@ files_in_patch() local path=".pc/$patch" if [ -d "$path" ] then - for file in $(find "$path" -type f) + for file in $(find "$path" -type f \ + -a ! -path "$path/.timestamp") do echo "${file:${#path}+1}" done diff --git a/scripts/rpatch.in b/scripts/rpatch.in index ca8bc49..fd83e0d 100755 --- a/scripts/rpatch.in +++ b/scripts/rpatch.in @@ -28,22 +28,19 @@ files_may_have_changed() local patch=$1 file local patch_file=$(patch_file_name $patch) - local apply_ts=$(date -r ".pc/$patch" '+%s') ts + local apply_t ts + apply_ts=$(date -r ".pc/$patch/.timestamp" '+%s') - if [ -e "$patch_file" -a ".pc/$patch" -ot "$patch_file" ] + if [ $? -ne 0 -o ! -e "$patch_file" -o ! -e ".pc/$patch/.timestamp" \ + -o ".pc/$patch/.timestamp" -ot "$patch_file" ] then return 0 fi for file in $(files_in_patch $patch) do - if ! [ -e $file ] - then - return 0 # file is missing - fi - - ts=$(date -r $file '+%s') - if [ $? -ne 0 -o $ts -gt $apply_ts ] + ts=$(date -r $file '+%s') 2> /dev/null + if [ $? -ne 0 -o "$ts" -gt $apply_ts ] then return 0 # file has changed fi @@ -140,6 +137,7 @@ rpatch() if [ $status -eq 0 ] then echo $"Removing $patch" + rm -f ".pc/$patch/.timestamp" @LIB@/backup-files $silent -f $pc_file -B .pc/$patch/ -r status=$? remove_from_db $patch |