diff --git a/debian/changelog b/debian/changelog index 989a26c0d6c6515b0d2da25ddd3ee9123bdab40c..5545591111f86108017ebc4e4c923ff8d8de7bab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ python-defaults (2.6.6-11) UNRELEASED; urgency=low - add support for DH_OPTIONS env. variable - fix checking shebangs in private directories (executable bit wasn't checked correctly) + - add test4 to test handling private directories * pycompile: - --exclude now works with private dirs - use /usr/bin/pythonX.Y rather than pythonX.Y (to avoid /usr/local diff --git a/dh_python2 b/dh_python2 index d760290629ff4b0b608ee68ad874e95845e026ba..675f9944258ef64f6af9d29ebda4ca450a18cdae 100755 --- a/dh_python2 +++ b/dh_python2 @@ -421,7 +421,7 @@ def scan(package, dname=None): ################################################################ def main(): - usage = '%prog -p PACKAGE [-V [X.Y][-][A.B]] DIR_OR_FILE [-X REGEXPR]\n' + usage = '%prog -p PACKAGE [-V [X.Y][-][A.B]] DIR [-X REGEXPR]\n' parser = OptionParser(usage, version='%prog 2.0~beta1', option_class=Option) parser.add_option('--no-guessing-versions', action='store_false', diff --git a/tests/Makefile b/tests/Makefile index a6fe41faee9af511e792b5785db276ddcc4fbc92..0322ea07c394a026b105484737e206a7ea979a0b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,7 +1,7 @@ #!/usr/bin/make -f # enable or disable tests here: -TESTS := test1 test2 test3 +TESTS := test1 test2 test3 test4 all: $(TESTS) diff --git a/tests/t4/Makefile b/tests/t4/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..5400f5d5263e15d0f4546291235799c7330aa453 --- /dev/null +++ b/tests/t4/Makefile @@ -0,0 +1,19 @@ +#!/usr/bin/make -f + +all: run check + + +run: clean + dpkg-buildpackage -b -us -uc + +check: + grep -q python2.6 debian/foo/usr/share/foo/foo.py + grep -q Depends:.*python2.6 debian/foo/DEBIAN/control + grep -q python2.5 debian/foo/usr/share/bar/bar.py + grep -q Depends:.*python2.5 debian/foo/DEBIAN/control + grep -q python2.4 debian/foo/usr/share/foo/baz.py + test ! -x debian/foo/usr/share/foo/baz.py + grep -q Depends:.*python2.5 debian/foo/DEBIAN/control && false || true + +clean: + ./debian/rules clean diff --git a/tests/t4/bar.py b/tests/t4/bar.py new file mode 100755 index 0000000000000000000000000000000000000000..707570e1591273b7117859ad55a2edc61e1e7121 --- /dev/null +++ b/tests/t4/bar.py @@ -0,0 +1,2 @@ +#!/usr/bin/python2.5 +print("I'm bar") diff --git a/tests/t4/baz.py b/tests/t4/baz.py new file mode 100644 index 0000000000000000000000000000000000000000..8a52e9e2d554d284a14ad3886f2faeab7024dae3 --- /dev/null +++ b/tests/t4/baz.py @@ -0,0 +1,2 @@ +#!/usr/bin/python2.4 +print("I'm baz - not executable") diff --git a/tests/t4/debian/changelog b/tests/t4/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..0f9a1683f6506f544c30b1c993ceb553dfd7d6b9 --- /dev/null +++ b/tests/t4/debian/changelog @@ -0,0 +1,5 @@ +foo (0.1.1) unstable; urgency=low + + * Initial release + + -- Piotr Ożarowski <piotr@debian.org> Sat, 27 Feb 2010 20:42:17 +0100 diff --git a/tests/t4/debian/compat b/tests/t4/debian/compat new file mode 100644 index 0000000000000000000000000000000000000000..7f8f011eb73d6043d2e6db9d2c101195ae2801f2 --- /dev/null +++ b/tests/t4/debian/compat @@ -0,0 +1 @@ +7 diff --git a/tests/t4/debian/control b/tests/t4/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..fbfc9fdd6dc194f2c9aec6ebe9d45b8caa5b89ba --- /dev/null +++ b/tests/t4/debian/control @@ -0,0 +1,16 @@ +Source: foo +Section: misc +Priority: optional +Maintainer: Piotr Ożarowski <piotr@debian.org> +Build-Depends: debhelper (>= 7.0.50~) +Build-Depends-Indep: python +Standards-Version: 3.9.1 + +Package: foo +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Recommends: ${python:Recommends} +Suggests: ${python:Suggests} +Enhances: ${python:Enhances} +Description: example 4 - private directory + exemple package #4 - private directory diff --git a/tests/t4/debian/copyright b/tests/t4/debian/copyright new file mode 100644 index 0000000000000000000000000000000000000000..69cea758e6ab12db36e1b482bbe3c0b15ba79d83 --- /dev/null +++ b/tests/t4/debian/copyright @@ -0,0 +1,2 @@ +The Debian packaging is © 2011, Piotr Ożarowski <piotr@debian.org> and +is licensed under the MIT License. diff --git a/tests/t4/debian/install b/tests/t4/debian/install new file mode 100644 index 0000000000000000000000000000000000000000..a589a0cb873766a03c42ab921fcd649ac2b60b07 --- /dev/null +++ b/tests/t4/debian/install @@ -0,0 +1,3 @@ +foo.py /usr/share/foo/ +bar.py /usr/share/bar/ +baz.py /usr/share/foo/ diff --git a/tests/t4/debian/rules b/tests/t4/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..29b03405eeb477aaf67100f3cd6f3f6d5979e045 --- /dev/null +++ b/tests/t4/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=python_distutils + +override_dh_pysupport: + DH_VERBOSE=1 ../../dh_python2 + DH_VERBOSE=1 ../../dh_python2 /usr/share/bar + +clean: + dh_clean diff --git a/tests/t4/debian/source/format b/tests/t4/debian/source/format new file mode 100644 index 0000000000000000000000000000000000000000..89ae9db8f88b823b6a7eabf55e203658739da122 --- /dev/null +++ b/tests/t4/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/tests/t4/foo.py b/tests/t4/foo.py new file mode 100755 index 0000000000000000000000000000000000000000..d679d96790fe7a23e101e4afb7a7ad1f0efa7c1a --- /dev/null +++ b/tests/t4/foo.py @@ -0,0 +1,2 @@ +#!/usr/bin/python2.6 +print("I'm foo") diff --git a/tests/t4/setup.py b/tests/t4/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391