diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2004-03-13 23:40:04 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2004-03-13 23:40:04 +0000 |
commit | ba4159c5560e475cf59c994bdd68888a6e57a5a6 (patch) | |
tree | 09fd6d57ce0a8306cea763168f404c368aba3e35 | |
parent | eb23e220c8c74f8d92ad4cb8ae565e0f020093bb (diff) | |
download | quilt-ba4159c5560e475cf59c994bdd68888a6e57a5a6.tar.gz |
- Change `quilt import' to allow importing multiple patches
at once.
- Update to version 0.32.
-rw-r--r-- | quilt.changes | 7 | ||||
-rw-r--r-- | quilt/import.in | 90 |
2 files changed, 47 insertions, 50 deletions
diff --git a/quilt.changes b/quilt.changes index 6275ffd..6959a96 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Sun Mar 14 00:39:46 CET 2004 - agruen@suse.de + +- Change `quilt import' to allow importing multiple patches + at once. +- Update to version 0.32. + +------------------------------------------------------------------- Sun Mar 14 00:25:27 CET 2004 - agruen@suse.de - Add `quilt graph' command for generating a dependency graph diff --git a/quilt/import.in b/quilt/import.in index 24ef69e..43d7f12 100644 --- a/quilt/import.in +++ b/quilt/import.in @@ -19,19 +19,18 @@ fi usage() { - echo $"Usage: quilt import [-f] [-p num] [-n patch] [patchfile]" + echo $"Usage: quilt import [-f] [-p num] [-n patch] patchfile ..." if [ x$1 = x-h ] then echo $" -Import an external patch. If a patch file name is specified, the patch -will be stored in this relative path in the patches/ directory. Else, -if an input file name is given this name is used as the patch name. +Import external patches. -p num Number of directory levels to strip when aplying (default=1) -n patch - File name relative to patches/ to use. + Patch filename to use inside quilt. This option can only be + used when importing a single patch. -f Overwite/update existing patches." exit 0 @@ -69,63 +68,54 @@ do esac done -if [ $# -eq 1 ] +if [ $# -gt 1 -a -n "$opt_patch" ] then - input_file=$1 -elif [ $# -gt 1 ] -then - usage + echo $"Option \`-n' can only be used when importing a single patch" + exit 1 fi [ -n "$opt_strip" ] && patch_args="-p$opt_strip" -if [ -n "$opt_patch" ] -then - patch="$opt_patch" -elif [ -n "$input_file" ] -then - patch="$input_file" -else - echo $"Please use -n to specify a patch file name." - exit 1 -fi +for patch_file in "$@" +do + if [ -n "$opt_patch" ] + then + patch=$opt_patch + else + patch=$patch_file + fi -if is_applied $patch -then - echo $"Patch $patch is applied." - exit 1 -fi + if is_applied $patch + then + echo $"Patch $patch is applied." + exit 1 + fi -if [ -e "$QUILT_PATCHES/$patch" ] -then - if [ -z "$opt_force" ] + if [ -e "$QUILT_PATCHES/$patch" ] + then + if [ -z "$opt_force" ] + then + echo $"Patch $patch exists. Replace with -f." + exit 1 + fi + echo $"Replacing patch $patch with new version" + else + echo $"Importing patch $patch (stored as $patch)" + fi + if ! cp "$patch_file" "$QUILT_PATCHES/$patch" then - echo $"Patch $patch exists. Replace with -f." + echo $"Failed to import patch $patch" exit 1 fi - echo $"Replacing patch $patch with new version" -else - echo $"Importing patch $patch (stored as $patch)" -fi -if [ -n "$input_file" ] -then - cp "$input_file" "$QUILT_PATCHES/$patch" -else - cat > "$QUILT_PATCHES/$patch" -fi -if [ $? -ne 0 ] -then - echo $"Failed to import patch $patch" - exit 1 -fi -if ! patch_in_series $patch && - ! insert_in_series $opt_patch "$patch_args" -then - echo $"Failed to insert $patch in file series." -fi + if ! patch_in_series $patch && + ! insert_in_series $opt_patch "$patch_args" + then + echo $"Failed to insert $patch in file series." + fi -rm -rf $QUILT_PC/$patch + rm -rf $QUILT_PC/$patch +done ### Local Variables: ### mode: shell-script ### End: |