summaryrefslogtreecommitdiffstats
path: root/scripts/rpatch.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rpatch.in')
-rwxr-xr-xscripts/rpatch.in16
1 files changed, 7 insertions, 9 deletions
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