diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/rpatch.in | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/rpatch.in b/scripts/rpatch.in index fd83e0d..eeb1363 100755 --- a/scripts/rpatch.in +++ b/scripts/rpatch.in @@ -28,22 +28,18 @@ files_may_have_changed() local patch=$1 file local patch_file=$(patch_file_name $patch) - local apply_t ts - apply_ts=$(date -r ".pc/$patch/.timestamp" '+%s') - if [ $? -ne 0 -o ! -e "$patch_file" -o ! -e ".pc/$patch/.timestamp" \ -o ".pc/$patch/.timestamp" -ot "$patch_file" ] then return 0 fi + local apply_ts=$(date -r ".pc/$patch/.timestamp" '+%s') ts for file in $(files_in_patch $patch) do - ts=$(date -r $file '+%s') 2> /dev/null - if [ $? -ne 0 -o "$ts" -gt $apply_ts ] - then - return 0 # file has changed - fi + ts=$(date -r $file '+%s' 2> /dev/null) + [ -z "$ts" ] && return 0 + [ "$ts" -gt $apply_ts ] && return 0 done return 1 } |