format patches

This commit is contained in:
luoyaoming 2024-05-07 14:39:52 +08:00
parent 31db9a4238
commit b36f084b6c
16 changed files with 341 additions and 258 deletions

View File

@ -1,16 +1,21 @@
Description: verbose error message when the series file does not exist
patchfns.in(cat_series): Displays an error message when the $SERIES
file does not exist, and when run in verbose mode.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: verbose error message when the series file does not exist
Bug-Debian: https://bugs.debian.org/369908
Upstream-status: submitted https://lists.nongnu.org/archive/html/quilt-dev/2020-03/msg00000.html
patchfns.in(cat_series): Displays an error message when the $SERIES
file does not exist, and when run in verbose mode.
---
quilt/scripts/patchfns.in | 3 +++
quilt/scripts/patchfns.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 56aa18a..8816a52 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -352,6 +352,9 @@
@@ -352,6 +352,9 @@ cat_series()
sed -e '/^#/d' -e 's/^[ '$'\t'']*//' \
-e 's/[ '$'\t''].*//' -e '/^$/d' "$SERIES"
else

View File

@ -1,7 +1,9 @@
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Avoid warnings with grep 3.8
Origin: v0.67-29-gf73f8d7 <https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=f73f8d7f71de2878d3f92881a5fcb8eafd78cb5f>
Upstream-Author: Jean Delvare <jdelvare@suse.de>
Date: Fri Sep 9 10:10:37 2022 +0200
Bug-Debian: https://bugs.debian.org/1020108
GNU grep version 3.8 became more strict about needless quoting in
@ -17,10 +19,18 @@ Bug-Debian: https://bugs.debian.org/1020108
quote_grep_re() which does not quote "/".
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
quilt/diff.in | 2 +-
quilt/patches.in | 2 +-
quilt/scripts/patchfns.in | 20 +++++++++++++-------
quilt/upgrade.in | 4 ++--
4 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/quilt/diff.in b/quilt/diff.in
index e90dc33..07788ff 100644
--- a/quilt/diff.in
+++ b/quilt/diff.in
@@ -255,7 +255,7 @@
@@ -255,7 +255,7 @@ then
# Add all files in the snapshot into the file list (they may all
# have changed).
files=( $(find $QUILT_PC/$snap_subdir -type f \
@ -29,9 +39,11 @@ Bug-Debian: https://bugs.debian.org/1020108
| sort) )
printf "%s\n" "${files[@]}" >&4
unset files
diff --git a/quilt/patches.in b/quilt/patches.in
index bb17a46..eac45a9 100644
--- a/quilt/patches.in
+++ b/quilt/patches.in
@@ -60,7 +60,7 @@
@@ -60,7 +60,7 @@ scan_unapplied()
# Quote each file name only once
for file in "${opt_files[@]}"
do
@ -40,9 +52,11 @@ Bug-Debian: https://bugs.debian.org/1020108
done
# "Or" all files in a single pattern
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 75cee52..56aa18a 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -78,8 +78,14 @@
@@ -78,8 +78,14 @@ array_join()
done
}
@ -59,7 +73,7 @@ Bug-Debian: https://bugs.debian.org/1020108
{
echo "$1" | sed -e 's:\([][^$/.*\\]\):\\\1:g'
}
@@ -215,7 +221,7 @@
@@ -215,7 +221,7 @@ patch_in_series()
if [ -e "$SERIES" ]
then
@ -68,7 +82,7 @@ Bug-Debian: https://bugs.debian.org/1020108
else
return 1
fi
@@ -365,7 +371,7 @@
@@ -365,7 +371,7 @@ is_applied()
{
local patch=$1
[ -e $DB ] || return 1
@ -77,7 +91,7 @@ Bug-Debian: https://bugs.debian.org/1020108
}
applied_patches()
@@ -465,7 +471,7 @@
@@ -465,7 +471,7 @@ remove_from_db()
local tmpfile
if tmpfile=$(gen_tempfile)
then
@ -86,7 +100,7 @@ Bug-Debian: https://bugs.debian.org/1020108
cat $tmpfile > $DB
rm -f $tmpfile
[ -s $DB ] || rm -f $DB
@@ -520,7 +526,7 @@
@@ -520,7 +526,7 @@ find_patch()
fi
local patch=${1#$SUBDIR_DOWN$QUILT_PATCHES/}
@ -95,7 +109,7 @@ Bug-Debian: https://bugs.debian.org/1020108
set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\|\.lz\)\([ "$'\t'"]\|$\)/!d" \
-e 's/[ '$'\t''].*//' "$SERIES")
if [ $# -eq 1 ]
@@ -631,7 +637,7 @@
@@ -631,7 +637,7 @@ files_in_patch()
then
find "$path" -type f \
-a ! -path "$(quote_glob "$path")/.timestamp" |
@ -104,9 +118,11 @@ Bug-Debian: https://bugs.debian.org/1020108
fi
}
diff --git a/quilt/upgrade.in b/quilt/upgrade.in
index dbf7d05..866aa33 100644
--- a/quilt/upgrade.in
+++ b/quilt/upgrade.in
@@ -74,7 +74,7 @@
@@ -74,7 +74,7 @@ printf $"Converting meta-data to version %s\n" "$DB_VERSION"
for patch in $(applied_patches)
do
@ -115,7 +131,7 @@ Bug-Debian: https://bugs.debian.org/1020108
proper_name=${proper_name#$QUILT_PATCHES/}
proper_name=${proper_name%% *}
if [ -z "$proper_name" ]
@@ -84,7 +84,7 @@
@@ -84,7 +84,7 @@ do
fi
if [ "$patch" != "$proper_name" -a -d $QUILT_PC/$patch ] \

View File

@ -1,28 +1,27 @@
Description: Adds the --dep3 option to include a DEP-3 template in the header.
.
Intensively using quilt for Debian packages and trying to adopt the
DEP-3 Patch Tagging Guidelines for my patches, I often get to go on
http://dep.debian.net/ to find the correct fields.
.
The proposed patch adds a --dep3 option to "quilt -e header" that
adds a template fed to $EDITOR if the header is empty. The
template contains all fields and documents them, with indications of
required/optional.
From: Didier Raboud <didier@raboud.com>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Adds the --dep3 option to include a DEP-3 template in the header.
Origin: vendor
Author: Didier Raboud <didier@raboud.com>
Reviewed-by: Martin Quinson <mquinson@debian.org>
Last-Update: 2012-02-02
Bug-Debian: https://bugs.debian.org/543355
---
NOTE: Even if DEP-3 has started within Debian, it has been written as a
vendor neutral specification and this patch should be forwarded upstream
too. --Raphael Hertzog
Intensively using quilt for Debian packages and trying to adopt the
DEP-3 Patch Tagging Guidelines for my patches, I often get to go on
http://dep.debian.net/ to find the correct fields.
The proposed patch adds a --dep3 option to "quilt -e header" that
adds a template fed to $EDITOR if the header is empty. The
template contains all fields and documents them, with indications of
required/optional.
---
quilt/header.in | 30 ++++++++++++++++++++++++++++--
quilt/header.in | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/quilt/header.in b/quilt/header.in
index c5f141e..303a68e 100644
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -10,7 +10,7 @@
@ -34,7 +33,7 @@ too. --Raphael Hertzog
if [ x$1 = x-h ]
then
@@ -30,6 +30,10 @@
@@ -30,6 +30,10 @@ Print or change the header of the topmost or specified patch.
--backup
Create a backup copy of the old version of a patch as patch~.
@ -45,7 +44,7 @@ too. --Raphael Hertzog
" "$EDITOR"
exit 0
else
@@ -57,7 +61,7 @@
@@ -57,7 +61,7 @@ maybe_strip_diffstat()
fi
}
@ -54,7 +53,7 @@ too. --Raphael Hertzog
if [ $? -ne 0 ]
then
@@ -81,6 +85,9 @@
@@ -81,6 +85,9 @@ do
--backup)
QUILT_BACKUP=1
shift ;;
@ -64,7 +63,7 @@ too. --Raphael Hertzog
--strip-diffstat)
opt_strip_diffstat=1
shift ;;
@@ -146,6 +153,25 @@
@@ -146,6 +153,25 @@ else
fi
) > $tmp

