From 58966f1b6d79c9c395fadc1d32a4e00b33cfa4cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Mon, 19 Jul 2010 20:29:47 +0200
Subject: [PATCH] few minor fixes

---
 Makefile             | 2 +-
 debian/changelog     | 4 ++--
 debian/control       | 3 ---
 debian/control.in    | 3 ---
 debian/rules         | 1 +
 debpython/depends.py | 2 +-
 debpython/pydist.py  | 2 +-
 dh_python2           | 4 +---
 tests/Makefile       | 2 +-
 tests/t1/setup.py    | 5 ++++-
 10 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 43bd099..f5650b3 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ install-dev:
 
 install-runtime:
 	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/python/debpython $(DESTDIR)$(PREFIX)/bin
-	$(INSTALL) -m 644 debpython/*py $(DESTDIR)$(PREFIX)/share/python/debpython/
+	$(INSTALL) -m 644 debpython/*.py $(DESTDIR)$(PREFIX)/share/python/debpython/
 	$(INSTALL) -m 755 pycompile $(DESTDIR)$(PREFIX)/bin/
 	$(INSTALL) -m 755 pyclean $(DESTDIR)$(PREFIX)/bin/
 
diff --git a/debian/changelog b/debian/changelog
index 77c2a96..6c9095f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-defaults (2.6.5-9) UNRELEASED; urgency=low
+python-defaults (2.6.5-9) unstable; urgency=low
 
   [ Piotr Ożarowski ]
   * pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging
@@ -10,7 +10,7 @@ python-defaults (2.6.5-9) UNRELEASED; urgency=low
   * Require python (>= 2.6.5-9~) in generated dependencies to use the fixed
     pycompile.
 
- -- Piotr Ożarowski <piotr@debian.org>  Sat, 17 Jul 2010 18:58:23 +0200
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 19 Jul 2010 20:27:50 +0200
 
 python-defaults (2.6.5-8) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 5dddd31..9fdccf7 100644
--- a/debian/control
+++ b/debian/control
@@ -59,9 +59,6 @@ Description: header files and a static library for Python (default)
  Python modules, extending the Python interpreter or embedding Python
  in applications.
  .
- Includes the Python distutils, which were in a separate package up to
- version 1.5.2.
- .
  This package is a dependency package, which depends on Debian's default
  Python version (currently v2.6).
 
diff --git a/debian/control.in b/debian/control.in
index eaa41f4..37891db 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -59,9 +59,6 @@ Description: header files and a static library for Python (default)
  Python modules, extending the Python interpreter or embedding Python
  in applications.
  .
- Includes the Python distutils, which were in a separate package up to
- version 1.5.2.
- .
  This package is a dependency package, which depends on Debian's default
  Python version (currently v@VER@).
 
diff --git a/debian/rules b/debian/rules
index 9dc9acd..b3adce9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -103,6 +103,7 @@ clean: control-file
 	    fi; \
 	done
 	rm -f debian/*.py[co]
+	make clean
 	dh_clean
 
 stamp-control:
diff --git a/debpython/depends.py b/debpython/depends.py
index c3445b5..d8156bd 100644
--- a/debpython/depends.py
+++ b/debpython/depends.py
@@ -139,7 +139,7 @@ class Dependencies(object):
                 vr = options.vrange
                 if vr:
                     args += "-V %s" % vrange_str(vr)
-                    if vr[0]:  # minumum version specified
+                    if vr[0]:  # minimum version specified
                         self.depend("python (>= %s)" % vrepr(vr[0]))
                     if vr[1]:  # maximum version specified
                         self.depend("python (<< %s)" % vrepr(vr[1]))
diff --git a/debpython/pydist.py b/debpython/pydist.py
index 6ba0617..6bb8a2e 100644
--- a/debpython/pydist.py
+++ b/debpython/pydist.py
@@ -112,7 +112,7 @@ def guess_dependency(req, version=None):
 
     data = load()
     req_dict = REQUIRES_RE.match(req)
-    if not req:
+    if not req_dict:
         log.warning('requirement is not valid: %s', req)
         log.info('please ask dh_python2 author to fix REQUIRES_RE '
                  'or your upstream author to fix requires.txt')
diff --git a/dh_python2 b/dh_python2
index a883fac..72e8456 100755
--- a/dh_python2
+++ b/dh_python2
@@ -444,9 +444,7 @@ def main():
     if options.skip_private:
         private_dir = False
 
-    if options.verbose:
-        log.setLevel(logging.INFO)
-    if os.environ.get('DH_VERBOSE') == '1':
+    if options.verbose or os.environ.get('DH_VERBOSE') == '1':
         log.setLevel(logging.DEBUG)
         log.debug('argv: %s', sys.argv)
         log.debug('options: %s', options)
diff --git a/tests/Makefile b/tests/Makefile
index 332bc8b..3417ac7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -7,7 +7,7 @@ test%:
 
 clean:
 	rm -f *\.dsc *\.tar\.gz *\.build *\.changes *\.deb
-	(cd t1; fakeroot ./debian/rules clean)
+	(cd t1; ./debian/rules clean)
 	@find . -name '*\.egg-info' -exec rm -rf "{}" \; || true
 
 .PHONY: clean
diff --git a/tests/t1/setup.py b/tests/t1/setup.py
index c5dd6e8..99695a1 100644
--- a/tests/t1/setup.py
+++ b/tests/t1/setup.py
@@ -1,6 +1,9 @@
 #! /usr/bin/python
 # -*- coding: UTF-8 -*-
-from setuptools import setup, find_packages
+try:
+    from setuptools import setup, find_packages
+except ImportError:
+    exit()
 
 setup(name='Foo',
       version=0.1,
-- 
GitLab