forked from pool/quilt
Accepting request 237536 from devel:tools:scm
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/237536 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/quilt?expand=0&rev=54
This commit is contained in:
commit
576b96bf50
@ -1,17 +1,15 @@
|
|||||||
Index: quilt-0.46/bin/patch-wrapper.in
|
--- a/bin/patch-wrapper.in
|
||||||
===================================================================
|
+++ b/bin/patch-wrapper.in
|
||||||
--- quilt-0.46.orig/bin/patch-wrapper.in
|
@@ -28,7 +28,7 @@ fi
|
||||||
+++ quilt-0.46/bin/patch-wrapper.in
|
|
||||||
@@ -27,7 +27,7 @@ then
|
|
||||||
fi
|
|
||||||
|
|
||||||
backup_files() {
|
backup_files()
|
||||||
|
{
|
||||||
- declare dir=${QUILT_PC:-.pc}/$patch
|
- declare dir=${QUILT_PC:-.pc}/$patch
|
||||||
+ declare dir=${QUILT_PC:-.pc}/$name
|
+ declare dir=${QUILT_PC:-.pc}/$name
|
||||||
|
|
||||||
if [ "$backup_mode" = --backup-if-mismatch ]
|
if [ "$backup_mode" = --backup-if-mismatch ]
|
||||||
then
|
then
|
||||||
@@ -195,39 +195,56 @@ then
|
@@ -201,39 +201,56 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
quilt_patches=${QUILT_PATCHES:-patches}
|
quilt_patches=${QUILT_PATCHES:-patches}
|
||||||
@ -80,7 +78,7 @@ Index: quilt-0.46/bin/patch-wrapper.in
|
|||||||
if [ ! -e "$dir" ]
|
if [ ! -e "$dir" ]
|
||||||
then
|
then
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
@@ -237,6 +254,6 @@ then
|
@@ -243,6 +260,6 @@ then
|
||||||
then
|
then
|
||||||
echo 2 > ${QUILT_PC:-.pc}/.version
|
echo 2 > ${QUILT_PC:-.pc}/.version
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:92ddb850e84cee29b97cde53537591b648402aaba6686c358857fb9597a0f6bc
|
|
||||||
size 389944
|
|
3
quilt-0.63.tar.bz2
Normal file
3
quilt-0.63.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:79ee1884720bc23456fd9943c1cf990b2f1460e46b41ed26b747399c91602b0f
|
||||||
|
size 342022
|
@ -1,162 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Tue, 7 Jan 2014 16:56:16 +0100
|
|
||||||
Subject: bash_completion: Fix completion of patch names
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: f535e6f731668035a3fa2472628ba82146ea7262
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
When the user's quilt configuration file (~/.quiltrc or
|
|
||||||
/etc/quilt.quiltrc) contains QUILT_PATCHES_PREFIX=yes (and the
|
|
||||||
default /etc/quilt.quiltrc does), bash completion chokes on patch
|
|
||||||
names. This is because quilt series, applied and unapplied return
|
|
||||||
relative patch names instead of the expected absolute patch names.
|
|
||||||
|
|
||||||
This can be solved by skipping configuration files when quilt is
|
|
||||||
called from the bash completion script.
|
|
||||||
|
|
||||||
This fixes bug #27111:
|
|
||||||
https://savannah.nongnu.org/bugs/index.php?27111
|
|
||||||
|
|
||||||
diff --git a/bash_completion b/bash_completion
|
|
||||||
index 19736cb..0918598 100644
|
|
||||||
--- a/bash_completion
|
|
||||||
+++ b/bash_completion
|
|
||||||
@@ -6,6 +6,11 @@
|
|
||||||
# This file is part of the distribution of quilt, and is distributed under
|
|
||||||
# the same licence than quilt itself
|
|
||||||
|
|
||||||
+# WARNING: This script doesn't read user or system quiltrc files, and assumes
|
|
||||||
+# that QUILT_PC is left unchanged. If you have changed QUILT_PC and want
|
|
||||||
+# completion to work then you must set QUILT_PC in your global environment
|
|
||||||
+# (for example in ~/.profile) and not just in your quiltrc file.
|
|
||||||
+
|
|
||||||
if type quilt &> /dev/null ; then
|
|
||||||
|
|
||||||
if ! type _expand &> /dev/null ; then
|
|
||||||
@@ -123,7 +128,7 @@ _quilt_completion()
|
|
||||||
add)
|
|
||||||
case $prev in
|
|
||||||
-P)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
_quilt_comfile
|
|
||||||
@@ -134,7 +139,7 @@ _quilt_completion()
|
|
||||||
annotate)
|
|
||||||
case $prev in
|
|
||||||
-P)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
_quilt_comfile
|
|
||||||
@@ -143,10 +148,10 @@ _quilt_completion()
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
applied)
|
|
||||||
- COMPREPLY=( $( compgen -W "-h $(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-h $(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
delete)
|
|
||||||
- COMPREPLY=( $( compgen -W "-n -r -h --backup $(quilt series)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-n -r -h --backup $(quilt --quiltrc - series)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
diff)
|
|
||||||
case $prev in
|
|
||||||
@@ -154,7 +159,7 @@ _quilt_completion()
|
|
||||||
COMPREPLY=( $( compgen -W "0 1" -- $cur ) )
|
|
||||||
;;
|
|
||||||
-P|--combine)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
--diff|-U|-C)
|
|
||||||
;;
|
|
||||||
@@ -171,10 +176,10 @@ _quilt_completion()
|
|
||||||
files)
|
|
||||||
case $prev in
|
|
||||||
--combine)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
- COMPREPLY=( $( compgen -W "-a -l -v -h --combine $(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-a -l -v -h --combine $(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
@@ -198,7 +203,7 @@ _quilt_completion()
|
|
||||||
COMPREPLY=( $( compgen -W "files" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
- COMPREPLY=( $( compgen -W "-T -h --all --reduce --lines --edge-labels $(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-T -h --all --reduce --lines --edge-labels $(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
@@ -207,7 +212,7 @@ _quilt_completion()
|
|
||||||
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "-h" -- $cur ) )
|
|
||||||
;;
|
|
||||||
header)
|
|
||||||
- COMPREPLY=( $( compgen -W "-a -e -h -r --backup --strip-diffstat --strip-trailing-whitespace $(quilt series)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-a -e -h -r --backup --strip-diffstat --strip-trailing-whitespace $(quilt --quiltrc - series)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
import)
|
|
||||||
case $prev in
|
|
||||||
@@ -229,17 +234,17 @@ _quilt_completion()
|
|
||||||
COMPREPLY=( $( compgen -W "-m --prefix --mbox --send --sender --from --subject --to --cc --bcc" -- $cur ) )
|
|
||||||
;;
|
|
||||||
next|previous)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt series)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - series)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
patches)
|
|
||||||
_quilt_comfile
|
|
||||||
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "-v -h" -- $cur ) )
|
|
||||||
;;
|
|
||||||
pop)
|
|
||||||
- COMPREPLY=( $( compgen -W "-a -f -R -q -v -h $(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-a -f -R -q -v -h $(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
push)
|
|
||||||
- COMPREPLY=( $( compgen -W "-a -f -q -v -h --leave-rejects --interactive --color $(quilt unapplied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-a -f -q -v -h --leave-rejects --interactive --color $(quilt --quiltrc - unapplied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
refresh)
|
|
||||||
case $prev in
|
|
||||||
@@ -249,14 +254,14 @@ _quilt_completion()
|
|
||||||
-U|-C)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
- COMPREPLY=( $( compgen -W "-p -u -U -c -C -f -h $(quilt applied 2>/dev/null) --no-timestamps --no-index --diffstat --sort --backup --strip-trailing-whitespace" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-p -u -U -c -C -f -h $(quilt --quiltrc - applied 2>/dev/null) --no-timestamps --no-index --diffstat --sort --backup --strip-trailing-whitespace" -- $cur ) )
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
remove|revert)
|
|
||||||
case $prev in
|
|
||||||
-P)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt applied 2>/dev/null)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - applied 2>/dev/null)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
_quilt_comfile
|
|
||||||
@@ -267,7 +272,7 @@ _quilt_completion()
|
|
||||||
rename)
|
|
||||||
case $prev in
|
|
||||||
-P)
|
|
||||||
- COMPREPLY=( $( compgen -W "$(quilt series)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "$(quilt --quiltrc - series)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=( $( compgen -W "-P -h" -- $cur ) )
|
|
||||||
@@ -292,7 +297,7 @@ _quilt_completion()
|
|
||||||
COMPREPLY=( $( compgen -W "-d -h" -- $cur ) )
|
|
||||||
;;
|
|
||||||
unapplied)
|
|
||||||
- COMPREPLY=( $( compgen -W "-h $(quilt series)" -- $cur ) )
|
|
||||||
+ COMPREPLY=( $( compgen -W "-h $(quilt --quiltrc - series)" -- $cur ) )
|
|
||||||
;;
|
|
||||||
fork|new|top|upgrade)
|
|
||||||
;;
|
|
@ -1,97 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Sun, 2 Mar 2014 16:29:24 +0100
|
|
||||||
Subject: Boost the speed of the series, applied and unapplied commands
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: e052a2d22569f56a30285716da11b4e0a1eed052
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
The current implementation of the series, applied and unapplied
|
|
||||||
commands performs rather poorly, especially on large patch sets. To
|
|
||||||
make things worse, bash completion makes use of these commands, so
|
|
||||||
it becomes next to unusable on large patch sets.
|
|
||||||
|
|
||||||
Instead of looping over each patch, use the power of printf to print
|
|
||||||
everything in one go. Performance gains on a 15k patch series are
|
|
||||||
breathtaking:
|
|
||||||
|
|
||||||
series: 189.4 s -> 0.6 s
|
|
||||||
series -v: 92.9 s -> 0.6 s
|
|
||||||
applied: 3.5 s -> 0.1 s
|
|
||||||
unapplied: 3.9 s -> 0.1 s
|
|
||||||
|
|
||||||
---
|
|
||||||
quilt/applied.in | 5 +----
|
|
||||||
quilt/scripts/patchfns.in | 8 ++++++++
|
|
||||||
quilt/series.in | 9 ++++-----
|
|
||||||
quilt/unapplied.in | 10 ++--------
|
|
||||||
4 files changed, 15 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
--- a/quilt/applied.in
|
|
||||||
+++ b/quilt/applied.in
|
|
||||||
@@ -61,10 +61,7 @@ patch=$(find_applied_patch "$1") || exit
|
|
||||||
|
|
||||||
setup_pager
|
|
||||||
|
|
||||||
-for patch in $(applied_before "$patch") $patch
|
|
||||||
-do
|
|
||||||
- echo "$(print_patch $patch)"
|
|
||||||
-done
|
|
||||||
+printf "$(patch_format)\n" $(applied_before "$patch") "$patch"
|
|
||||||
|
|
||||||
### Local Variables:
|
|
||||||
### mode: shell-script
|
|
||||||
--- a/quilt/scripts/patchfns.in
|
|
||||||
+++ b/quilt/scripts/patchfns.in
|
|
||||||
@@ -976,6 +976,14 @@ print_patch() {
|
|
||||||
echo -n "${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
+# Generate a format suitable to print patch names with printf
|
|
||||||
+patch_format()
|
|
||||||
+{
|
|
||||||
+ local prefix=${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}
|
|
||||||
+
|
|
||||||
+ echo -n "${prefix/\%/%%}%s"
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
setup_colors()
|
|
||||||
{
|
|
||||||
local C=diff_hdr=32:diff_add=36:diff_mod=35:diff_rem=35:diff_hunk=33:diff_ctx=35:diff_cctx=33:patch_offs=33:patch_fuzz=35:patch_fail=31:series_app=32:series_top=33:series_una=00:clear=00
|
|
||||||
--- a/quilt/series.in
|
|
||||||
+++ b/quilt/series.in
|
|
||||||
@@ -40,12 +40,11 @@ cat_patches()
|
|
||||||
{
|
|
||||||
local color=$1 prefix=$2
|
|
||||||
shift 2
|
|
||||||
- local patch
|
|
||||||
|
|
||||||
- for patch in "$@"
|
|
||||||
- do
|
|
||||||
- echo "$color$prefix$(print_patch "$patch")$color_clear"
|
|
||||||
- done
|
|
||||||
+ if [ $# -ge 1 ]
|
|
||||||
+ then
|
|
||||||
+ printf "$color$prefix$(patch_format)$color_clear\n" "$@"
|
|
||||||
+ fi
|
|
||||||
}
|
|
||||||
|
|
||||||
options=`getopt -o vh --long color:: -- "$@"`
|
|
||||||
--- a/quilt/unapplied.in
|
|
||||||
+++ b/quilt/unapplied.in
|
|
||||||
@@ -67,14 +67,8 @@ fi
|
|
||||||
|
|
||||||
setup_pager
|
|
||||||
|
|
||||||
-(
|
|
||||||
- echo "$patch"
|
|
||||||
- patches_after "$patch"
|
|
||||||
-) \
|
|
||||||
-| while read patch
|
|
||||||
-do
|
|
||||||
- echo "$(print_patch $patch)"
|
|
||||||
-done
|
|
||||||
+printf "$(patch_format)\n" "$patch" $(patches_after "$patch")
|
|
||||||
+
|
|
||||||
### Local Variables:
|
|
||||||
### mode: shell-script
|
|
||||||
### End:
|
|
@ -1,28 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Wed, 16 Apr 2014 11:44:55 +0200
|
|
||||||
Subject: Re-enable patch-wrapper test
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 293c4ddbf61f69a5cfb3a71f89cb3e48d3ccda7e
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
The patch-wrapper test was unconditionally disabled by commit
|
|
||||||
97200435 ("Only run test/patch-wrapper.test if the
|
|
||||||
--with-patch-wrapper config option is used.") Re-enable this test
|
|
||||||
when the --with-patch-wrapper config option is actually used.
|
|
||||||
|
|
||||||
---
|
|
||||||
Makefile.in | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
--- a/Makefile.in
|
|
||||||
+++ b/Makefile.in
|
|
||||||
@@ -120,6 +120,9 @@ NON_EXEC_IN := doc/quilt.1 doc/README qu
|
|
||||||
GIT_DESC := $(shell ./git-desc | sed -e 's:^v::')
|
|
||||||
|
|
||||||
TESTS := $(filter-out test/patch-wrapper.test,$(wildcard test/*.test))
|
|
||||||
+ifneq ($(PATCH_WRAPPER),)
|
|
||||||
+TESTS += test/patch-wrapper.test
|
|
||||||
+endif
|
|
||||||
DIRT += test/.depend $(wildcard test/.*.ok)
|
|
||||||
|
|
||||||
# Settings for running the uninstalled version of quilt in the source tree:
|
|
@ -1,37 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Fri, 14 Feb 2014 15:52:57 +0100
|
|
||||||
Subject: files: Return nothing if there are no files
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 4d8358ae52ce574920c7f3aba7453f305fabf1ba
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
"quilt files" returns a blank line if no files are included in the
|
|
||||||
patch. This could easily break constructs such as "quilt files | wc
|
|
||||||
-l". Let "quilt files" return nothing at all if there are no files in
|
|
||||||
the patch.
|
|
||||||
|
|
||||||
diff --git a/quilt/files.in b/quilt/files.in
|
|
||||||
index 6e107ee..355fa21 100644
|
|
||||||
--- a/quilt/files.in
|
|
||||||
+++ b/quilt/files.in
|
|
||||||
@@ -128,7 +128,7 @@ list_files_in_patch()
|
|
||||||
fi
|
|
||||||
# Note: If opt_labels is set, then use_status is not set.
|
|
||||||
IFS=
|
|
||||||
- echo $(files_in_patch "$patch") |
|
|
||||||
+ files_in_patch "$patch" |
|
|
||||||
sort |
|
|
||||||
while read file
|
|
||||||
do
|
|
||||||
diff --git a/test/example1.test b/test/example1.test
|
|
||||||
index ec73b81..7eaa228 100644
|
|
||||||
--- a/test/example1.test
|
|
||||||
+++ b/test/example1.test
|
|
||||||
@@ -12,6 +12,7 @@ http://the-tech.mit.edu/Shakespeare/midsummer/full.html
|
|
||||||
$ quilt new flower.diff
|
|
||||||
> Patch %{P}flower.diff is now on top
|
|
||||||
|
|
||||||
+ $ quilt files
|
|
||||||
$ quilt add Oberon.txt
|
|
||||||
> File Oberon.txt added to patch %{P}flower.diff
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Mon, 10 Feb 2014 13:11:34 +0100
|
|
||||||
Subject: patchfns: Fix "quilt diff -z" on files with spaces in their names
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 6051b9347f59f761ef744cb7cc813d5eadd86b55
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
Before this fix, "quilt diff -z" would fail on files with spaces in
|
|
||||||
their names, with the following error message:
|
|
||||||
Failed to copy files to temporary directory
|
|
||||||
|
|
||||||
---
|
|
||||||
quilt/scripts/patchfns.in | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/quilt/scripts/patchfns.in
|
|
||||||
+++ b/quilt/scripts/patchfns.in
|
|
||||||
@@ -887,7 +887,7 @@ apply_patch_temporarily()
|
|
||||||
local prefix=$QUILT_PC/$patch/
|
|
||||||
[ ${prefix:0:1} == / ] || prefix=$PWD/$prefix
|
|
||||||
if ! ( cd $workdir && \
|
|
||||||
- $QUILT_DIR/scripts/backup-files -B $prefix -r -k -s ${@:--} )
|
|
||||||
+ $QUILT_DIR/scripts/backup-files -B $prefix -r -k -s "${@:--}" )
|
|
||||||
then
|
|
||||||
printf $"Failed to copy files to temporary directory\n" >&2
|
|
||||||
return 1
|
|
@ -1,80 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Wed, 9 Apr 2014 10:17:09 +0200
|
|
||||||
Subject: patches: Fix heuristic for unapplied patches with timestamps
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 6c8254913549bea07fe62124324a68af773188f8
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
The heuristic to find file names in unapplied patches fails miserably
|
|
||||||
on all patches with timestamps. We have to consider everything past
|
|
||||||
the last tab as the timestamp and strip it. The timestamp itself will
|
|
||||||
contain spaces so we can't split on that.
|
|
||||||
|
|
||||||
This fixes a regression introduced by commit 4df47975. It's hard to
|
|
||||||
believe this has been broken for over 4 years and nobody ever noticed.
|
|
||||||
|
|
||||||
---
|
|
||||||
quilt/patches.in | 2 +-
|
|
||||||
test/timestamps.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
2 files changed, 47 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/quilt/patches.in
|
|
||||||
+++ b/quilt/patches.in
|
|
||||||
@@ -74,7 +74,7 @@ touched_by_patch()
|
|
||||||
| awk '
|
|
||||||
/^(\+\+\+|---)[ \t]/ {
|
|
||||||
sub(/^(\+\+\+|---)[ \t]/, "")
|
|
||||||
- sub(/[ \t][^ \t]*$/, "")
|
|
||||||
+ sub(/\t[^\t]*$/, "")
|
|
||||||
sub(/^\/dev\/null/, "")
|
|
||||||
for (i=0; i<'$strip'; i++)
|
|
||||||
sub(/^[^\/]*\//, "")
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/test/timestamps.test
|
|
||||||
@@ -0,0 +1,46 @@
|
|
||||||
+# Test how quilt behaves when patches include timestamps
|
|
||||||
+
|
|
||||||
+$ mkdir patches
|
|
||||||
+
|
|
||||||
+$ cat > patches/series
|
|
||||||
+< unified-create.patch
|
|
||||||
+< unified-update.patch
|
|
||||||
+< unified-delete.patch
|
|
||||||
+
|
|
||||||
+$ cat > patches/unified-create.patch
|
|
||||||
+< diff -ruN a/file b/file
|
|
||||||
+< --- a/file 1970-01-01 01:00:00.000000000 +0100
|
|
||||||
+< +++ b/file 2014-01-15 11:19:43.000000000 +0100
|
|
||||||
+< @@ -0,0 +1 @@
|
|
||||||
+< +new line
|
|
||||||
+
|
|
||||||
+$ cat > patches/unified-update.patch
|
|
||||||
+< diff -ruN a/file b/file
|
|
||||||
+< --- a/file 2014-01-15 11:19:43.000000000 +0100
|
|
||||||
+< +++ b/file 2014-01-15 11:20:17.000000000 +0100
|
|
||||||
+< @@ -1 +1 @@
|
|
||||||
+< -new line
|
|
||||||
+< +updated line
|
|
||||||
+
|
|
||||||
+$ cat > patches/unified-delete.patch
|
|
||||||
+< diff -ruN a/file b/file
|
|
||||||
+< --- a/file 2014-01-15 11:20:17.000000000 +0100
|
|
||||||
+< +++ b/file 1970-01-01 01:00:00.000000000 +0100
|
|
||||||
+< @@ -1 +0,0 @@
|
|
||||||
+< -updated line
|
|
||||||
+
|
|
||||||
+$ quilt patches file
|
|
||||||
+> patches/unified-create.patch
|
|
||||||
+> patches/unified-update.patch
|
|
||||||
+> patches/unified-delete.patch
|
|
||||||
+
|
|
||||||
+$ quilt push -qa
|
|
||||||
+> Applying patch patches/unified-create.patch
|
|
||||||
+> Applying patch patches/unified-update.patch
|
|
||||||
+> Applying patch patches/unified-delete.patch
|
|
||||||
+> Now at patch patches/unified-delete.patch
|
|
||||||
+
|
|
||||||
+$ quilt patches file
|
|
||||||
+> patches/unified-create.patch
|
|
||||||
+> patches/unified-update.patch
|
|
||||||
+> patches/unified-delete.patch
|
|
@ -1,59 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Sat, 15 Feb 2014 18:43:41 +0100
|
|
||||||
Subject: patches: Optimize processing of unapplied patches
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 1b95644e3a00f07a6711c881d2dcdac14206a57e
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
* Don't check for $strip = ab twice, once is enough.
|
|
||||||
* Quote the file names to be suitable in regular expressions only
|
|
||||||
once, instead of doing it again for every patch. This fixes a
|
|
||||||
performance regression introduced in 8ebb056d ("patches: Add
|
|
||||||
support for multiple files"), sorry about that.
|
|
||||||
|
|
||||||
These two simple changes bring a huge performance boost on unapplied
|
|
||||||
patches, of about 50% in the single file case and growing as you add
|
|
||||||
files.
|
|
||||||
|
|
||||||
diff --git a/quilt/patches.in b/quilt/patches.in
|
|
||||||
index 3f3caed..6ec5e01 100644
|
|
||||||
--- a/quilt/patches.in
|
|
||||||
+++ b/quilt/patches.in
|
|
||||||
@@ -70,7 +70,6 @@ scan_applied()
|
|
||||||
touched_by_patch()
|
|
||||||
{
|
|
||||||
local strip=$1 patch=$2
|
|
||||||
- [ $strip = ab ] && strip=1
|
|
||||||
cat_file $(patch_file_name $patch) \
|
|
||||||
| awk '
|
|
||||||
/^(\+\+\+|---)[ \t]/ {
|
|
||||||
@@ -89,7 +88,14 @@ scan_unapplied()
|
|
||||||
{
|
|
||||||
local color=$1 prefix=$2 strip
|
|
||||||
shift 2
|
|
||||||
- local patch file file_bre match
|
|
||||||
+ local patch file match
|
|
||||||
+ local -a files_bre
|
|
||||||
+
|
|
||||||
+ # Quote each file name only once
|
|
||||||
+ for file in "${opt_files[@]}"
|
|
||||||
+ do
|
|
||||||
+ files_bre[${#files_bre[@]}]=$(quote_bre "$file")
|
|
||||||
+ done
|
|
||||||
|
|
||||||
for patch in "$@"
|
|
||||||
do
|
|
||||||
@@ -97,11 +103,10 @@ scan_unapplied()
|
|
||||||
[ "$strip" = ab ] && strip=1
|
|
||||||
|
|
||||||
match=
|
|
||||||
- for file in "${opt_files[@]}"
|
|
||||||
+ for file in "${files_bre[@]}"
|
|
||||||
do
|
|
||||||
- file_bre="$(quote_bre "$file")"
|
|
||||||
if touched_by_patch $strip $patch \
|
|
||||||
- | grep -q "^$file_bre\$"
|
|
||||||
+ | grep -q "^$file\$"
|
|
||||||
then
|
|
||||||
match=1
|
|
||||||
break
|
|
@ -1,85 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Sat, 15 Feb 2014 18:43:48 +0100
|
|
||||||
Subject: patches: Optimize the multiple files case
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: aadae7a30499c318ae18cb6b216f1d7fe60e49b7
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
I didn't put too many thoughts when adding support for multiple files
|
|
||||||
to the "patches" command. The nested loop approach turns out to be
|
|
||||||
very inefficient for unapplied patches.
|
|
||||||
|
|
||||||
Get rid of the innermost loop by building a single pattern matching
|
|
||||||
all filenames at once. That way, performance no longer depends on the
|
|
||||||
number of files (as far as unapplied patches are concerned.)
|
|
||||||
|
|
||||||
diff --git a/quilt/patches.in b/quilt/patches.in
|
|
||||||
index 6ec5e01..89c5b86 100644
|
|
||||||
--- a/quilt/patches.in
|
|
||||||
+++ b/quilt/patches.in
|
|
||||||
@@ -88,7 +88,7 @@ scan_unapplied()
|
|
||||||
{
|
|
||||||
local color=$1 prefix=$2 strip
|
|
||||||
shift 2
|
|
||||||
- local patch file match
|
|
||||||
+ local patch file
|
|
||||||
local -a files_bre
|
|
||||||
|
|
||||||
# Quote each file name only once
|
|
||||||
@@ -97,23 +97,19 @@ scan_unapplied()
|
|
||||||
files_bre[${#files_bre[@]}]=$(quote_bre "$file")
|
|
||||||
done
|
|
||||||
|
|
||||||
+ # "Or" all files in a single pattern
|
|
||||||
+ file=\\\($(array_join \\\| "${files_bre[@]}")\\\)
|
|
||||||
+
|
|
||||||
for patch in "$@"
|
|
||||||
do
|
|
||||||
strip=$(patch_strip_level $patch)
|
|
||||||
[ "$strip" = ab ] && strip=1
|
|
||||||
|
|
||||||
- match=
|
|
||||||
- for file in "${files_bre[@]}"
|
|
||||||
- do
|
|
||||||
- if touched_by_patch $strip $patch \
|
|
||||||
- | grep -q "^$file\$"
|
|
||||||
- then
|
|
||||||
- match=1
|
|
||||||
- break
|
|
||||||
- fi
|
|
||||||
- done
|
|
||||||
-
|
|
||||||
- [ -z "$match" ] || echo "$color$prefix$(print_patch $patch)$color_clear"
|
|
||||||
+ if touched_by_patch $strip "$patch" \
|
|
||||||
+ | grep -q "^$file\$"
|
|
||||||
+ then
|
|
||||||
+ echo "$color$prefix$(print_patch $patch)$color_clear"
|
|
||||||
+ fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
|
|
||||||
index 42e8de8..e00c819 100644
|
|
||||||
--- a/quilt/scripts/patchfns.in
|
|
||||||
+++ b/quilt/scripts/patchfns.in
|
|
||||||
@@ -76,6 +76,20 @@ trap run_exit_handlers EXIT
|
|
||||||
|
|
||||||
# ========================================================
|
|
||||||
|
|
||||||
+# Join multiple stings using the given separator.
|
|
||||||
+array_join()
|
|
||||||
+{
|
|
||||||
+ local sep=$1 str=$2
|
|
||||||
+ shift 2
|
|
||||||
+
|
|
||||||
+ printf %s "$str"
|
|
||||||
+
|
|
||||||
+ for str in "$@"
|
|
||||||
+ do
|
|
||||||
+ printf %s%s "$sep" "$str"
|
|
||||||
+ done
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
# Quote a string for use in a basic regular expression.
|
|
||||||
quote_bre()
|
|
||||||
{
|
|
@ -1,23 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Thu, 6 Feb 2014 08:50:34 +0100
|
|
||||||
Subject: refresh: Fix error message
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 5df0d39bcd087190fe414bef9a7e4055c941bc76
|
|
||||||
References: bnc#872719
|
|
||||||
|
|
||||||
The message was not updated when support for -pab was added.
|
|
||||||
|
|
||||||
diff --git a/quilt/refresh.in b/quilt/refresh.in
|
|
||||||
index 97b81a6..41d43a7 100644
|
|
||||||
--- a/quilt/refresh.in
|
|
||||||
+++ b/quilt/refresh.in
|
|
||||||
@@ -199,7 +199,8 @@ ab)
|
|
||||||
num_strip_level=1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
- printf $"Cannot refresh patches with -p%s, please specify -p0 or -p1 instead\n" "$opt_strip_level" >&2
|
|
||||||
+ printf $"Cannot refresh patches with -p%s, please specify -p0, -p1, or -pab instead\n" \
|
|
||||||
+ "$opt_strip_level" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -24,7 +24,7 @@ non-interactive alternative diff viewers must exist too.
|
|||||||
|
|
||||||
--color[=always|auto|never]
|
--color[=always|auto|never]
|
||||||
Use syntax coloring (auto activates it only if the output is a tty).
|
Use syntax coloring (auto activates it only if the output is a tty).
|
||||||
@@ -211,6 +213,13 @@ done
|
@@ -219,6 +221,13 @@ done
|
||||||
|
|
||||||
QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS $opt_format"
|
QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS $opt_format"
|
||||||
|
|
||||||
@ -35,6 +35,6 @@ non-interactive alternative diff viewers must exist too.
|
|||||||
+ ;;
|
+ ;;
|
||||||
+esac
|
+esac
|
||||||
+
|
+
|
||||||
opt_files=( $(for file in "$@"; do echo "$SUBDIR$file" ; done) )
|
opt_files=( $(for file in "$@"; do echo "$SUBDIR${file#./}" ; done) )
|
||||||
|
|
||||||
if [ $[0$opt_combine + 0$opt_snapshot + 0$opt_relative] -gt 1 ]
|
if [ $[0$opt_combine + 0$opt_snapshot + 0$opt_relative] -gt 1 ]
|
||||||
|
@ -1,3 +1,36 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jun 9 15:46:01 CEST 2014 - jdelvare@suse.de
|
||||||
|
|
||||||
|
- Fix setup-check-for-rpmbuild.patch: echo was used where printf
|
||||||
|
was intended (bnc#873817); also update upstream reference
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jun 9 14:45:46 CEST 2014 - jdelvare@suse.de
|
||||||
|
|
||||||
|
- update to 0.63
|
||||||
|
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
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 25 18:16:09 CEST 2014 - jdelvare@suse.de
|
Fri Apr 25 18:16:09 CEST 2014 - jdelvare@suse.de
|
||||||
|
|
||||||
@ -19,7 +52,7 @@ Fri Apr 25 18:16:09 CEST 2014 - jdelvare@suse.de
|
|||||||
quilt-patches-optimize-the-multiple-files-case.patch: Fix
|
quilt-patches-optimize-the-multiple-files-case.patch: Fix
|
||||||
performance regression in quilt patches (bnc#872719)
|
performance regression in quilt patches (bnc#872719)
|
||||||
- quilt-refresh-fix-error-message.patch: Fix refresh error message
|
- quilt-refresh-fix-error-message.patch: Fix refresh error message
|
||||||
(bnc#872719)
|
(bnc#872719)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 17 10:49:29 CEST 2014 - jdelvare@suse.de
|
Thu Apr 17 10:49:29 CEST 2014 - jdelvare@suse.de
|
||||||
|
20
quilt.spec
20
quilt.spec
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: quilt
|
Name: quilt
|
||||||
Version: 0.61
|
Version: 0.63
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A Tool for Working with Many Patches
|
Summary: A Tool for Working with Many Patches
|
||||||
License: GPL-2.0+
|
License: GPL-2.0+
|
||||||
@ -44,15 +44,6 @@ Patch2: quilt-support-vimdiff.patch
|
|||||||
Patch3: patch-wrapper-rpm.diff
|
Patch3: patch-wrapper-rpm.diff
|
||||||
Patch4: setup-check-for-rpmbuild.patch
|
Patch4: setup-check-for-rpmbuild.patch
|
||||||
Patch5: suse-workaround-pseudo-release.patch
|
Patch5: suse-workaround-pseudo-release.patch
|
||||||
Patch6: quilt-bash_completion-fix-completion-of-patch-names.patch
|
|
||||||
Patch7: quilt-refresh-fix-error-message.patch
|
|
||||||
Patch8: quilt-fix-quilt-diff-z-on-files-with-spaces-in-name.patch
|
|
||||||
Patch9: quilt-files-return-nothing-if-there-are-no-files.patch
|
|
||||||
Patch10: quilt-patches-optimize-processing-of-unapplied-patches.patch
|
|
||||||
Patch11: quilt-patches-optimize-the-multiple-files-case.patch
|
|
||||||
Patch12: quilt-boost-the-speed-of-series-applied-and-unapplied.patch
|
|
||||||
Patch13: quilt-patches-fix-heuristic-for-unapplied-patches-with-timestamps.patch
|
|
||||||
Patch14: quilt-enable-patch-wrapper-test.patch
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Recommends: procmail
|
Recommends: procmail
|
||||||
@ -77,15 +68,6 @@ http://www.zip.com.au/~akpm/linux/patches/.
|
|||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
|
||||||
%patch7 -p1
|
|
||||||
%patch8 -p1
|
|
||||||
%patch9 -p1
|
|
||||||
%patch10 -p1
|
|
||||||
%patch11 -p1
|
|
||||||
%patch12 -p1
|
|
||||||
%patch13 -p1
|
|
||||||
%patch14 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# --with-rpmbuild=/usr/lib/rpm/rpmb:
|
# --with-rpmbuild=/usr/lib/rpm/rpmb:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
From: Jean Delvare <jdelvare@suse.de>
|
||||||
Subject: setup: Check for rpmbuild availability
|
Subject: setup: Check for rpmbuild availability
|
||||||
References: bnc#873817
|
References: bnc#873817
|
||||||
Upstream: Not yet submitted
|
Upstream: Committed (bf8bc1cfc097ab7692d2ce41a9933ea3b0d9e5e7)
|
||||||
|
|
||||||
Before running inspect on a spec file, verify that rpmbuild is
|
Before running inspect on a spec file, verify that rpmbuild is
|
||||||
available. Print a user-friendly error message if not.
|
available. Print a user-friendly error message if not.
|
||||||
@ -18,8 +18,8 @@ available. Print a user-friendly error message if not.
|
|||||||
+ # check if rpmbuild is installed before running inspect
|
+ # check if rpmbuild is installed before running inspect
|
||||||
+ if ! type rpmbuild &> /dev/null
|
+ if ! type rpmbuild &> /dev/null
|
||||||
+ then
|
+ then
|
||||||
+ echo $"You have to install '%s' (from package %s) to use 'quilt %s'\n" \
|
+ printf $"You have to install '%s' (from package %s) to use 'quilt %s'\n" \
|
||||||
+ rpmbuild rpm-build setup >&2
|
+ rpmbuild rpm-build setup >&2
|
||||||
+ exit 1
|
+ exit 1
|
||||||
+ fi
|
+ fi
|
||||||
+
|
+
|
||||||
|
Loading…
Reference in New Issue
Block a user