summaryrefslogtreecommitdiffstats
path: root/tests/t304
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:08:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:08:06 +0000
commitba6d96469df143b52295f8e79da648bf8a597407 (patch)
tree5ea0c3374f5c53209ad02008dcdddfc8ccae92e5 /tests/t304
parentInitial commit. (diff)
downloaddh-python-ba6d96469df143b52295f8e79da648bf8a597407.tar.xz
dh-python-ba6d96469df143b52295f8e79da648bf8a597407.zip
Adding upstream version 5.20230130+deb12u1.upstream/5.20230130+deb12u1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/t304')
-rw-r--r--tests/t304/Makefile23
-rwxr-xr-xtests/t304/bar.py2
-rwxr-xr-xtests/t304/baz.py2
-rw-r--r--tests/t304/debian/changelog5
-rw-r--r--tests/t304/debian/compat1
-rw-r--r--tests/t304/debian/control19
-rw-r--r--tests/t304/debian/copyright2
-rw-r--r--tests/t304/debian/examples1
-rw-r--r--tests/t304/debian/install7
-rw-r--r--tests/t304/debian/overrides.install2
-rwxr-xr-xtests/t304/debian/rules26
-rw-r--r--tests/t304/debian/source/format1
-rwxr-xr-xtests/t304/foo.py2
-rw-r--r--tests/t304/setup.py0
-rw-r--r--tests/t304/spam.py1
15 files changed, 94 insertions, 0 deletions
diff --git a/tests/t304/Makefile b/tests/t304/Makefile
new file mode 100644
index 0000000..d69cdc9
--- /dev/null
+++ b/tests/t304/Makefile
@@ -0,0 +1,23 @@
+#!/usr/bin/make -f
+
+include ../common.mk
+clean: clean-common
+
+check:
+ # python3.2 hardcoded via `dh_python3 --shebang ...python3.2`
+ grep -q '#! /usr/bin/python3.2 -OO' debian/foo/usr/share/baz32/baz.py
+ # python3.4 hardcoded via shebang
+ grep -q '/usr/share/foo \-V 3.4' debian/foo/DEBIAN/postinst
+ # /env removed from shebang
+ grep -q '#! /usr/bin/python3' debian/foo/usr/share/bar/bar.py
+ # /local removed from shebang
+ grep -q '#! /usr/bin/python3' debian/foo/usr/share/foo/baz.py
+ grep -q '#! /usr/bin/python3.4' debian/foo/usr/share/foo/foo.py
+ # make sure /usr/share/doc/ is ignored
+ grep -q -v "py3compile -p foo /usr/share/doc"\
+ debian/foo/DEBIAN/postinst
+ # -X made it into the postinst
+ grep -qF "/usr/share/bar -X 'spam.py'" debian/foo/DEBIAN/postinst
+ # Check argument parsing order
+ grep -q '#! /usr/bin/python3-dbg' debian/overrides/usr/share/overrides1/foo.py
+ grep -q '#! /usr/bin/python3-dbg' debian/overrides/usr/share/overrides2/foo.py
diff --git a/tests/t304/bar.py b/tests/t304/bar.py
new file mode 100755
index 0000000..edecee7
--- /dev/null
+++ b/tests/t304/bar.py
@@ -0,0 +1,2 @@
+#!/usr/bin/env python3
+"env in shebang"
diff --git a/tests/t304/baz.py b/tests/t304/baz.py
new file mode 100755
index 0000000..eff389f
--- /dev/null
+++ b/tests/t304/baz.py
@@ -0,0 +1,2 @@
+#!/usr/local/bin/python3
+"/usr/local in shebang"
diff --git a/tests/t304/debian/changelog b/tests/t304/debian/changelog
new file mode 100644
index 0000000..c1ed13c
--- /dev/null
+++ b/tests/t304/debian/changelog
@@ -0,0 +1,5 @@
+foo (1.0) unstable; urgency=low
+
+ * Initial release
+
+ -- Piotr Ożarowski <piotr@debian.org> Sun, 10 Jun 2012 14:09:45 +0200
diff --git a/tests/t304/debian/compat b/tests/t304/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/tests/t304/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/tests/t304/debian/control b/tests/t304/debian/control
new file mode 100644
index 0000000..4dd38b0
--- /dev/null
+++ b/tests/t304/debian/control
@@ -0,0 +1,19 @@
+Source: foo
+Section: misc
+Priority: optional
+Maintainer: Piotr Ożarowski <piotr@debian.org>
+Build-Depends: debhelper (>= 7.0.50~)
+Build-Depends-Indep: python3
+Standards-Version: 3.9.3
+
+Package: foo
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}
+Description: example 4 - shebangs
+ example package #4 - shebang related tests
+
+Package: overrides
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}
+Description: example 4 - command line parsing
+ example package #4 - command line argument parsing
diff --git a/tests/t304/debian/copyright b/tests/t304/debian/copyright
new file mode 100644
index 0000000..bf78fd0
--- /dev/null
+++ b/tests/t304/debian/copyright
@@ -0,0 +1,2 @@
+The Debian packaging is © 2012, Piotr Ożarowski <piotr@debian.org> and
+is licensed under the MIT License.
diff --git a/tests/t304/debian/examples b/tests/t304/debian/examples
new file mode 100644
index 0000000..fe8826b
--- /dev/null
+++ b/tests/t304/debian/examples
@@ -0,0 +1 @@
+foo.py
diff --git a/tests/t304/debian/install b/tests/t304/debian/install
new file mode 100644
index 0000000..a106b6e
--- /dev/null
+++ b/tests/t304/debian/install
@@ -0,0 +1,7 @@
+foo.py /usr/share/foo/
+baz.py /usr/share/foo/
+spam.py /usr/share/foo/
+bar.py /usr/share/bar/
+spam.py /usr/share/bar/
+baz.py /usr/share/baz32/
+spam.py /usr/share/baz32/
diff --git a/tests/t304/debian/overrides.install b/tests/t304/debian/overrides.install
new file mode 100644
index 0000000..23e1322
--- /dev/null
+++ b/tests/t304/debian/overrides.install
@@ -0,0 +1,2 @@
+foo.py /usr/share/overrides1/
+foo.py /usr/share/overrides2/
diff --git a/tests/t304/debian/rules b/tests/t304/debian/rules
new file mode 100755
index 0000000..5de6e3d
--- /dev/null
+++ b/tests/t304/debian/rules
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+%:
+ dh $@ --buildsystem=python_distutils
+
+override_dh_auto_build:
+override_dh_auto_install:
+
+override_dh_install:
+ dh_install
+ DH_VERBOSE=1 ../../dh_python3 -p foo
+ DH_VERBOSE=1 ../../dh_python3 -p foo /usr/share/bar -X spam.py
+ DH_VERBOSE=1 ../../dh_python3 -p foo /usr/share/baz32 --shebang '/usr/bin/python3.2 -OO'
+
+ # Argument priority: -O > regular args > DH_OPTIONS
+ DH_VERBOSE=1 DH_OPTIONS=--shebang=/usr/bin/python3.0 \
+ ../../dh_python3 -p overrides \
+ --shebang=/usr/bin/python3-dbg \
+ /usr/share/overrides1
+ DH_VERBOSE=1 ../../dh_python3 -p overrides \
+ --shebang=/usr/bin/python3.0 \
+ -O=--shebang=/usr/bin/python3-dbg \
+ -O=--foo=bar \
+ /usr/share/overrides2
+
+clean:
+ dh_clean
diff --git a/tests/t304/debian/source/format b/tests/t304/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/tests/t304/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/tests/t304/foo.py b/tests/t304/foo.py
new file mode 100755
index 0000000..fef29a7
--- /dev/null
+++ b/tests/t304/foo.py
@@ -0,0 +1,2 @@
+#!/usr/local/bin/python3.4
+"/usr/local/bin/python3.4 hardcoded in shebang"
diff --git a/tests/t304/setup.py b/tests/t304/setup.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t304/setup.py
diff --git a/tests/t304/spam.py b/tests/t304/spam.py
new file mode 100644
index 0000000..c8b0fd9
--- /dev/null
+++ b/tests/t304/spam.py
@@ -0,0 +1 @@
+print('spam')