summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-11-04 15:53:15 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-11-04 15:53:15 +0000
commit477c8a0b21b5f546904574e630139736cdaf2951 (patch)
tree1fc7a384a3ae98a0ed854cad0e6dd538962caf3b /scripts
parent11006bdc9ed6c400cca019886f395febc9110b06 (diff)
downloadquilt-477c8a0b21b5f546904574e630139736cdaf2951.tar.gz
- Add failpop.test that checks if modified patches are recognized.
- Fix the check for modified patches: That broke with the .pc file removal.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/apatch.in1
-rw-r--r--scripts/patchfns.in3
-rwxr-xr-xscripts/rpatch.in16
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