diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2004-01-31 21:24:37 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2004-01-31 21:24:37 +0000 |
commit | 1d811743335c0392139a3822eaefdec51aa5ac02 (patch) | |
tree | dc2d6c6b48de54ed032e9dddfa5fe80ab5452e9b | |
parent | 62afdab5581516fb7c6f055572ceb81d4c1cc2e9 (diff) | |
download | quilt-1d811743335c0392139a3822eaefdec51aa5ac02.tar.gz |
- Also fix `quilt import' after patch name mangling removal.
-rw-r--r-- | quilt.changes | 5 | ||||
-rw-r--r-- | quilt/import.in | 94 |
2 files changed, 25 insertions, 74 deletions
diff --git a/quilt.changes b/quilt.changes index 0c42669..580eb92 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Sat Jan 31 22:23:51 CET 2004 - agruen@suse.de + +- Also fix `quilt import' after patch name mangling removal. + +------------------------------------------------------------------- Sat Jan 31 14:33:48 CET 2004 - agruen@suse.de - No longer remove common extensions (.dif, .diff, .patch, .gz, diff --git a/quilt/import.in b/quilt/import.in index fcf1cc2..24ef69e 100644 --- a/quilt/import.in +++ b/quilt/import.in @@ -53,9 +53,7 @@ while true do case "$1" in -n) - opt_patch=$(echo "$2" | - @SED@ -e 's/^'"$(quote_bre $QUILT_PATCHES)"'\///' \ - -e 's/^\$QUILT_PC\///') + opt_patch=${2#$QUILT_PATCHES/} shift 2 ;; -p) opt_strip=$2 @@ -83,23 +81,12 @@ fi if [ -n "$opt_patch" ] then - patch=$(stripit "$opt_patch") - patch_file="$QUILT_PATCHES/$opt_patch" -else - patch="$(stripit "$input_file")" - if [ -n "$patch" ] - then - opt_patch="$patch.patch" - else - echo $"Please use -n to specify a patch file name." - exit 1 - fi - patch_file="$QUILT_PATCHES/$opt_patch" -fi - -if echo "$patch_file" | grep -q -e $'[ \t]' + patch="$opt_patch" +elif [ -n "$input_file" ] then - echo $"Patch file name \"$patch_file\" contains whitespace." + patch="$input_file" +else + echo $"Please use -n to specify a patch file name." exit 1 fi @@ -109,66 +96,28 @@ then exit 1 fi -case "$input_file" in -'') - tmpfile=$(gen_tempfile) - if ! cat > $tmpfile - then - echo $"Cannot read from standard input." - rm -f $tmpfile - exit 1 - fi - input_file=$tmpfile ;; -*.gz) - tmpfile=$(gen_tempfile) - if ! gzip -cd "$input_file" > $tmpfile - then - echo $"Cannot decompress file $input_file" - rm -f $tmpfile - exit 1 - fi - input_file=$tmpfile ;; -*.bz2) - tmpfile=$(gen_tempfile) - if ! bzip2 -cd "$input_file" > $tmpfile - then - echo $"Cannot decompress file $input_file" - rm -f $tmpfile - exit - fi - input_file=$tmpfile ;; -*) - if ! [ -r "$input_file" ] - then - echo $"Cannot read from file $input_file" - exit 1 - fi -esac - -if [ -e "$patch_file" ] +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" - if ! cat "$input_file" > "$patch_file" - then - echo $"Failed to replace patch $patch" - exit 1 - fi else - echo $"Importing patch $patch (stored as $patch_file)" - if ! cat "$input_file" >> "$patch_file" - then - echo $"Failed to import patch $patch" - exit 1 - fi + 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 - -rm -rf $QUILT_PC/$patch if ! patch_in_series $patch && ! insert_in_series $opt_patch "$patch_args" @@ -176,10 +125,7 @@ then echo $"Failed to insert $patch in file series." fi -if [ -n "$tmpfile" ] -then - rm -f $tmpfile -fi +rm -rf $QUILT_PC/$patch ### Local Variables: ### mode: shell-script ### End: |