diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/apatch.in | 11 | ||||
-rwxr-xr-x | scripts/rpatch.in | 23 |
2 files changed, 10 insertions, 24 deletions
diff --git a/scripts/apatch.in b/scripts/apatch.in index 94c74b4..38235cc 100755 --- a/scripts/apatch.in +++ b/scripts/apatch.in @@ -62,17 +62,14 @@ apply_patch() rollback_patch() { - local patch=$1 pc_file=$(gen_tempfile) + local patch=$1 - # FIXME backup_files should scan the directory hierarchy itself. - files_in_patch $patch > $pc_file - @LIB@/backup-files $silent_unless_verbose \ - -f $pc_file -B $QUILT_PC/$patch/ -r if [ -z "$opt_leave_rejects" ] then - @SED@ -e 's/$/\.rej/' $pc_file | xargs rm -f + files_in_patch | @SED@ -e 's/$/\.rej/' | xargs rm -f fi - rm -f $pc_file + + @LIB@/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ - } apatch() diff --git a/scripts/rpatch.in b/scripts/rpatch.in index 9b5d6e7..bbe988f 100755 --- a/scripts/rpatch.in +++ b/scripts/rpatch.in @@ -49,7 +49,7 @@ files_may_have_changed() # and report any pending changes. check_for_pending_changes() { - local patch=$1 pc_file=$2 + local patch=$1 local patch_file=$(patch_file_name $patch) local patch_args=$(patch_args $patch) local workdir=$(gen_tempfile -d quilt) status=0 @@ -90,10 +90,10 @@ check_for_pending_changes() fi local remains=$(gen_tempfile) - while read file + for file in $(files_in_patch $patch) do diff_file $file $workdir/$file $file >> $remains - done < $pc_file + done if [ -s $remains ] then @@ -108,35 +108,24 @@ check_for_pending_changes() rpatch() { - local patch=$1 pc_file=$(gen_tempfile) status=0 - - # FIXME backup-files should scan the directory tree itself. - files_in_patch $patch > $pc_file - if ! [ -s $pc_file ] - then - echo $"Patch $patch appears to be empty, removed" - remove_from_db $patch - return 0 - fi + local patch=$1 status=0 trap "" SIGINT if [ -z "$opt_force" ] && \ ( [ -n "$opt_remove" ] || files_may_have_changed $patch ) then - check_for_pending_changes $patch $pc_file || status=1 + check_for_pending_changes $patch || status=1 fi if [ $status -eq 0 ] then echo $"Removing $patch" rm -f "$QUILT_PC/$patch/.timestamp" - @LIB@/backup-files $silent -r -L -f $pc_file \ - -B $QUILT_PC/$patch/ + @LIB@/backup-files $silent -r -B $QUILT_PC/$patch/ - status=$? remove_from_db $patch rm -f $QUILT_PC/$patch~refresh fi - rm -f $pc_file trap - SIGINT return $status } |