View File

@ -1,16 +1,21 @@
Description: allow mail command to grab the mail title from dep3 formalism
If the patch is formatted according to http://dep.debian.net/deps/dep3/
then the mail subcommand will manage to extract a mail subject and
description out of this formalism.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: allow mail command to grab the mail title from dep3 formalism
Forwarded: Sent 2014-01-18
If the patch is formatted according to http://dep.debian.net/deps/dep3/
then the mail subcommand will manage to extract a mail subject and
description out of this formalism.
---
quilt/mail.in | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
quilt/mail.in | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/quilt/mail.in b/quilt/mail.in
index 592bee8..0af0e40 100644
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -349,6 +349,18 @@
@@ -349,6 +349,18 @@ then
' $tmpdir/patch > $tmpdir/body
fi
@ -29,7 +34,7 @@ Forwarded: Sent 2014-01-18
# Does this patch have DESC // subject // EDESC?
if [ -z "$subject" ]
then
@@ -454,15 +466,18 @@
@@ -454,15 +466,18 @@ do
subject=$(extract_header_value Replace-Subject: < "$tmpdir/$patch" | join_lines)
if [ $status -ne 0 -o -z "$subject" ]
then

View File

@ -1,23 +1,28 @@
Description: Verbosly fail when trying to push a non existant patch
Useful if there is a typo in the serie file.
This can be overriden by providing -f.
.
This patch was refused by upstream:
https://lists.nongnu.org/archive/html/quilt-dev/2013-01/msg00014.html
.
We need to think again about it to see how to rework it to make it
more acceptable.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Verbosly fail when trying to push a non existant patch
Bug-Debian: https://bugs.debian.org/358875
Forwarded: sent 2012-12-19
Useful if there is a typo in the serie file.
This can be overriden by providing -f.
This patch was refused by upstream:
https://lists.nongnu.org/archive/html/quilt-dev/2013-01/msg00014.html
We need to think again about it to see how to rework it to make it
more acceptable.
---
quilt/push.in | 7 +++++++
test/missing.test | 4 ++++
quilt/push.in | 7 +++++++
test/missing.test | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/quilt/push.in b/quilt/push.in
index 2a30a9a..d3f128e 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -179,6 +179,13 @@
@@ -179,6 +179,13 @@ add_patch()
no_reject_files="-r $tmp"
fi
@ -31,6 +36,8 @@ Forwarded: sent 2012-12-19
apply_patch "$patch" "$patch_file"
status=$?
trap "" SIGINT
diff --git a/test/missing.test b/test/missing.test
index f7160f8..90c1ac0 100644
--- a/test/missing.test
+++ b/test/missing.test
@@ -5,6 +5,10 @@

