From f94620d2f46ca74691af778934ca1f7a1fbd1929 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Thu, 20 Jan 2011 19:34:09 +0100
Subject: [PATCH] add support for DH_OPTIONS env. variable

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

diff --git a/debian/changelog b/debian/changelog
index b55eafa..57690be 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ python-defaults (2.6.6-11) UNRELEASED; urgency=low
       module name is now required)
     - replace a file with a symlink also if there's a matching one in
       pyshared directory already
+    - add support for DH_OPTIONS env. variable
 
  -- Piotr Ożarowski <piotr@debian.org>  Sat, 15 Jan 2011 21:14:38 +0100
 
diff --git a/dh_python2 b/dh_python2
index 92dc2ef..b35f60a 100755
--- a/dh_python2
+++ b/dh_python2
@@ -464,7 +464,8 @@ def main():
     # ignore some debhelper options:
     parser.add_option('-O', help=SUPPRESS_HELP)
 
-    (options, args) = parser.parse_args()
+    (options, args) = parser.parse_args(sys.argv[1:] + \
+                      os.environ.get('DH_OPTIONS', '').split())
     # regexpr option type is not used so lets check patterns here
     for pattern in options.regexpr or []:
         # fail now rather than at runtime
-- 
GitLab