diff options
-rw-r--r-- | quilt.changes | 7 | ||||
-rw-r--r-- | quilt/applied.in | 28 | ||||
-rw-r--r-- | quilt/diff.in | 3 | ||||
-rw-r--r-- | quilt/pop.in | 14 | ||||
-rw-r--r-- | quilt/previous.in | 7 | ||||
-rw-r--r-- | scripts/patchfns.in | 19 |
6 files changed, 49 insertions, 29 deletions
diff --git a/quilt.changes b/quilt.changes index df013f8..8f323c6 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Sat Jul 26 13:06:07 CEST 2003 - agruen@suse.de + +- When popping files, go through the list of applied patches + instead of looking at the series file: The series file may + have changed. + +------------------------------------------------------------------- Sat Jul 26 12:49:36 CEST 2003 - agruen@suse.de - Install package documentation into $RPM_DOC_DIR if this diff --git a/quilt/applied.in b/quilt/applied.in index 82cc6e3..33a2cc3 100644 --- a/quilt/applied.in +++ b/quilt/applied.in @@ -19,7 +19,7 @@ fi usage() { - echo $"Usage: quilt applied [patch]" + echo $"Usage: quilt applied [-n] [patch]" if [ x$1 = x-h ] then echo $" @@ -27,7 +27,9 @@ usage() Print a list of applied patches, or all patches up to and including the specified patch in the file series. --n Print patch file names instead of patch names." +-n Print patch file names instead of patch names. + +" exit 0 else @@ -64,21 +66,21 @@ then elif [ $# -eq 1 ] then patch=$(stripit $1) + if ! is_applied "$patch" + then + echo $"Patch $patch is not applied" >&2 + exit 1 + fi else patch=$(top_patch) fi -if [ -n "$patch" ] -then - for patch in $( - patches_before $patch - echo $patch - ) - do - [ -n "$opt_filenames" ] && patch=$(patch_file_name $patch) - echo $patch - done -fi +for patch in $(applied_before "$patch") $patch +do + [ -n "$opt_filenames" ] && patch=$(patch_file_name $patch) + echo $patch +done + ### Local Variables: ### mode: shell-script ### End: diff --git a/quilt/diff.in b/quilt/diff.in index 0471dd5..8d721ec 100644 --- a/quilt/diff.in +++ b/quilt/diff.in @@ -42,7 +42,8 @@ included. -c patch Create a combined diff for all patches between this patch and - the patch specified with -P. + the patch specified with -P. A patch name of \"-\" is equivalent + to specifying the first applied patch. -R Create a reverse diff. diff --git a/quilt/pop.in b/quilt/pop.in index 4b8f565..ecd6719 100644 --- a/quilt/pop.in +++ b/quilt/pop.in @@ -50,13 +50,8 @@ patch name is specified, remove the next patch from the series file. list_patches() { - local top=$(top_patch) n=0 patch - if [ -z "$top" ] - then - return 0 - fi - ( patches_before $top - echo $top ) \ + local n=0 patch + applied_patches \ | tac \ | if [ -n "$opt_all" ] then @@ -78,11 +73,6 @@ list_patches() fi echo $patch done - if [ -n "$stop_at_patch" -a "$patch" != "$stop_at_patch" ] - then - echo $"Patch $stop_at_patch not found in file series" >&2 - return 1 - fi fi } diff --git a/quilt/previous.in b/quilt/previous.in index bbf17ac..36bfb30 100644 --- a/quilt/previous.in +++ b/quilt/previous.in @@ -19,7 +19,7 @@ fi usage() { - echo $"Usage: quilt previous [patch]" + echo $"Usage: quilt previous [-n] [patch]" if [ x$1 = x-h ] then echo $" @@ -69,12 +69,13 @@ else patch=$(top_patch) fi -if [ -n "$patch" ] +previous=$(applied_before "$patch" | tail -n 1) +if [ -n "$previous" ] then - previous=$(patches_before $patch | tail -n 1) [ -n "$opt_filenames" ] && previous=$(patch_file_name $previous) echo "$previous" fi + ### Local Variables: ### mode: shell-script ### End: diff --git a/scripts/patchfns.in b/scripts/patchfns.in index e2daff8..f16ad4e 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -272,6 +272,25 @@ is_applied() grep -q -E "^$(quote_re $patch)\$" $DB } +applied_patches() +{ + [ -e $DB ] || return 1 + cat $DB +} + +applied_before() +{ + local patch=$1 + + if [ -n "$patch" ] + then + @AWK@ ' + $0 == "'"$patch"'" { exit } + { print } + ' $DB + fi +} + patches_before() { local patch=$1 |