View File

@ -1,12 +1,20 @@
Description: Fix intermittently failing test
Due to an exchanged output order of stdout and stderr,
the test sometimes fails.
Author: Simon McVittie <smcv@debian.org>
From: Simon McVittie <smcv@debian.org>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Fix intermittently failing test
Bug-Debian: https://bugs.debian.org/913246
Due to an exchanged output order of stdout and stderr,
the test sometimes fails.
---
test/faildiff.test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/faildiff.test b/test/faildiff.test
index 5afb8e3..1cd22ab 100644
--- a/test/faildiff.test
+++ b/test/faildiff.test
@@ -27,7 +27,7 @@
@@ -27,7 +27,7 @@ What happens on binary files?
> File test.bin added to patch %{P}test.diff
$ printf "\\003\\000\\001" > test.bin

View File

@ -1,20 +1,24 @@
Description: Fix failing tests with Debian version of quilt
Due to the patch "fail_on_missing", Debian's quilt will not
return the expected output if a patch is empty. Therefore,
we need to pass "-f" to make it apply the patch anyway.
Author: Dr. Tobias Quathamer <toddy@debian.org>
From: "Dr. Tobias Quathamer" <toddy@debian.org>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Fix failing tests with Debian version of quilt
Forwarded: not-needed
Due to the patch "fail_on_missing", Debian's quilt will not
return the expected output if a patch is empty. Therefore,
we need to pass "-f" to make it apply the patch anyway.
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
test/altered-series.test | 2 +-
test/missing.test | 8 ++++----
test/three.test | 2 +-
test/altered-series.test | 2 +-
test/missing.test | 8 ++++----
test/three.test | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/altered-series.test b/test/altered-series.test
index 68e55cf..97e5436 100644
--- a/test/altered-series.test
+++ b/test/altered-series.test
@@ -6,7 +6,7 @@
@@ -6,7 +6,7 @@ $ cat > patches/series
< 02.patch
< 03.patch
@ -23,17 +27,8 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> Applying patch %{P}01.patch
> Patch %{P}01.patch does not exist; applied empty patch
> Applying patch %{P}02.patch
--- a/test/three.test
+++ b/test/three.test
@@ -169,7 +169,7 @@
> Removing patch %{P}patch1.diff
> No patches applied
- $ quilt push -q 10
+ $ quilt push -fq 10
> Applying patch %{P}patch1.diff
> Applying patch %{P}patch2.diff
> Applying patch %{P}patch3.diff
diff --git a/test/missing.test b/test/missing.test
index 90c1ac0..958e27b 100644
--- a/test/missing.test
+++ b/test/missing.test
@@ -5,10 +5,10 @@
@ -51,3 +46,16 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> Applying patch %{P}missing1.diff
> Patch %{P}missing1.diff does not exist; applied empty patch
> Applying patch %{P}missing2.diff
diff --git a/test/three.test b/test/three.test
index bb4e6b9..a291eb1 100644
--- a/test/three.test
+++ b/test/three.test
@@ -169,7 +169,7 @@
> Removing patch %{P}patch1.diff
> No patches applied
- $ quilt push -q 10
+ $ quilt push -fq 10
> Applying patch %{P}patch1.diff
> Applying patch %{P}patch2.diff
> Applying patch %{P}patch3.diff

