summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/maintainer-scripts/generated
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:42:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:42:30 +0000
commit75808db17caf8b960b351e3408e74142f4c85aac (patch)
tree7989e9c09a4240248bf4658a22208a0a52d991c4 /t/recipes/checks/maintainer-scripts/generated
parentInitial commit. (diff)
downloadlintian-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/maintainer-scripts/generated')
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/control.in63
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/POTFILES.in1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/de.po13
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/templates.pot23
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-forbidden.templates3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.postinst5
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.preinst5
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.prerm6
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-unknown.postinst6
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/fill-values3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/desc3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/hints1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/post-test1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/maintscript1
-rwxr-xr-xt/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postinst255
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postrm9
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/prerm11
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/rules8
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/fill-values4
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/desc4
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/hints2
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/post-test1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/debian/postinst33
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/fill-values3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/desc2
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/hints4
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/post-test1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/install1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/postinst9
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/fill-values3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/orig/foo.afm0
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/desc2
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/hints1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/post-test1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/install1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/postinst8
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/fill-values3
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/orig/foo.afm0
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/desc2
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/hints1
-rw-r--r--t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/post-test1
41 files changed, 504 insertions, 0 deletions
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/control.in b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/control.in
new file mode 100644
index 0000000..55acbe7
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/control.in
@@ -0,0 +1,63 @@
+Source: [% $source %]
+Priority: optional
+Section: [% $section %]
+Maintainer: [% $author %]
+Standards-Version: [% $standards_version %]
+Build-Depends: [% $build_depends %]
+Rules-Requires-Root: no
+
+Package: [% $source %]-paths
+Architecture: [% $package_architecture %]
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (paths)
+ Interpreters with bad paths.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
+
+Package: [% $source %]-forbidden
+Architecture: [% $package_architecture %]
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (forbidden)
+ Forbidden control interpreters.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
+
+Package: [% $source %]-unknown
+Architecture: [% $package_architecture %]
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (unknown)
+ Unknown control interpreters.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
+
+Package: [% $source %]-python
+Architecture: [% $package_architecture %]
+Depends: python, ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (Python)
+ Python control interpreters with depends.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
+
+Package: [% $source %]-prepython
+Architecture: [% $package_architecture %]
+Pre-Depends: python
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (Python preinst)
+ Python control interpreters with pre-depends.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/POTFILES.in b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/POTFILES.in
new file mode 100644
index 0000000..5da079f
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] scripts-control-interpreters-forbidden.templates
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/de.po b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/de.po
new file mode 100644
index 0000000..4ab3a8f
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/de.po
@@ -0,0 +1,13 @@
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-12-28 14:30-0800\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. description
+#: ../scripts-control-interpreters-forbidden.templates:1001
+msgid "Enter something:"
+msgstr "Not really a translation:"
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/templates.pot b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/templates.pot
new file mode 100644
index 0000000..6b4af20
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/po/templates.pot
@@ -0,0 +1,23 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-12-28 14:30-0800\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. description
+#: ../scripts-control-interpreters-forbidden.templates:1001
+msgid "Enter something:"
+msgstr ""
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-forbidden.templates b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-forbidden.templates
new file mode 100644
index 0000000..05d97b3
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-forbidden.templates
@@ -0,0 +1,3 @@
+Template: scripts-control-interpreters-forbidden/test
+Type: string
+_description: Enter something:
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.postinst
new file mode 100644
index 0000000..39cf003
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.postinst
@@ -0,0 +1,5 @@
+#!/usr/bin/bash
+set -e
+run something
+
+#DEBHELPER#
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.preinst b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.preinst
new file mode 100644
index 0000000..542236f
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.preinst
@@ -0,0 +1,5 @@
+#!/usr/local/bin/bash
+set -e
+run something
+
+#DEBHELPER#
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.prerm b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.prerm
new file mode 100644
index 0000000..b2c6828
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-paths.prerm
@@ -0,0 +1,6 @@
+#!/bin/python
+import sys
+sys.exit(0)
+"""
+#DEBHELPER#
+"""
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-unknown.postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-unknown.postinst
new file mode 100644
index 0000000..a5ded5a
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/debian/scripts-control-interpreters-unknown.postinst
@@ -0,0 +1,6 @@
+#!/usr/bin/unknown
+do the unknown thing
+shellicate this stuff (
+#DEBHELPER#
+) yay!
+exit happily
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/fill-values b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/fill-values
new file mode 100644
index 0000000..99b7449
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/build-spec/fill-values
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: scripts-control-interpreters
+Description: Check maintainer and config script interpreters
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/desc b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/desc
new file mode 100644
index 0000000..5dfc2c3
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/desc
@@ -0,0 +1,3 @@
+Testname: scripts-control-interpreters
+See-Also: Debian Bug#508307
+Check: maintainer-scripts/generated
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/hints b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/hints
new file mode 100644
index 0000000..daa8447
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/hints
@@ -0,0 +1 @@
+scripts-control-interpreters-forbidden (binary): debhelper-autoscript-in-maintainer-scripts dh_installdebconf/TOOL-VERSION
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/post-test b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/post-test
new file mode 100644
index 0000000..6205e14
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-control-interpreters/eval/post-test
@@ -0,0 +1 @@
+s,/.*,/TOOL-VERSION,
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/maintscript b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/maintscript
new file mode 100644
index 0000000..c3dcfac
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/maintscript
@@ -0,0 +1 @@
+mv_conffile /etc/foo/old.conf /etc/foo/new.conf 0~
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postinst
new file mode 100755
index 0000000..492f84a
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postinst
@@ -0,0 +1,255 @@
+#!/bin/sh
+
+# This file contains a pile of random junk in maintainer scripts that we
+# should be checking for in checks/scripts. Don't put bashisms in this file,
+# though; those should go into scripts-bashisms.
+
+set -e
+
+print "Hit enter to continue"
+read foo
+
+echo Please use update-rc.d or invoke-rc.d to set up blah blah.
+
+chown root.root /usr/share/doc/maintainer-scripts/changelog
+chown root:root /usr/share/doc/maintainer-scripts/changelog
+
+# valid
+FOO=/tmp
+FOO=/var/tmp
+: ${FOO:=/tmp}
+FOO=`mktemp /tmp/scripts.XXXXXX`
+rm "$FOO"
+FOO=`tempfile -n/tmp/scripts.tmp`
+mkdir /var/tmp/scripts
+# invalid
+echo foo >>/tmp/scripts.tmp
+rm /tmp/scripts.tmp
+rmdir /var/tmp/scripts
+
+# invalid, maintainer-script-hides-init-failure
+invoke-rc.d foo start || exit 0
+
+# The right way to invoke an rc script
+if which invoke-rc.d >/dev/null 2>&1; then
+ invoke-rc.d package start
+else
+ /etc/init.d/package start
+fi
+
+# Example ucf invocation.
+ucf /usr/share/foo/configuration /etc/foo.conf
+
+# Calling gconftool directly.
+gconftool-2 --makefile-install-rule foo.schema
+
+# Calling gconf-schemas with no dependency.
+gconf-schemas --register foo.schema
+
+# Calling update-xmlcatalog with no dependency.
+update-xmlcatalog --add --type system --id "/usr/share/sgml/dtd/foo" \
+ --package maintainer-scripts --root
+
+# Maintainer scripts shouldn't touch /var/lib/dpkg/status. This is the old
+# recipe from the dpkg wiki that should be replaced with dpkg-query.
+sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' /etc/conffile'{s/.* //;p}}\" \
+ /var/lib/dpkg/status
+
+# Don't modify these files.
+echo 'broken 6714/tcp' >> /etc/services
+cp /nonexistent /etc/protocols
+mv /usr/share/doc/rpc /etc/rpc
+
+# But this is okay.
+cp /etc/protocols /etc/protocols.new
+
+# This is also wrong.
+echo 'broken' > /etc/inetd.conf
+cp /etc/inetd.conf.new /etc/inetd.conf
+
+# But this is fine.
+cp /etc/inetd.conf /srv/chroot/etc/inetd.conf
+
+# Deprecated and not allowed except the second one.
+install-sgmlcatalog --install package
+install-sgmlcatalog --remove package
+
+# Calling start-stop-daemon directly in an init script.
+start-stop-daemon --start --quiet --name foo --startas /usr/bin/foo
+
+# But stopping it is fine -- we may be working around something else.
+start-stop-daemon --stop --quiet --name foo --startas /usr/bin/foo
+
+# Deprecated chown use with flags.
+chown -R root.root /usr/share/doc/maintainer-scripts
+
+# The first should not trigger an error about a command with a path, but the
+# second should.
+case $mainscript in
+ /usr/bin/foo) foobarbaz;;
+esac
+/usr/bin/baz; echo bar
+
+# fc-cache shouldn't be called directly, but make sure we don't see it in a
+# heredoc.
+fc-cache
+cat <<EOF
+fc-cache
+EOF
+
+# Obsolete suidregister program.
+suidregister /usr/bin/foo
+
+# install-info is now handled through triggers.
+install-info --quiet --section Development Development \
+ /usr/share/info/foobar.info
+
+# Packages don't get to modify /etc/ld.so.conf
+echo '/usr/local/lib' >> /etc/ld.so.conf
+( cat /etc/ld.so.conf ; echo '/usr/local/lib' ) > /etc/ld.so.conf.new
+mv /etc/ld.so.conf.new /etc/ld.so.conf
+
+# Further tests for commands with paths in maintainer scripts. The following
+# should not trigger a tag (Bug#536397).
+chmod `dpkg-statoverride --list /usr/sbin/apache2 | cut -f 3` /usr/sbin/apache2
+
+# These, however, should.
+true `basename "$0"` `/usr/bin/foo bar`
+true `/usr/bin/foo "$0"`
+
+# This line should not trigger a warning about no dependency on ucf because of
+# the || true. (Bug#541372)
+ucf -p /etc/sensors3.conf || true
+
+if false ; then
+ mknod some thing
+fi
+
+# Calling update alternative --set see #643602
+update-alternatives --set editor /usr/bin/nano
+
+# false positive
+start-stop-daemon--stop --quiet --name foo --startas /usr/bin/foo
+
+# false positive
+start-stop-daemon --quiet --stop --name foo --startas /usr/bin/foo
+
+# false negative
+start-stop-daemon --quiet --start --name foo --startas /usr/bin/foo
+
+# remove device file
+rm /dev/null
+
+# false positive
+rm /dev/shm/test
+rm /dev/.hiddenfile
+
+# adduser system
+adduser --system foo
+adduser --system foo2 --home /home/foo2
+adduser --system bar --home /var/lib/bar
+adduser --home /var/lib/fnord --system fnord
+adduser --home /home/fnord2 --system fnord2
+
+# other test case for gconftool
+/usr/bin/gconftool-2 --makefile-install-rule foo.schema
+
+# service
+service apache2 start
+
+# adduser through variable
+DEVNULL=/dev/null
+adduser --system bar1 --home $DEVNULL
+adduser --system bar2 --home ${DEVNULL}
+
+# this is a false positive due to quoting
+adduser --system bar2 --home "${DEVNULL}"
+adduser --system --ingroup smmta --home "/var/lib/sendmail" \
+ --disabled-password \
+ --quiet --gecos 'Mail Transfer Agent' smmta;
+
+# false positive
+echo "You can use update-alternatives --config runsystem to select"
+echo "the runsystem to use."
+
+# false negative
+DIVERSIONS=`env LC_ALL=C /usr/sbin/dpkg-divert --list | grep -E 'by amule(-utils)?$'` || true
+DIVERSIONS=`env LC_ALL="C" /usr/sbin/dpkg-divert --list | grep -E 'by amule(-utils)?$'` || true
+DIVERSIONS=`env LC_ALL='C' /usr/sbin/dpkg-divert --list | grep -E 'by amule(-utils)?$'` || true
+
+if [ ! -x /usr/sbin/dpkg-state-override ] || \
+ ! dpkg-state-override > /dev/null
+then
+ true;
+fi
+
+# bad
+dpkg-maintscript-helper symlink_to_dir \
+ /usr/share/autoconf-archive/html/ \
+ ../../autoconf-archive/html \
+ 20111221-2~ -- "$@"
+
+# good
+dpkg-maintscript-helper symlink_to_dir \
+ /usr/share/autoconf-archive/html \
+ ../../autoconf-archive/html \
+ 20111221-2~ -- "$@"
+
+# true positive
+adduser --system --quiet --ingroup ntp --no-create-home ntp
+adduser festival --quiet --system --ingroup audio --no-create-home
+
+# detect usage that could be replaced by dpkg-maintscript-helper
+if [ -d /usr/share/doc/tworld ]; then
+ if rmdir /usr/share/doc/tworld 2>/dev/null; then
+ ln -s tworld-data /usr/share/doc/tworld
+ fi
+fi
+
+chown root:root /good
+chmod 777 /good
+chown -R root:root /bad
+chown root:root -R /bad
+chown root:root --recursive /bad
+chown --recursive root:root /bad
+chmod -R 777 /bad
+chmod 777 -R /bad
+chmod 777 --recursive /bad
+chmod --recursive 777 /bad
+find /bad -maxdepth 2 -type d -exec chown root:root {} \; # (#895370)
+find /bad -maxdepth 2 -type d -exec chmod 777 # (#895370)
+
+echo /var/lib/dpkg/info/other-package.conffiles
+echo /var/lib/dpkg/info/other-package.md5sums
+echo /var/lib/dpkg/info/other-package.shlibs
+echo /var/lib/dpkg/info/other-package.postinst
+echo /var/lib/dpkg/info/other-package.preinst
+echo /var/lib/dpkg/info/other-package.list
+echo /var/lib/dpkg/triggers/other-package
+
+getent passwd good || true
+getent group good || true
+getent passwd good || true # grep /etc/passwd false-positive
+getent group good || true # grep /etc/group false-positive
+grep bad /etc/passwd || true
+grep bad /etc/group || true
+grep -E bad /etc/passwd || true
+grep -E bad /etc/passwd || true
+grep -F bad /etc/group || true
+grep -F bad /etc/group || true
+# grep /etc/passwd false-positive
+# grep /etc/group false-positive
+
+echo $PIUPARTS_TEST # bad
+echo ${PIUPARTS_OBJECTS}
+echo ${PIUPARTS_PHASE}
+echo ${PIUPARTS_DISTRIBUTION}
+echo ${PIUPARTS_DISTRIBUTION_NEXT}
+echo ${PIUPARTS_DISTRIBUTION_PREV}
+echo $PIUPARTS_IS_AWESOME # good
+
+#DEBHELPER#
+
+# Automatically added by dh_dummy/12
+true `/usr/bin/false-positive "$0"`
+# End automatically added section
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postrm b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postrm
new file mode 100644
index 0000000..21ce89e
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+# we do not set -e
+
+echo "ok" > /dev/null
+
+# not allowed
+update-alternatives --remove foo
+
+#DEBHELPER# \ No newline at end of file
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/prerm b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/prerm
new file mode 100644
index 0000000..fcbd64e
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+# This script should fail a syntax check
+
+if [ "$1" = configure ] then # oh look - I forgot a ;
+ echo "Hallo world"
+fi
+
+#DEBHELPER#
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/rules b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/rules
new file mode 100644
index 0000000..6f66b82
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_installdeb:
+ dh_installdeb
+ echo "#DEBHELPER#" >> debian/$(shell dh_listpackages)/DEBIAN/postinst
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/fill-values b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/fill-values
new file mode 100644
index 0000000..111edec
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/build-spec/fill-values
@@ -0,0 +1,4 @@
+Skeleton: upload-native
+Testname: scripts-maintainer-general
+Distribution: precise
+Description: Check general problems in maintainer scripts
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/desc b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/desc
new file mode 100644
index 0000000..53a4676
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/desc
@@ -0,0 +1,4 @@
+Testname: scripts-maintainer-general
+Profile: ubuntu/main
+See-Also: Debian Bug#532984
+Check: maintainer-scripts/generated
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/hints b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/hints
new file mode 100644
index 0000000..e5cee75
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/hints
@@ -0,0 +1,2 @@
+scripts-maintainer-general (binary): debhelper-autoscript-in-maintainer-scripts dh_installdeb/TOOL-VERSION
+scripts-maintainer-general (binary): debhelper-autoscript-in-maintainer-scripts dh_dummy/TOOL-VERSION
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/post-test b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/post-test
new file mode 100644
index 0000000..6205e14
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-general/eval/post-test
@@ -0,0 +1 @@
+s,/.*,/TOOL-VERSION,
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/debian/postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/debian/postinst
new file mode 100644
index 0000000..1004a3a
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/debian/postinst
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+# Automatically added by dh_fake_lintian_tool
+if [ "$1" = configure ]; then
+ echo do something ...
+fi
+# End automatically added section
+
+# Automatically added by dh_fake_lintian_tool_versioned/1.0
+if [ "$1" = configure ]; then
+ echo do something ...
+fi
+# End automatically added section
+
+# dh_python tools adds a ":" after for some reason. Ignore it
+# Automatically added by dh_fake_python3:
+if [ "$1" = configure ]; then
+ echo do something else ...
+fi
+# End automatically added section
+
+# Again, now pretending it has a version
+# Automatically added by dh_fake_python3_versioned/1.0:
+if [ "$1" = configure ]; then
+ echo do something else ...
+fi
+# End automatically added section
+
+
+exit 0
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/fill-values b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/fill-values
new file mode 100644
index 0000000..53ff431
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/build-spec/fill-values
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: scripts-maintainer-script-classification
+Description: Test for classification tags in maintscripts
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/desc b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/desc
new file mode 100644
index 0000000..bd8e63d
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/desc
@@ -0,0 +1,2 @@
+Testname: scripts-maintainer-script-classification
+Check: maintainer-scripts/generated
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/hints b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/hints
new file mode 100644
index 0000000..b2d78f7
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/hints
@@ -0,0 +1,4 @@
+scripts-maintainer-script-classification (binary): debhelper-autoscript-in-maintainer-scripts dh_fake_python3_versioned/TOOL-VERSION
+scripts-maintainer-script-classification (binary): debhelper-autoscript-in-maintainer-scripts dh_fake_python3
+scripts-maintainer-script-classification (binary): debhelper-autoscript-in-maintainer-scripts dh_fake_lintian_tool_versioned/TOOL-VERSION
+scripts-maintainer-script-classification (binary): debhelper-autoscript-in-maintainer-scripts dh_fake_lintian_tool
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/post-test b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/post-test
new file mode 100644
index 0000000..6205e14
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-maintainer-script-classification/eval/post-test
@@ -0,0 +1 @@
+s,/.*,/TOOL-VERSION,
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/install b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/install
new file mode 100644
index 0000000..4690206
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/install
@@ -0,0 +1 @@
+foo.afm usr/share/fonts/X11/Type1
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/postinst
new file mode 100644
index 0000000..ea5884d
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/debian/postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if false
+then
+ update-fonts-dir manual
+ update-fonts-scale manual
+fi
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/fill-values b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/fill-values
new file mode 100644
index 0000000..37d3c47
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/fill-values
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: scripts-missing-call-to-update-fonts-unrel
+Description: Check missing calls to update-fonts (false-positives)
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/orig/foo.afm b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/orig/foo.afm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/build-spec/orig/foo.afm
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/desc b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/desc
new file mode 100644
index 0000000..dac6811
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/desc
@@ -0,0 +1,2 @@
+Testname: scripts-missing-call-to-update-fonts-unrel
+Check: maintainer-scripts/generated
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/hints b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/hints
new file mode 100644
index 0000000..7d1fdc6
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/hints
@@ -0,0 +1 @@
+scripts-missing-call-to-update-fonts-unrel (binary): debhelper-autoscript-in-maintainer-scripts dh_installxfonts/TOOL-VERSION
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/post-test b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/post-test
new file mode 100644
index 0000000..6205e14
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts-unrel/eval/post-test
@@ -0,0 +1 @@
+s,/.*,/TOOL-VERSION,
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/install b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/install
new file mode 100644
index 0000000..4690206
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/install
@@ -0,0 +1 @@
+foo.afm usr/share/fonts/X11/Type1
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/postinst b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/postinst
new file mode 100644
index 0000000..72a8dfb
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/debian/postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if false
+then
+ echo "Deliberately not including DEBHELPER snippet."
+fi
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/fill-values b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/fill-values
new file mode 100644
index 0000000..4b17473
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/fill-values
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: scripts-missing-call-to-update-fonts
+Description: Check missing calls to update-fonts
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/orig/foo.afm b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/orig/foo.afm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/build-spec/orig/foo.afm
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/desc b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/desc
new file mode 100644
index 0000000..409b93d
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/desc
@@ -0,0 +1,2 @@
+Testname: scripts-missing-call-to-update-fonts
+Check: maintainer-scripts/generated
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/hints b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/hints
new file mode 100644
index 0000000..9fbef2c
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/hints
@@ -0,0 +1 @@
+scripts-missing-call-to-update-fonts (binary): debhelper-autoscript-in-maintainer-scripts dh_installxfonts/TOOL-VERSION
diff --git a/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/post-test b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/post-test
new file mode 100644
index 0000000..6205e14
--- /dev/null
+++ b/t/recipes/checks/maintainer-scripts/generated/scripts-missing-call-to-update-fonts/eval/post-test
@@ -0,0 +1 @@
+s,/.*,/TOOL-VERSION,