From e4fc8e1b75c86cd50ed478210af42602f5961c08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Thu, 15 Sep 2011 20:51:05 +0200
Subject: [PATCH] handle private dir paths without leading slash

---
 debian/changelog | 5 +++++
 dh_python2       | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index d992b8f..d8ebe29 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,12 @@
 python-defaults (2.7.2-6) UNRELEASED; urgency=low
 
+  [ Scott Kitterman ]
   * Fixed typo in python-policy (thanks to Jakub Wilk)
 
+  [ Piotr Ożarowski ]
+  * dh_python2:
+    - handle private dirs without leading slash
+
  -- Scott Kitterman <scott@kitterman.com>  Sat, 03 Sep 2011 11:21:35 -0400
 
 python-defaults (2.7.2-5) experimental; urgency=low
diff --git a/dh_python2 b/dh_python2
index fb5d24a..4d6f603 100755
--- a/dh_python2
+++ b/dh_python2
@@ -554,7 +554,13 @@ def main():
                 log.warning('dh_pydeb detected, PyDist feature disabled')
                 options.guess_deps = False
 
-    private_dir = None if not args else args[0]
+    if not args:
+        private_dir = None
+    else:
+        private_dir = args[0]
+        if not private_dir.startswith('/'):
+            # handle usr/share/foo dirs (without leading slash)
+            private_dir = '/' + private_dir
     # TODO: support more than one private dir at the same time (see :meth:scan)
     if options.skip_private:
         private_dir = False
-- 
GitLab