forked from pool/quilt
e1c9c765c9
o Option -E is no longer passed to patch by default o Return 2 when there is nothing to do, contrasting with errors (ret=1) o Exit with an error when diff's retcode=2 (error) on patch refresh o bash_completion: cleanups and performance improvement (Savannah's #27111) o Add some tests to our testsuite, for a better coverage o Bug fix: Patches emptying files should work now o Bug fix: Check for duplicate patch in series (Savannah's #20628) o Obsoletes quilt-bash_completion-fix-completion-of-patch-names.patch o Obsoletes quilt-boost-the-speed-of-series-applied-and-unapplied.patch o Obsoletes quilt-enable-patch-wrapper-test.patch o Obsoletes quilt-files-return-nothing-if-there-are-no-files.patch o Obsoletes quilt-fix-quilt-diff-z-on-files-with-spaces-in-name.patch o Obsoletes quilt-patches-fix-heuristic-for-unapplied-patches-with-timestamps.patch o Obsoletes quilt-patches-optimize-processing-of-unapplied-patches.patch o Obsoletes quilt-patches-optimize-the-multiple-files-case.patch o Obsoletes quilt-refresh-fix-error-message.patch - Refresh patch-wrapper-rpm.diff - Refresh quilt-support-vimdiff.patch OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=82
89 lines
2.1 KiB
Diff
89 lines
2.1 KiB
Diff
--- a/bin/patch-wrapper.in
|
|
+++ b/bin/patch-wrapper.in
|
|
@@ -28,7 +28,7 @@ fi
|
|
|
|
backup_files()
|
|
{
|
|
- declare dir=${QUILT_PC:-.pc}/$patch
|
|
+ declare dir=${QUILT_PC:-.pc}/$name
|
|
|
|
if [ "$backup_mode" = --backup-if-mismatch ]
|
|
then
|
|
@@ -201,39 +201,56 @@ then
|
|
fi
|
|
|
|
quilt_patches=${QUILT_PATCHES:-patches}
|
|
-dir=$(dirname "$quilt_patches/$patch")
|
|
-mkdir -p "$dir"
|
|
-if [ -e "$patch" ]
|
|
+
|
|
+if [ "${patch#$RPM_SOURCE_DIR}" != "$patch" ]
|
|
+then
|
|
+ name=SOURCES/${patch#$RPM_SOURCE_DIR/}
|
|
+ if [ ! -e "$quilt_patches/SOURCES" ]
|
|
+ then
|
|
+ mkdir -p "$quilt_patches"
|
|
+ ln -s $RPM_SOURCE_DIR "$quilt_patches/SOURCES"
|
|
+ fi
|
|
+elif [ "${patch#$RPM_BUILD_DIR}" != "$patch" ]
|
|
then
|
|
+ name=BUILD/${patch#$RPM_BUILD_DIR/}
|
|
+ if [ ! -e "$quilt_patches/BUILD" ]
|
|
+ then
|
|
+ mkdir -p "$quilt_patches"
|
|
+ ln -s $RPM_BUILD_DIR "$quilt_patches/BUILD"
|
|
+ fi
|
|
+else
|
|
+ name=${patch#/}
|
|
+ dir=$(dirname "$quilt_patches/$name")
|
|
+ mkdir -p "$dir"
|
|
+
|
|
if [ "${patch:0:1}" = / ]
|
|
then
|
|
- ln -s "$patch" "$quilt_patches$patch"
|
|
- patch=${patch#/}
|
|
+ ln -s "$patch" "$quilt_patches/${name#/}"
|
|
else
|
|
- while ! [ "$dir/$updir$patch" -ef "$patch" ]
|
|
+ while ! [ "$dir/$updir$name" -ef "$patch" ]
|
|
do
|
|
updir=$updir../
|
|
[ ${#updir} -gt 96 ] && break
|
|
done
|
|
- if [ "$dir/$updir$patch" -ef "$patch" ]
|
|
+ if [ "$dir/$updir$name" -ef "$patch" ]
|
|
then
|
|
- ln -s "$updir$patch" "$quilt_patches/$patch"
|
|
+ ln -s "$updir$patch" "$quilt_patches/$name"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$opt_strip" = -p1 ]; then
|
|
- echo "$patch"
|
|
+ echo "$name"
|
|
else
|
|
- echo "$patch $opt_strip"
|
|
+ echo "$name $opt_strip"
|
|
fi >> $quilt_patches/series
|
|
|
|
-$PATCH "${new_options[@]}" --backup --prefix "${QUILT_PC:-.pc}/$patch/" \
|
|
+$PATCH "${new_options[@]}" --backup --prefix "${QUILT_PC:-.pc}/$name/" \
|
|
| backup_files
|
|
status=${PIPESTATUS[0]}
|
|
if [ $status -eq 0 ]
|
|
then
|
|
- dir=${QUILT_PC:-.pc}/$patch
|
|
+ dir=${QUILT_PC:-.pc}/$name
|
|
if [ ! -e "$dir" ]
|
|
then
|
|
mkdir -p "$dir"
|
|
@@ -243,6 +260,6 @@ then
|
|
then
|
|
echo 2 > ${QUILT_PC:-.pc}/.version
|
|
fi
|
|
- echo "$patch" >> "${QUILT_PC:-.pc}/applied-patches"
|
|
+ echo "$name" >> "${QUILT_PC:-.pc}/applied-patches"
|
|
fi
|
|
exit $status
|