forked from pool/quilt
Accepting request 955039 from devel:tools:scm
- Update to version 0.67: * Call pager with original LANG environment variable * Consistently complain early if no series file is found * Tighten the patch format parsing * Reuse the shell (performance) * Document the series file format further * Document that quilt loads /etc/quilt.quiltrc * series: Minor optimizations * setup: Don't obey the settings of any englobing .pc * setup: Default to fast mode * quilt.el: Fix documentation of quilt-pc-directory * quilt.el: Load /etc/quilt.quiltrc if ~/.quiltrc doesn't exist * quilt.el: Fix quilt-editable when QUILT_PATCHES_PREFIX is set OBS-URL: https://build.opensuse.org/request/show/955039 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/quilt?expand=0&rev=73
This commit is contained in:
commit
888e0f6e31
@ -1,164 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Date: Wed, 9 Dec 2020 11:39:56 +0100
|
|
||||||
Subject: backup-files: Restore symbolic links
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 26f7bc93d2bbe49a96d23f879b24e82651392497
|
|
||||||
References: https://savannah.nongnu.org/bugs/index.php?59479
|
|
||||||
|
|
||||||
As "patch" originally did not handle symbolic links, backup-files
|
|
||||||
didn't have to care about them either. But now that git has
|
|
||||||
introduced an extended syntax which allows manipulating symbolic
|
|
||||||
links in patch files, "quilt push" may create or delete symbolic
|
|
||||||
links, which means that backup-files must support such operations
|
|
||||||
too.
|
|
||||||
|
|
||||||
Also extend the backup-files test case to cover these operations.
|
|
||||||
|
|
||||||
This fixes bug #59479:
|
|
||||||
https://savannah.nongnu.org/bugs/index.php?59479
|
|
||||||
|
|
||||||
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
||||||
---
|
|
||||||
quilt/scripts/backup-files.in | 40 ++++++++++++++++++++++++++++++----------
|
|
||||||
test/backup-files.test | 33 +++++++++++++++++++++++++++++++++
|
|
||||||
2 files changed, 63 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
--- a/quilt/scripts/backup-files.in
|
|
||||||
+++ b/quilt/scripts/backup-files.in
|
|
||||||
@@ -89,7 +89,7 @@ backup()
|
|
||||||
dir=$(dirname "$backup")
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
|
||||||
|
|
||||||
- if [ -e "$file" ]; then
|
|
||||||
+ if [ -L "$file" -o -e "$file" ]; then
|
|
||||||
$ECHO "Copying $file"
|
|
||||||
if [ -n "$OPT_NOLINKS" -a "$(stat @STAT_HARDLINK@ "$file")" = 1 ]; then
|
|
||||||
cp -p "$file" "$backup"
|
|
||||||
@@ -110,24 +110,28 @@ restore()
|
|
||||||
local file=$1
|
|
||||||
local backup=$OPT_PREFIX$file
|
|
||||||
|
|
||||||
- if [ ! -e "$backup" ]; then
|
|
||||||
+ if [ ! -L "$backup" -a ! -e "$backup" ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
- if [ -s "$backup" ]; then
|
|
||||||
+ if [ -L "$backup" -o -s "$backup" ]; then
|
|
||||||
$ECHO "Restoring $file"
|
|
||||||
- if [ -e "$file" ]; then
|
|
||||||
+ if [ -L "$file" -o -e "$file" ]; then
|
|
||||||
rm "$file"
|
|
||||||
else
|
|
||||||
mkdir -p "$(dirname "$file")"
|
|
||||||
fi
|
|
||||||
- ln "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
|
|
||||||
+ if [ -L "$backup" ]; then
|
|
||||||
+ ln -s "$(readlink "$backup")" "$file"
|
|
||||||
+ else
|
|
||||||
+ ln "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
- if [ -n "$OPT_TOUCH" ]; then
|
|
||||||
+ if [ -n "$OPT_TOUCH" -a ! -L "$file" ]; then
|
|
||||||
touch "$file"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
$ECHO "Removing $file"
|
|
||||||
- if [ -e "$file" ]; then
|
|
||||||
+ if [ -L "$file" -o -e "$file" ]; then
|
|
||||||
rm "$file"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@@ -145,11 +149,13 @@ restore_all()
|
|
||||||
# Store the list of files to process
|
|
||||||
EMPTY_FILES=$(gen_tempfile)
|
|
||||||
NONEMPTY_FILES=$(gen_tempfile)
|
|
||||||
- trap "rm -f \"$EMPTY_FILES\" \"$NONEMPTY_FILES\"" EXIT
|
|
||||||
+ LINK_FILES=$(gen_tempfile)
|
|
||||||
+ trap "rm -f \"$EMPTY_FILES\" \"$NONEMPTY_FILES\" \"$LINK_FILES\"" EXIT
|
|
||||||
|
|
||||||
cd "$OPT_PREFIX"
|
|
||||||
find . -type f -size 0 -print0 > "$EMPTY_FILES"
|
|
||||||
find . -type f -size +0 -print0 > "$NONEMPTY_FILES"
|
|
||||||
+ find . -type l -print0 > "$LINK_FILES"
|
|
||||||
cd "$OLDPWD"
|
|
||||||
|
|
||||||
if [ -s "$EMPTY_FILES" ]; then
|
|
||||||
@@ -189,6 +195,20 @@ restore_all()
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
+ if [ -s "$LINK_FILES" ]; then
|
|
||||||
+ (cd "$OPT_PREFIX" && find . -type d -print0) \
|
|
||||||
+ | xargs -0 mkdir -p
|
|
||||||
+
|
|
||||||
+ while read -d $'\0' -r
|
|
||||||
+ do
|
|
||||||
+ local file=${REPLY#./}
|
|
||||||
+ local backup=$OPT_PREFIX$file
|
|
||||||
+
|
|
||||||
+ $ECHO "Restoring $file"
|
|
||||||
+ ln -sf "$(readlink "$backup")" "$file"
|
|
||||||
+ done < "$LINK_FILES"
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
if [ -z "$OPT_KEEP_BACKUP" ]; then
|
|
||||||
rm -rf "$OPT_PREFIX"
|
|
||||||
fi
|
|
||||||
@@ -212,7 +232,7 @@ copy()
|
|
||||||
dir=$(dirname "$backup")
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
|
||||||
|
|
||||||
- if [ -e "$file" ]; then
|
|
||||||
+ if [ -L "$file" -o -e "$file" ]; then
|
|
||||||
$ECHO "Copying $file"
|
|
||||||
cp -p "$file" "$backup"
|
|
||||||
else
|
|
||||||
@@ -234,7 +254,7 @@ copy_many()
|
|
||||||
cat "$OPT_FILE" \
|
|
||||||
| while read
|
|
||||||
do
|
|
||||||
- if [ -e "$REPLY" ]; then
|
|
||||||
+ if [ -L "$REPLY" -o -e "$REPLY" ]; then
|
|
||||||
printf '%s\0' "$REPLY" >&3
|
|
||||||
else
|
|
||||||
# This is a rare case, not worth optimizing
|
|
||||||
--- a/test/backup-files.test
|
|
||||||
+++ b/test/backup-files.test
|
|
||||||
@@ -229,3 +229,36 @@ Unit test of the backup-files script.
|
|
||||||
> 1
|
|
||||||
$ [ ! -s new ] || echo "file snapshot/new should be empty"
|
|
||||||
$ rm -rf snapshot
|
|
||||||
+
|
|
||||||
+ # Test backup and restoration of a symbolic link
|
|
||||||
+ $ mkdir dir
|
|
||||||
+ $ ln -s foo dir/link
|
|
||||||
+ $ readlink dir/link
|
|
||||||
+ > foo
|
|
||||||
+ $ %{QUILT_DIR}/scripts/backup-files -B backup/ -b dir/link
|
|
||||||
+ > Copying dir/link
|
|
||||||
+ $ readlink backup/dir/link
|
|
||||||
+ > foo
|
|
||||||
+ $ rm -f dir/link
|
|
||||||
+ $ echo crap > dir/link
|
|
||||||
+ $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r -k dir/link
|
|
||||||
+ > Restoring dir/link
|
|
||||||
+ $ readlink dir/link
|
|
||||||
+ > foo
|
|
||||||
+
|
|
||||||
+ # Same but reading from a file
|
|
||||||
+ $ rm -f dir/link
|
|
||||||
+ $ echo crap > dir/link
|
|
||||||
+ $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r -k -f -
|
|
||||||
+ < dir/link
|
|
||||||
+ > Restoring dir/link
|
|
||||||
+ $ readlink dir/link
|
|
||||||
+ > foo
|
|
||||||
+
|
|
||||||
+ # Same but without specifying the file
|
|
||||||
+ $ rm -f dir/link
|
|
||||||
+ $ echo crap > dir/link
|
|
||||||
+ $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r -
|
|
||||||
+ > Restoring dir/link
|
|
||||||
+ $ readlink dir/link
|
|
||||||
+ > foo
|
|
@ -1,38 +0,0 @@
|
|||||||
From: Jean Delvare <jdelvare@suse.de>
|
|
||||||
Subject: inspect-wrapper: procfs resolves links
|
|
||||||
Patch-mainline: yes
|
|
||||||
Git-commit: 6363f217b08b07cabbbe09d2d2ddc68596502e38
|
|
||||||
References: boo#1179023
|
|
||||||
|
|
||||||
When patch files are passed through stdin, we get the actual patch
|
|
||||||
file name from procfs. It turns out that procfs resolves symbolic
|
|
||||||
links, and that breaks our later attempt to strip the prefix from
|
|
||||||
the path to extract a relative path to the patch file.
|
|
||||||
|
|
||||||
This is solved by also resolving symbolic links in the prefix
|
|
||||||
before stripping it.
|
|
||||||
|
|
||||||
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
||||||
---
|
|
||||||
quilt/scripts/inspect-wrapper.in | 10 +++++++++-
|
|
||||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/quilt/scripts/inspect-wrapper.in
|
|
||||||
+++ b/quilt/scripts/inspect-wrapper.in
|
|
||||||
@@ -268,7 +268,15 @@ esac
|
|
||||||
if [ -n "$QUILT_SETUP_FAST" -a -z "$inputfile" ]
|
|
||||||
then
|
|
||||||
inputfile=$(readlink /proc/self/fd/0)
|
|
||||||
- [ "${inputfile:0:1}" = / -a -f "$inputfile" ] || inputfile=
|
|
||||||
+ if [ "${inputfile:0:1}" = / -a -f "$inputfile" ]
|
|
||||||
+ then
|
|
||||||
+ # procfs resolved the symlinks, so do the same, otherwise the
|
|
||||||
+ # path prefix won't match
|
|
||||||
+ RPM_SOURCE_DIR=$(cd -P "$RPM_SOURCE_DIR" && echo "$PWD")/
|
|
||||||
+ else
|
|
||||||
+ # Didn't work, so fall back to the slow method
|
|
||||||
+ inputfile=
|
|
||||||
+ fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$inputfile" ]
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:a8c423ecb0b2d8c3774f6b6ddb10644f2386d30112948105245e3d6938020d6d
|
|
||||||
size 359074
|
|
3
quilt-0.67.tar.bz2
Normal file
3
quilt-0.67.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8f28432d57e60e8b3c6b53dfb66ba43bed853c1f0a20423ac0d67ae008f826a7
|
||||||
|
size 497707
|
@ -13,7 +13,7 @@ non-interactive alternative diff viewers must exist too.
|
|||||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
--- a/quilt/diff.in
|
--- a/quilt/diff.in
|
||||||
+++ b/quilt/diff.in
|
+++ b/quilt/diff.in
|
||||||
@@ -66,7 +66,9 @@ included.
|
@@ -53,7 +53,9 @@ included.
|
||||||
|
|
||||||
--diff=utility
|
--diff=utility
|
||||||
Use the specified utility for generating the diff. The utility
|
Use the specified utility for generating the diff. The utility
|
||||||
@ -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).
|
||||||
@@ -219,6 +221,13 @@ done
|
@@ -214,6 +216,13 @@ fi
|
||||||
|
|
||||||
QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS $opt_format"
|
QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS $opt_format"
|
||||||
|
|
||||||
|
@ -1,3 +1,24 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 15 14:07:30 UTC 2022 - Jean Delvare <jdelvare@suse.com>
|
||||||
|
|
||||||
|
- Update to version 0.67:
|
||||||
|
* Call pager with original LANG environment variable
|
||||||
|
* Consistently complain early if no series file is found
|
||||||
|
* Tighten the patch format parsing
|
||||||
|
* Reuse the shell (performance)
|
||||||
|
* Document the series file format further
|
||||||
|
* Document that quilt loads /etc/quilt.quiltrc
|
||||||
|
* series: Minor optimizations
|
||||||
|
* setup: Don't obey the settings of any englobing .pc
|
||||||
|
* setup: Default to fast mode
|
||||||
|
* quilt.el: Fix documentation of quilt-pc-directory
|
||||||
|
* quilt.el: Load /etc/quilt.quiltrc if ~/.quiltrc doesn't exist
|
||||||
|
* quilt.el: Fix quilt-editable when QUILT_PATCHES_PREFIX is set
|
||||||
|
* Obsoletes backup-files-restore-symbolic-links.patch
|
||||||
|
* Obsoletes inspect-handle-link-in-path.patch
|
||||||
|
- Refresh quilt-support-vimdiff.patch (offsets only)
|
||||||
|
- Refresh suse-workaround-pseudo-release.patch (offsets only)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Dec 9 14:15:38 UTC 2020 - Jean Delvare <jdelvare@suse.com>
|
Wed Dec 9 14:15:38 UTC 2020 - Jean Delvare <jdelvare@suse.com>
|
||||||
|
|
||||||
|
12
quilt.spec
12
quilt.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package quilt
|
# spec file for package quilt
|
||||||
#
|
#
|
||||||
# Copyright (c) 2020 SUSE LLC
|
# Copyright (c) 2022 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: quilt
|
Name: quilt
|
||||||
Version: 0.66
|
Version: 0.67
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A Tool for Working with Many Patches
|
Summary: A Tool for Working with Many Patches
|
||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
@ -42,15 +42,13 @@ Patch1: expand.diff
|
|||||||
Patch2: quilt-support-vimdiff.patch
|
Patch2: quilt-support-vimdiff.patch
|
||||||
Patch3: test-faildiff-workaround-order-bug.patch
|
Patch3: test-faildiff-workaround-order-bug.patch
|
||||||
Patch4: suse-workaround-pseudo-release.patch
|
Patch4: suse-workaround-pseudo-release.patch
|
||||||
Patch5: inspect-handle-link-in-path.patch
|
|
||||||
Patch6: backup-files-restore-symbolic-links.patch
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
Recommends: procmail
|
Recommends: /usr/bin/rpmbuild
|
||||||
Recommends: bzip2
|
Recommends: bzip2
|
||||||
Recommends: ed
|
Recommends: ed
|
||||||
Recommends: /usr/bin/rpmbuild
|
Recommends: procmail
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?suse_version} > 1120
|
%if 0%{?suse_version} > 1120
|
||||||
Recommends: xz
|
Recommends: xz
|
||||||
@ -67,8 +65,6 @@ un-applied, refreshed, and more.
|
|||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
|
||||||
%patch6 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# --with-rpmbuild=/usr/lib/rpm/rpmb:
|
# --with-rpmbuild=/usr/lib/rpm/rpmb:
|
||||||
|
@ -10,7 +10,7 @@ happy again. Packages in openSUSE 11.4 and later no longer need this.
|
|||||||
|
|
||||||
--- a/quilt/setup.in
|
--- a/quilt/setup.in
|
||||||
+++ b/quilt/setup.in
|
+++ b/quilt/setup.in
|
||||||
@@ -228,6 +228,14 @@ inspect()
|
@@ -213,6 +213,14 @@ inspect()
|
||||||
ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/unzip
|
ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/unzip
|
||||||
ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/7z
|
ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/7z
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user