diff options
Diffstat (limited to '')
-rw-r--r-- | t/recipes/checks/maintainer-scripts/diversion/scripts-diversions-variables/build-spec/debian/preinst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/recipes/checks/maintainer-scripts/diversion/scripts-diversions-variables/build-spec/debian/preinst b/t/recipes/checks/maintainer-scripts/diversion/scripts-diversions-variables/build-spec/debian/preinst new file mode 100644 index 0000000..c311563 --- /dev/null +++ b/t/recipes/checks/maintainer-scripts/diversion/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# |