summaryrefslogtreecommitdiffstats
path: root/scripts/rpatch.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-01-28 00:20:56 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-01-28 00:20:56 +0000
commitddce6706ba78d3cbba784b34cfcbef5a5361ccce (patch)
tree8ab1bd94b06c6e42f0fc1b97e2cb3a9966c2e884 /scripts/rpatch.in
parentc8f14351198fc69541f17aae56937b79c8d9a29c (diff)
downloadquilt-ddce6706ba78d3cbba784b34cfcbef5a5361ccce.tar.gz
- Add support for working in subdirectories of the base directory
that contains patches/ and .pc/. In the unlikely case that quilt shall operate in the sub-directory itself, it is sufficient to create a patches/ directory there. - Add a small testcase for subdirectory support.
Diffstat (limited to 'scripts/rpatch.in')
-rwxr-xr-xscripts/rpatch.in21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/rpatch.in b/scripts/rpatch.in
index eeb1363..e4dfefb 100755
--- a/scripts/rpatch.in
+++ b/scripts/rpatch.in
@@ -28,13 +28,14 @@ files_may_have_changed()
local patch=$1 file
local patch_file=$(patch_file_name $patch)
- if [ $? -ne 0 -o ! -e "$patch_file" -o ! -e ".pc/$patch/.timestamp" \
- -o ".pc/$patch/.timestamp" -ot "$patch_file" ]
+ if [ $? -ne 0 -o ! -e "$patch_file" \
+ -o ! -e "$QUILT_PC/$patch/.timestamp" \
+ -o "$QUILT_PC/$patch/.timestamp" -ot "$patch_file" ]
then
return 0
fi
- local apply_ts=$(date -r ".pc/$patch/.timestamp" '+%s') ts
+ local apply_ts=$(date -r "$QUILT_PC/$patch/.timestamp" '+%s') ts
for file in $(files_in_patch $patch)
do
ts=$(date -r $file '+%s' 2> /dev/null)
@@ -53,10 +54,10 @@ check_for_pending_changes()
local patch_args=$(patch_args $patch)
local workdir=$(gen_tempfile -d quilt) status=0
- if [ -d .pc/$patch ]
+ if [ -d $QUILT_PC/$patch ]
then
if ! rmdir $workdir || # note that this is racey...
- ! cp -rl .pc/$patch $workdir/
+ ! cp -rl $QUILT_PC/$patch $workdir/
then
echo $"Failed to copy files to temporary directory"
rm -rf $workdir
@@ -84,7 +85,7 @@ check_for_pending_changes()
# files won't succeed, either. So, ignore the error
# in that particular case.
- if ! [ -e .pc/$patch ]
+ if ! [ -e $QUILT_PC/$patch ]
then
echo $"Failed to patch temporary files"
rm -rf $workdir
@@ -133,11 +134,11 @@ 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
+ rm -f "$QUILT_PC/$patch/.timestamp"
+ @LIB@/backup-files $silent -f $pc_file -B $QUILT_PC/$patch/ -r
status=$?
remove_from_db $patch
- rm -f .pc/$patch~refresh
+ rm -f $QUILT_PC/$patch~refresh
fi
rm -f $pc_file
trap - SIGINT
@@ -187,7 +188,7 @@ patch=$(stripit $1)
[ -z "$opt_verbose" ] && silent_unless_verbose=-s
top=$(top_patch)
-if [ -n "$top" -a -e .pc/$top~refresh -a -z "$opt_force" ]
+if [ -n "$top" -a -e $QUILT_PC/$top~refresh -a -z "$opt_force" ]
then
echo $"The topmost patch $top needs to be refreshed first."
exit 1