summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-01-02 00:25:39 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-01-02 01:45:19 +0000
commit6590ff3f0a2116060c4318b94b31560e482e9294 (patch)
treefc0853d05c1181fbe6d644b3a0f2f7daa1e4f025
parent763db77eb8d7a2e56ee1306f03fddc20a24f83b7 (diff)
tests/update-db-compat: Some refactoring
We want the tree adjustment to be first-class program so we can run it. Setting its name as a variable makes this easier, too. Also, now we keep $toplevel, we can use it in a couple of plaxes. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xtests/update-dh-compat12
-rwxr-xr-xtests/update-dh-compat-adjust26
2 files changed, 35 insertions, 3 deletions
diff --git a/tests/update-dh-compat b/tests/update-dh-compat
index 8abe49c..0c6516f 100755
--- a/tests/update-dh-compat
+++ b/tests/update-dh-compat
@@ -23,15 +23,19 @@ set -e
# This ad-hoc script was wrtten to deal with #1002927.
+toplevel=$PWD
+
cd_fresh_d () {
+ cd "$toplevel"
rm -rf d
mkdir d
cd d
}
-adjust () {
- perl -i -pe 's/^5$/12/' debian/compat
-}
+adjust="$toplevel"/tests/update-dh-compat-adjust
+adjust () { "$adjust"; }
+
+cd "$toplevel"
for f in tests/pkg-srcs/*.dsc; do
cd_fresh_d
@@ -47,4 +51,6 @@ for f in tests/pkg-srcs/*.dsc; do
cd ..
done
+cd "$toplevel"
+
rm -rf d
diff --git a/tests/update-dh-compat-adjust b/tests/update-dh-compat-adjust
new file mode 100755
index 0000000..54305a1
--- /dev/null
+++ b/tests/update-dh-compat-adjust
@@ -0,0 +1,26 @@
+#!/bin/sh
+# dgit
+# Integration between git and Debian-style archives
+#
+# Copyright (C)2013-2021 Ian Jackson
+# Copyright (C)2017-2019 Sean Whitton
+# Copyright (C)2019 Matthew Vernon / Genome Research Limited
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# See update-dh-compat
+# This ad-hoc script was wrtten to deal with #1002927.
+
+set -e
+perl -i -pe 's/^5$/12/' debian/compat