From b3b5577cfe637a92fab16a66b7ff7cacf43867bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org> Date: Sun, 12 Jun 2011 22:41:47 +0200 Subject: [PATCH] add --ignore-shebangs option that will disable translating shebangs into Debian dependencies --- debian/changelog | 2 ++ debpython/depends.py | 13 +++++++++---- dh_python2 | 2 ++ dh_python2.rst | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index bbd1dd7..11ddac2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ python-defaults (2.7.2-2) UNRELEASED; urgency=low maintainer script's -X arguments (thanks to Jakub Wilk for the patch) - deal with original symlinks more carefully (closes: 627969, thanks to Leonid Borisenko for the original patch) + - add --ignore-shebangs option that will disable translating shebangs into + Debian dependencies -- Piotr Ożarowski <piotr@debian.org> Sun, 12 Jun 2011 13:28:48 +0200 diff --git a/debpython/depends.py b/debpython/depends.py index 669ce4a..e74d68b 100644 --- a/debpython/depends.py +++ b/debpython/depends.py @@ -112,15 +112,20 @@ class Dependencies(object): if stats['compile']: self.depend(MINPYCDEP) - for interpreter, version in stats['shebangs']: - self.depend(interpreter) + if not options.ignore_shebangs: + for interpreter, version in stats['shebangs']: + self.depend(interpreter) for private_dir, details in stats['private_dirs'].iteritems(): - versions = list(v for i, v in details.get('shebangs', []) if v) + if options.ignore_shebangs: + versions = [] + else: + versions = list(v for i, v in details.get('shebangs', []) if v) + if len(versions) > 1: log.error('more than one Python dependency from shebangs' '(%s shebang versions: %s)', private_dir, versions) - exit(13) + exit(13) # TODO: move this to dh_python2 (and raise exception here) elif len(versions) == 1: # one hardcoded version self.depend("python%d.%d" % versions[0]) # TODO: if versions[0] not in requested_versions: FTBFS diff --git a/dh_python2 b/dh_python2 index 41d6e69..b441dec 100755 --- a/dh_python2 +++ b/dh_python2 @@ -486,6 +486,8 @@ def main(): help='recreate __init__.py files for given namespaces at install time') parser.add_option('--clean-pycentral', action='store_true', default=False, help='generate maintainer script that will remove pycentral files') + parser.add_option('--ignore-shebangs', action='store_true', default=False, + help='do not translate shebangs into Debian dependencies') # ignore some debhelper options: parser.add_option('-O', help=SUPPRESS_HELP) diff --git a/dh_python2.rst b/dh_python2.rst index 079d996..bc2db93 100644 --- a/dh_python2.rst +++ b/dh_python2.rst @@ -100,6 +100,8 @@ OPTIONS --clean-pycentral generate maintainer script that will remove byte code generated by python-central helper +--ignore-shebangs do not translate shebangs into Debian dependencies + SEE ALSO ======== * /usr/share/doc/python/python-policy.txt.gz -- GitLab