View File

@ -1,18 +1,17 @@
Description: Manpage typo
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -18,7 +18,7 @@
Print or change the header of the topmost or specified patch.
-a, -r, -e
- Append to (-a) or replace (-r) the exiting patch header, or
+ Append to (-a) or replace (-r) the existing patch header, or
edit (-e) the header in \$EDITOR (%s). If none of these options is
given, print the patch header.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Manpage typo
---
doc/quilt.1.in | 2 +-
quilt/header.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/quilt.1.in b/doc/quilt.1.in
index 3c23043..9ea8491 100644
--- a/doc/quilt.1.in
+++ b/doc/quilt.1.in
@@ -214,7 +214,7 @@
@@ -214,7 +214,7 @@ diff style (older patch versions used "--unified-reject-files" for that).
You may also want to add the "-E" option if you have issues with quilt
not deleting empty files when you think it should. The documentation of
GNU patch says that "normally this option is unnecessary", but when patch
@ -21,3 +20,16 @@ Description: Manpage typo
empty files from deleted files, patch deletes empty files only if the
-E option is given. Beware that when passing -E to patch, quilt will
no longer be able to deal with empty files, which is why using -E is
diff --git a/quilt/header.in b/quilt/header.in
index 303a68e..4203177 100644
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -18,7 +18,7 @@ usage()
Print or change the header of the topmost or specified patch.
-a, -r, -e
- Append to (-a) or replace (-r) the exiting patch header, or
+ Append to (-a) or replace (-r) the existing patch header, or
edit (-e) the header in \$EDITOR (%s). If none of these options is
given, print the patch header.

View File

