? Makefile ? autom4te.cache ? config.log ? config.status ? fixes.diff ? peter.quilt.diff ? quilt/fork.in ? scripts/parse-patch Index: Makefile.in =================================================================== RCS file: /cvsroot/quilt/quilt/Makefile.in,v retrieving revision 1.23 diff -u -p -r1.23 Makefile.in --- Makefile.in 23 Jul 2003 10:42:21 -0000 1.23 +++ Makefile.in 25 Jul 2003 15:12:49 -0000 @@ -56,7 +56,7 @@ SRC += $(BIN_SRC:%=bin/%) DIRT += $(BIN_IN:%=bin/%) QUILT_IN := add applied delete diff files import new next patches \ - pop previous push refresh remove series setup top unapplied + pop previous push refresh remove series setup top unapplied fork QUILT_SRC := $(QUILT_IN:%=%.in) QUILT := $(QUILT_IN) @@ -214,7 +214,7 @@ install : scripts @INSTALL@ -m 755 -s $(LIB:%=lib/%) $(BUILD_ROOT)$(LIB_DIR)/ @INSTALL@ -d $(BUILD_ROOT)$(docdir)/$(PACKAGE) - @INSTALL@ -m 644 doc/README $(BUILD_ROOT)$(docdir)/$(PACKAGE)/ +# @INSTALL@ -m 644 doc/README $(BUILD_ROOT)$(docdir)/$(PACKAGE)/ @INSTALL@ -d $(BUILD_ROOT)$(mandir)/man1 @INSTALL@ -m 644 $(MAN1) $(BUILD_ROOT)$(mandir)/man1/ Index: configure.ac =================================================================== RCS file: /cvsroot/quilt/quilt/configure.ac,v retrieving revision 1.15 diff -u -p -r1.15 configure.ac --- configure.ac 23 Jul 2003 09:44:35 -0000 1.15 +++ configure.ac 25 Jul 2003 15:12:49 -0000 @@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) AC_REVISION ($Revision: 1.15 $) -PACKAGE_RELEASE=1 +PACKAGE_RELEASE=2cfs AC_SUBST(PACKAGE_RELEASE) dnl Setup for backup-files compilation Index: quilt.spec.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt.spec.in,v retrieving revision 1.9 diff -u -p -r1.9 quilt.spec.in --- quilt.spec.in 18 May 2003 13:24:44 -0000 1.9 +++ quilt.spec.in 25 Jul 2003 15:12:49 -0000 @@ -42,6 +42,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) +/etc/bash_completion.d/quilt /usr/bin/guards /usr/bin/quilt Index: quilt/applied.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/applied.in,v retrieving revision 1.7 diff -u -p -r1.7 applied.in --- quilt/applied.in 14 Feb 2003 13:18:11 -0000 1.7 +++ quilt/applied.in 25 Jul 2003 15:12:49 -0000 @@ -19,15 +19,16 @@ fi usage() { - echo $"Usage: quilt applied [patch]" + echo $"Usage: quilt applied [-n] [patch]" if [ x$1 = x-h ] then echo $" -Print a list of applied patches, or all patches up to and including the -specified patch in the file series. +Print a list of applied patches. --n Print patch file names instead of patch names." +-n Print patch file names instead of patch names. + +" exit 0 else @@ -64,21 +65,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 +for patch in $(applied_before "$patch") $patch +do [ -n "$opt_filenames" ] && patch=$(patch_file_name $patch) echo $patch - done -fi +done + ### Local Variables: ### mode: shell-script ### End: Index: quilt/diff.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/diff.in,v retrieving revision 1.21 diff -u -p -r1.21 diff.in --- quilt/diff.in 5 Apr 2003 20:19:39 -0000 1.21 +++ quilt/diff.in 25 Jul 2003 15:12:49 -0000 @@ -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. Index: quilt/previous.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/previous.in,v retrieving revision 1.8 diff -u -p -r1.8 previous.in --- quilt/previous.in 7 Apr 2003 14:04:19 -0000 1.8 +++ quilt/previous.in 25 Jul 2003 15:12:49 -0000 @@ -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: Index: quilt/push.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/push.in,v retrieving revision 1.15 diff -u -p -r1.15 push.in --- quilt/push.in 25 Jun 2003 13:50:29 -0000 1.15 +++ quilt/push.in 25 Jul 2003 15:12:49 -0000 @@ -1,5 +1,4 @@ #! @BASH@ - # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. @@ -164,13 +163,22 @@ then exit 1 fi fi - if ! patches=$(list_patches) 2>&1 then exit 1 elif [ -z "$patches" ] then top=$(top_patch) + top_patch_file=$(patch_file_name $top) + + if [ -z "$top_patch_file" ] + then + echo "Now the top patch $top is not in the series file anymore" + echo "Cannot decide your next patch from the series file!" + echo "please pop -f the top file and check your series file again" + exit 1 + fi + if [ -z "$top" ] then echo $"No patch applied" Index: scripts/patchfns.in =================================================================== RCS file: /cvsroot/quilt/quilt/scripts/patchfns.in,v retrieving revision 1.18 diff -u -p -r1.18 patchfns.in --- scripts/patchfns.in 16 May 2003 18:46:31 -0000 1.18 +++ scripts/patchfns.in 25 Jul 2003 15:12:49 -0000 @@ -33,6 +33,7 @@ else fi DB=".pc/applied-patches" +DB_FILE=".pc/applied-patches-file" # Quote a string for use in a basic regular expression. quote_bre() @@ -76,7 +77,19 @@ patch_file_name() ' $SERIES fi } +applied_patch_file_name() +{ + local patch=$1 + if [ -e $DB_FILE ] + then + /bin/gawk '/^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \ + { printf "'"$P"'patches/%s\n", $1 + exit + } + ' $DB_FILE + fi +} # The -pN option and possibly others that should be passed to patch. patch_args() { @@ -272,6 +285,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 @@ -430,19 +462,28 @@ modified_files() add_to_db() { + local file_name=$(patch_file_name $1) + file_name=`basename $(patch_file_name $1)` echo $1 >> $DB + echo $file_name >> $DB_FILE } remove_from_db() { local patch=$1 - local tmpfile + local tmpfile tmpfile2 + local patch_file=$(applied_patch_file_name $1) + tmpfile2=$(gen_tempfile) if tmpfile=$(gen_tempfile) then grep -v -E "^$(quote_re $patch)\$" $DB > $tmpfile + grep -v -E "^$(quote_re $patch_file)\$" $DB > $tmpfile2 mv -f $tmpfile $DB + mv -f $tmpfile2 $DB_FILE rm -f $tmpfile + rm -f $tmpfile2 [ -s $DB ] || rm -f $DB + [ -s $DB_FILE ] || rm -f $DB_FILE fi } Index: scripts/rpatch.in =================================================================== RCS file: /cvsroot/quilt/quilt/scripts/rpatch.in,v retrieving revision 1.6 diff -u -p -r1.6 rpatch.in --- scripts/rpatch.in 16 May 2003 18:47:29 -0000 1.6 +++ scripts/rpatch.in 25 Jul 2003 15:12:49 -0000 @@ -56,7 +56,7 @@ verify_removal() files_may_have_changed() { local patch=$1 file - local patch_file=$(patch_file_name $patch) + local patch_file=$(applied_patch_file_name $patch) local pc_file=$(pc_file_name $patch) if ! [ -e $pc_file ] @@ -134,6 +134,13 @@ rpatch() { local patch=$1 pc_file=$(pc_file_name $patch) + local patch_file=$(patch_file_name $patch) + if [ $opt_force != 1 ] && [ -z "$patch_file" ] + then + echo "can not find the $patch in your series file, the series file may changed" + echo "please use -f option" + return 0 + fi if ! [ -e $pc_file ] then echo $"Patch $patch appears to be empty, removed" @@ -196,7 +203,7 @@ if [ $? -ne 0 ] then usage fi - +opt_force=0 eval set -- "$options" while true