diff options
-rw-r--r-- | quilt.changes | 7 | ||||
-rw-r--r-- | quilt/refresh.in | 2 | ||||
-rwxr-xr-x | scripts/apatch.in | 1 | ||||
-rw-r--r-- | scripts/patchfns.in | 3 | ||||
-rwxr-xr-x | scripts/rpatch.in | 16 | ||||
-rw-r--r-- | test/failpop.test | 27 |
6 files changed, 45 insertions, 11 deletions
diff --git a/quilt.changes b/quilt.changes index a05e606..a06f1fd 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Nov 4 16:51:49 CET 2003 - agruen@suse.de + +- Add failpop.test that checks if modified patches are recognized. +- Fix the check for modified patches: That broke with the .pc file + removal. + +------------------------------------------------------------------- Fri Oct 31 16:59:06 CET 2003 - agruen@suse.de - Bump version number to 0.28 (cvs tag VER_0_28). diff --git a/quilt/refresh.in b/quilt/refresh.in index 84d9d18..a22fadb 100644 --- a/quilt/refresh.in +++ b/quilt/refresh.in @@ -193,7 +193,7 @@ then die 1 fi -touch .pc/$patch +touch .pc/$patch/.timestamp rm -f .pc/$patch~refresh echo $"Refreshed patch $patch" 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 diff --git a/test/failpop.test b/test/failpop.test new file mode 100644 index 0000000..9b4cc3d --- /dev/null +++ b/test/failpop.test @@ -0,0 +1,27 @@ + $ mkdir d + $ cd d + + $ cat > test.txt + < This is test.txt. + + $ quilt new test.diff + > Patch test is now on top + + $ quilt add test.txt + > File test.txt added to patch test + + $ cat >> test.txt + < Line two. + + $ quilt refresh + > Refreshed patch test + + $ sleep 2 + + $ sed -e "s/ /_/g" patches/test.diff > patches/test.new + $ mv patches/test.new patches/test.diff + $ quilt pop + > Patch test does not remove cleanly (enforce with -f). + + $ cd .. + $ rm -rf d |