@ -1,7 +1,9 @@
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: patchfns: Compatibility fix for BSD awk
Origin: https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=ce9c68abb7cee0b4fb0d5a7ff7048d0ab3b726f8
Upstream-Author: Jean Delvare <jdelvare@suse.de>
Date: Thu, 23 Jun 2022 14:36:58 +0200
Bug-Debian: https://bugs.debian.org/1053463
Forwarded: not-needed
@ -16,10 +18,15 @@ Forwarded: not-needed
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 1d94980dbdd4 ("Tighten the patch format parsing")
---
quilt/scripts/patchfns.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 0e9f1c3..986b4e0 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -857,7 +857,7 @@
@@ -857,7 +857,7 @@ patch_header()
MAYBE_CONTEXT=0
}
MAYBE_UNIFIED {
@ -28,7 +35,7 @@ Forwarded: not-needed
exit
print eaten
MAYBE_UNIFIED=0
@@ -890,7 +890,7 @@
@@ -890,7 +890,7 @@ patch_body()
MAYBE_CONTEXT=0
}
MAYBE_UNIFIED {

View File

@ -1,21 +1,27 @@
Description: ensure that all mtime of modified files are equal when pushing
This is intended to avoid time skew in build systems in some cases.
.
See the discussion
https://lists.debian.org/debian-policy/2008/02/msg00030.html for more
context information.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: ensure that all mtime of modified files are equal when pushing
Bug-Debian: https://bugs.debian.org/466360
Upstream-status: to be submitted
---
quilt/push.in | 22 ++++++++--
quilt/scripts/backup-files.in | 3 -
test/push_timeskew.test | 86 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 6 deletions(-)
This is intended to avoid time skew in build systems in some cases.
See the discussion
https://lists.debian.org/debian-policy/2008/02/msg00030.html for more
context information.
---
quilt/push.in | 22 ++++++++---
quilt/scripts/backup-files.in | 3 +-
test/push_timeskew.test | 86 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 6 deletions(-)
create mode 100644 test/push_timeskew.test
diff --git a/quilt/push.in b/quilt/push.in
index d3f128e..6ee7a7f 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -17,7 +17,8 @@
@@ -17,7 +17,8 @@ in the series file is applied. When a number is specified, apply the
specified number of patches. When a patch name is specified, apply
all patches up to and including the specified patch. Patch names may
include the patches/ prefix, which means that filename completion can
@ -25,7 +31,7 @@ Upstream-status: to be submitted
-a Apply all patches in the series file.
@@ -202,18 +203,29 @@
@@ -202,18 +203,29 @@ add_patch()
touch "$QUILT_PC/$patch~refresh"
fi
@ -59,9 +65,11 @@ Upstream-status: to be submitted
then
printf $"Patch %s appears to be empty; applied\n" \
"$(print_patch "$patch")"
diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in
index edf2b1f..ac7530e 100644
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -190,8 +190,9 @@
@@ -190,8 +190,9 @@ restore_all()
done < "$NONEMPTY_FILES"
fi
@ -72,6 +80,9 @@ Upstream-status: to be submitted
fi
fi
diff --git a/test/push_timeskew.test b/test/push_timeskew.test
new file mode 100644
index 0000000..66420d0
--- /dev/null
+++ b/test/push_timeskew.test
@@ -0,0 +1,86 @@

View File

@ -1,12 +1,33 @@
Description: adds a simple "quilt init" that creates the needed meta-data
From: Martin Quinson <mquinson@debian.org>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: adds a simple "quilt init" that creates the needed meta-data
Origin: Vendor
Author: Martin Quinson <mquinson@debian.org>
---
bash_completion | 2 +-
quilt/init.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
test/one.test | 3 +++
bash_completion | 2 +-
quilt/init.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
test/one.test | 3 +++
3 files changed, 53 insertions(+), 1 deletion(-)
create mode 100644 quilt/init.in
diff --git a/bash_completion b/bash_completion
index ec248c1..48f0e34 100644
--- a/bash_completion
+++ b/bash_completion
@@ -29,7 +29,7 @@ _quilt_completion()
# quilt sub commands
cmds='add annotate applied delete diff edit files fold fork graph \
- grep header import mail new next patches pop previous push refresh \
+ grep header import init mail new next patches pop previous push refresh \
remove rename revert series setup snapshot top unapplied upgrade'
# if no command were given, complete on commands
diff --git a/quilt/init.in b/quilt/init.in
new file mode 100644
index 0000000..836bdff
--- /dev/null
+++ b/quilt/init.in
@@ -0,0 +1,49 @@
@ -59,9 +80,11 @@ Author: Martin Quinson <mquinson@debian.org>
+### mode: shell-script
+### End:
+# vim:filetype=sh
diff --git a/test/one.test b/test/one.test
index 097fc00..2481f24 100644
--- a/test/one.test
+++ b/test/one.test
@@ -10,6 +10,9 @@
@@ -10,6 +10,9 @@ of the installed quilt with `make check'.
$ quilt new patch1.diff
> Patch %{P}patch1.diff is now on top
@ -71,14 +94,3 @@ Author: Martin Quinson <mquinson@debian.org>
$ quilt add dir/file1
> File dir/file1 added to patch %{P}patch1.diff
--- a/bash_completion
+++ b/bash_completion
@@ -29,7 +29,7 @@
# quilt sub commands
cmds='add annotate applied delete diff edit files fold fork graph \
- grep header import mail new next patches pop previous push refresh \
+ grep header import init mail new next patches pop previous push refresh \
remove rename revert series setup snapshot top unapplied upgrade'
# if no command were given, complete on commands

View File

@ -1,23 +1,81 @@
Description: Enforce valid patch names
Allowing patch names to contain spaces would require major changes
(such as the format of the series file), so we'd better detect that
the user tries to use spaces in the patch name, and refuse it.
.
Also, refuse patches named series, as it would result in awful
corruptions of the internal state.
From: openKylin Developers <packaging@lists.openkylin.top>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Enforce valid patch names
Allowing patch names to contain spaces would require major changes
(such as the format of the series file), so we'd better detect that
the user tries to use spaces in the patch name, and refuse it.
Also, refuse patches named series, as it would result in awful
corruptions of the internal state.
Author: Martin Quinson
---
quilt/fork.in | 2 +
quilt/import.in | 2 +
quilt/new.in | 2 +
quilt/rename.in | 2 +
quilt/scripts/patchfns.in | 17 ++++++++++++
test/restrict-patch-names.test | 56 +++++++++++++++++++++++++++++++++++++++++
quilt/fork.in | 2 ++
quilt/import.in | 2 ++
quilt/new.in | 2 ++
quilt/rename.in | 2 ++
quilt/scripts/patchfns.in | 17 +++++++++++++
test/restrict-patch-names.test | 56 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 81 insertions(+)
create mode 100644 test/restrict-patch-names.test
diff --git a/quilt/fork.in b/quilt/fork.in
index 49d588a..19759d2 100644
--- a/quilt/fork.in
+++ b/quilt/fork.in
@@ -74,6 +74,8 @@ fi
new_patch=${new_patch#$QUILT_PATCHES/}
+check_potential_patchname "$new_patch"
+
if patch_in_series $new_patch || \
[ -d "$QUILT_PC/$new_patch" ] || \
[ -e "$(patch_file_name $new_patch)" ]
diff --git a/quilt/import.in b/quilt/import.in
index 7c84121..f368749 100644
--- a/quilt/import.in
+++ b/quilt/import.in
@@ -187,6 +187,8 @@ do
patch=${orig_patch_file##*/}
fi
+ check_potential_patchname "$patch"
+
patch_file=$(find_patch_file "$orig_patch_file") || exit 1
merged_patch_file="$patch_file"
diff --git a/quilt/new.in b/quilt/new.in
index 4906f66..942e1ca 100644
--- a/quilt/new.in
+++ b/quilt/new.in
@@ -92,6 +92,8 @@ fi
patch=${1#$QUILT_PATCHES/}
+check_potential_patchname "$patch"
+
if patch_in_series $patch
then
printf $"Patch %s exists already\n" "$(print_patch $patch)" >&2
diff --git a/quilt/rename.in b/quilt/rename.in
index a62e45c..cf8b23a 100644
--- a/quilt/rename.in
+++ b/quilt/rename.in
@@ -74,6 +74,8 @@ patch=$(find_patch_in_series "$opt_patch") || exit 1
new_patch=${1#$QUILT_PATCHES/}
+check_potential_patchname "$new_patch"
+
if patch_in_series "$new_patch" || \
[ -d "$QUILT_PC/$new_patch" ] || \
[ -e "$(patch_file_name "$new_patch")" ]
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 8816a52..0e9f1c3 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -1051,6 +1051,23 @@
@@ -1051,6 +1051,23 @@ consistency_check()
fi
}
@ -41,50 +99,9 @@ Author: Martin Quinson
print_patch()
{
echo "${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}$1"
--- a/quilt/new.in
+++ b/quilt/new.in
@@ -92,6 +92,8 @@
patch=${1#$QUILT_PATCHES/}
+check_potential_patchname "$patch"
+
if patch_in_series $patch
then
printf $"Patch %s exists already\n" "$(print_patch $patch)" >&2
--- a/quilt/import.in
+++ b/quilt/import.in
@@ -187,6 +187,8 @@
patch=${orig_patch_file##*/}
fi
+ check_potential_patchname "$patch"
+
patch_file=$(find_patch_file "$orig_patch_file") || exit 1
merged_patch_file="$patch_file"
--- a/quilt/fork.in
+++ b/quilt/fork.in
@@ -74,6 +74,8 @@
new_patch=${new_patch#$QUILT_PATCHES/}
+check_potential_patchname "$new_patch"
+
if patch_in_series $new_patch || \
[ -d "$QUILT_PC/$new_patch" ] || \
[ -e "$(patch_file_name $new_patch)" ]
--- a/quilt/rename.in
+++ b/quilt/rename.in
@@ -74,6 +74,8 @@
new_patch=${1#$QUILT_PATCHES/}
+check_potential_patchname "$new_patch"
+
if patch_in_series "$new_patch" || \
[ -d "$QUILT_PC/$new_patch" ] || \
[ -e "$(patch_file_name "$new_patch")" ]
diff --git a/test/restrict-patch-names.test b/test/restrict-patch-names.test
new file mode 100644
index 0000000..3537a67
--- /dev/null
+++ b/test/restrict-patch-names.test
@@ -0,0 +1,56 @@

View File

@ -1,13 +1,9 @@
cherry-pick.v0.67-29-gf73f8d7.avoid-warnings-with-grep-3-8.patch
quilt-init
dep3mail ### Sent 2014-01-18
check_SERIES_exists ### Sent 2014-01-18
dep3mail
check_SERIES_exists
restrict-patch-names
fail_on_missing
# Works only with patch 2.6 and newer currently and we don't want to break
# backports (see #560621 for discussion)
# test_broken_patches
shell-subcommand
use-sensible-editor
dep3_headers

View File

@ -1,16 +1,35 @@
Description: Implement a new "quilt shell" command
The command launches a shell in a duplicate environment. After exiting
the shell, any modifications made in this environment are applied to the
topmost patch.
Author: Josselin Mouette <joss@debian.org>
From: Josselin Mouette <joss@debian.org>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: Implement a new "quilt shell" command
Bug-Debian: https://bugs.debian.org/526141
Forwarded: submitted 2012-12-19
The command launches a shell in a duplicate environment. After exiting
the shell, any modifications made in this environment are applied to the
topmost patch.
---
bash_completion | 2 -
quilt/shell.in | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bash_completion | 2 +-
quilt/shell.in | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 quilt/shell.in
diff --git a/bash_completion b/bash_completion
index 48f0e34..ab4c174 100644
--- a/bash_completion
+++ b/bash_completion
@@ -30,7 +30,7 @@ _quilt_completion()
# quilt sub commands
cmds='add annotate applied delete diff edit files fold fork graph \
grep header import init mail new next patches pop previous push refresh \
- remove rename revert series setup snapshot top unapplied upgrade'
+ remove rename revert series setup shell snapshot top unapplied upgrade'
# if no command were given, complete on commands
if [[ $COMP_CWORD -eq 1 ]] ; then
diff --git a/quilt/shell.in b/quilt/shell.in
new file mode 100644
index 0000000..902e2dc
--- /dev/null
+++ b/quilt/shell.in
@@ -0,0 +1,67 @@
@ -81,14 +100,3 @@ Forwarded: submitted 2012-12-19
+done
+
+rm -rf $tmpdir
--- a/bash_completion
+++ b/bash_completion
@@ -30,7 +30,7 @@
# quilt sub commands
cmds='add annotate applied delete diff edit files fold fork graph \
grep header import init mail new next patches pop previous push refresh \
- remove rename revert series setup snapshot top unapplied upgrade'
+ remove rename revert series setup shell snapshot top unapplied upgrade'
# if no command were given, complete on commands
if [[ $COMP_CWORD -eq 1 ]] ; then

View File

@ -1,39 +0,0 @@
---
test/file-not-found.test | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
Index: b/test/file-not-found.test
===================================================================
--- /dev/null
+++ b/test/file-not-found.test
@@ -0,0 +1,30 @@
+# Try to push a patch touching a file which does not exist in this tree
+
+$ rm -rf d
+$ mkdir -p d/patches
+$ cd d
+
+$ mkdir subdir
+$ echo foo > subdir/file.txt
+$ echo bar > subdir/other.txt
+$ diff -u subdir/file.txt subdir/other.txt > patches/patch
+# simulate --no-timestamp
+$ sed 's|subdir/file.txt.*|subdir/file.txt|' patches/patch > patches/patch2
+$ sed 's|subdir/other.txt.*|subdir/other.txt|' patches/patch2 > patches/patch
+$ rm subdir/other.txt patches/patch2
+$ echo patch > patches/series
+
+$ quilt push
+> Applying patch patches/patch
+> patching file other.txt
+> Hunk #1 FAILED at 1.
+> 1 out of 1 hunk FAILED -- rejects in file other.txt
+> Patch patches/patch does not apply (enforce with -f)
+
+$ quilt push -qf
+> Applying patch patches/patch
+> 1 out of 1 hunk FAILED -- saving rejects to file other.txt.rej
+> Applied patch patches/patch (forced; needs refresh)
+
+$ cd ..
+$ rm -rf d

View File

@ -1,16 +1,21 @@
Description: default the value of EDITOR with Debian's sensible-editor instead of vi
the original bug that triggered this change was that quilt doesn't honour $VISUAL
From: Ryan Niebur <ryanryan52@gmail.com>
Date: Tue, 7 May 2024 14:39:52 +0800
Subject: default the value of EDITOR with Debian's sensible-editor instead of
vi
Bug-Debian: https://bugs.debian.org/509076
Forwarded: not-needed
Author: Ryan Niebur <ryanryan52@gmail.com>
the original bug that triggered this change was that quilt doesn't honour $VISUAL
---
quilt/edit.in | 2 +-
quilt/header.in | 2 +-
quilt/mail.in | 2 +-
test/edit.test | 1 +
quilt/edit.in | 2 +-
quilt/header.in | 2 +-
quilt/mail.in | 2 +-
test/edit.test | 1 +
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/quilt/edit.in b/quilt/edit.in
index d36d327..a50bb96 100644
--- a/quilt/edit.in
+++ b/quilt/edit.in
@@ -6,7 +6,7 @@
@ -22,6 +27,8 @@ Author: Ryan Niebur <ryanryan52@gmail.com>
usage()
{
diff --git a/quilt/header.in b/quilt/header.in
index b4c7867..c5f141e 100644
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -6,7 +6,7 @@
@ -33,6 +40,8 @@ Author: Ryan Niebur <ryanryan52@gmail.com>
usage()
{
diff --git a/quilt/mail.in b/quilt/mail.in
index 0af0e40..3016cff 100644
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -6,7 +6,7 @@
@ -44,9 +53,11 @@ Author: Ryan Niebur <ryanryan52@gmail.com>
usage()
{
diff --git a/test/edit.test b/test/edit.test
index 98fd393..10dbbb4 100644
--- a/test/edit.test
+++ b/test/edit.test
@@ -7,6 +7,7 @@
@@ -7,6 +7,7 @@ $ cat > editor
< sed -e 's:foo:bar:' $1 > $1.new
< mv $1.new $1
$ chmod +x editor