diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:42:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:42:30 +0000 |
commit | 75808db17caf8b960b351e3408e74142f4c85aac (patch) | |
tree | 7989e9c09a4240248bf4658a22208a0a52d991c4 /t/recipes/checks/scripts/scripts-diversions-variables/build-spec | |
parent | Initial commit. (diff) | |
download | lintian-75808db17caf8b960b351e3408e74142f4c85aac.tar.xz lintian-75808db17caf8b960b351e3408e74142f4c85aac.zip |
Adding upstream version 2.117.0.upstream/2.117.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/recipes/checks/scripts/scripts-diversions-variables/build-spec')
6 files changed, 73 insertions, 0 deletions
diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/install b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/install new file mode 100644 index 0000000..c29cc54 --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/install @@ -0,0 +1,4 @@ +orphan usr/share/scripts/t1 +some-file usr/share/scripts/t1 +orphan usr/share/scripts/t2/foo +some-file usr/share/scripts/t2/foo diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/postrm b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/postrm new file mode 100644 index 0000000..73b8ee9 --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/postrm @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +if [ remove = "$1" ]; then + # Clean up the correct diversion from preinst. + dpkg-divert --package scripts-diversions --remove --rename \ + --divert /usr/share/scripts/t2/foo/some-file.real \ + "/usr/share/scripts/t2/foo/some-file" + + d=scripts + # Clean up some other diversion that we didn't create. + dpkg-divert --package scripts-diversions --remove --rename \ + /usr/lib/$d/old-file; echo hi + + # Clean up a diversion we did not create for a non-existent file. + dpkg-divert --remove --package scripts-diversions --rename \ + --divert /usr/share/scripts/$v/no-such-file.real \ + /usr/share/scripts/$v/no-such-file && echo hello + + # Clean up a diversion we did create for a non-existent file. + (dpkg-divert --package foo --remove /etc/scripts/orphan) + # another one: + { dpkg-divert --package foo --remove /usr/share/foo/$(echo bar); } +fi + +#DEBHELPER# diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/preinst b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/preinst new file mode 100644 index 0000000..c311563 --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/debian/preinst @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +if [ install = "$1" ]; then + # This is a correct diversion. + dpkg-divert --package scripts-diversions --add --rename \ + --divert /usr/share/scripts/t2/foo/some-file.real \ + /usr/share/scripts/t2/foo/some-file + + # This is broken -- can't use local. + dpkg-divert --local \ + --add \ + --divert \ + /usr/share/scripts/other-file.real \ + /usr/share/scripts/other-file + + f=orphan + # This is also correct, but we're not going to clean it up. + dpkg-divert --package scripts-diversions --add --rename \ + --divert /usr/share/scripts/t1/$f.real \ + /usr/share/scripts/t1/"$f" + + # Try to divert a file we don't ship + dpkg-divert --package scripts-diversions --add --rename \ + --divert /etc/scripts/$f.real \ + /etc/scripts/$f|| true + # Another one + dpkg-divert --package scripts-diversions --add --rename \ + --divert /usr/share/foo/$f.real \ + /usr/share/foo/${f#f} + + # This is correct too. + dpkg-divert $SOMETHING --package scripts-diversions --add --rename \ + --divert /usr/share/scripts/t2/foo/some-file.real \ + /usr/share/scripts/t2/foo/some-file +fi + +#DEBHELPER# diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/fill-values b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/fill-values new file mode 100644 index 0000000..a2852bf --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/fill-values @@ -0,0 +1,3 @@ +Skeleton: upload-native +Testname: scripts-diversions-variables +Description: Tests of dpkg-divert checks with variables diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/orphan b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/orphan new file mode 100644 index 0000000..934fd74 --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/orphan @@ -0,0 +1 @@ +Some file that we're going to divert and not clean up. diff --git a/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/some-file b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/some-file new file mode 100644 index 0000000..649e369 --- /dev/null +++ b/t/recipes/checks/scripts/scripts-diversions-variables/build-spec/orig/some-file @@ -0,0 +1 @@ +Some random file that we're going to install after diverting. |