diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2006-02-06 03:57:35 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2006-02-06 03:57:35 +0000 |
commit | 1c56918eee78602861b04188394895dfd9a1876b (patch) | |
tree | 2675308e468700857a99792b026fc0c49b3ea96e | |
parent | 255eeefd0cbe44062a0c6be57c0c12f431f13543 (diff) | |
download | quilt-1c56918eee78602861b04188394895dfd9a1876b.tar.gz |
- More minor fixes.
-rwxr-xr-x | bin/patch-wrapper.in | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/bin/patch-wrapper.in b/bin/patch-wrapper.in index d41f42e..46ef8ae 100755 --- a/bin/patch-wrapper.in +++ b/bin/patch-wrapper.in @@ -160,30 +160,41 @@ then patch=$opt_input else patch=$(readlink /proc/self/fd/0) + # FIXME: try to recognize pipes, find the other end of a pipe + # in /proc, and for gzip and bzip2 processes, use the file + # that the process is reading from. fi patch=${patch#$PWD/} quilt_patches=${QUILT_PATCHES:-patches} -if [ ! -e "$quilt_patches/$patch" ] +dir=$(dirname "$quilt_patches/$patch") +mkdir -p "$dir" +if [ -e "$patch" ] then - dir=$(dirname "$quilt_patches/$patch") - mkdir -p "$dir" - updir=../ - while ! [ "$dir/$updir$patch" -ef "$patch" ] - do - updir=$updir../ - done - ln -s "$updir$patch" "$quilt_patches/$patch" + if [ "${patch:0:1}" = / ] + then + patch=${patch#/} + ln -s "$patch" "$quilt_patches/$patch" + else + while ! [ "$dir/$updir$patch" -ef "$patch" ] + do + updir=$updir../ + [ ${#updir} -gt 96 ] && break + done + if [ "$dir/$updir$patch" -ef "$patch" ] + then + ln -s "$updir$patch" "$quilt_patches/$patch" + fi + fi fi if [ "$opt_strip" = -p1 ]; then echo "$patch" else echo "$patch $opt_strip" -fi \ ->> $quilt_patches/series +fi >> $quilt_patches/series -$PATCH "${new_options[@]}" --backup --prefix ${QUILT_PC:-.pc}/$patch/ \ +$PATCH "${new_options[@]}" --backup --prefix "${QUILT_PC:-.pc}/$patch/" \ | backup_files status=${PIPESTATUS[0]} if [ $status -eq 0 ] @@ -198,6 +209,6 @@ then then echo 2 > ${QUILT_PC:-.pc}/.version fi - echo $patch >> "${QUILT_PC:-.pc}/applied-patches" + echo "$patch" >> "${QUILT_PC:-.pc}/applied-patches" fi exit $status |