Skip to content
Snippets Groups Projects
Commit 7b97ade9 authored by Piotr Ożarowski's avatar Piotr Ożarowski
Browse files

add --no-dbg-cleaning option (to disable removing files from debug

packages)
parent 6d049e4f
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ python-defaults (2.7.2-5) UNRELEASED; urgency=low ...@@ -6,6 +6,8 @@ python-defaults (2.7.2-5) UNRELEASED; urgency=low
from given package only, add --compile-all to dh_python2's call if you from given package only, add --compile-all to dh_python2's call if you
want the old behaviour (i.e. compile also files (plugins?) provided by want the old behaviour (i.e. compile also files (plugins?) provided by
other packages, which do not use a helper/bytecompile them) other packages, which do not use a helper/bytecompile them)
- add --no-dbg-cleaning option (to disable removing files from debug
packages)
* pyclean now accepts --package and private dir argument at the same time * pyclean now accepts --package and private dir argument at the same time
-- Piotr Ożarowski <piotr@debian.org> Thu, 28 Jul 2011 00:23:50 +0200 -- Piotr Ożarowski <piotr@debian.org> Thu, 28 Jul 2011 00:23:50 +0200
......
...@@ -299,7 +299,7 @@ def share_2x(dir1, dir2, dc=None): ...@@ -299,7 +299,7 @@ def share_2x(dir1, dir2, dc=None):
### PACKAGE DETAILS ############################################ ### PACKAGE DETAILS ############################################
def scan(package, dname=None): def scan(package, dname=None, clean_dbg_pkg=True):
"""Gather statistics about Python files in given package.""" """Gather statistics about Python files in given package."""
r = {'requires.txt': set(), r = {'requires.txt': set(),
'nsp.txt': set(), 'nsp.txt': set(),
...@@ -359,7 +359,7 @@ def scan(package, dname=None): ...@@ -359,7 +359,7 @@ def scan(package, dname=None):
# handle some EGG related data (.egg-info dirs) # handle some EGG related data (.egg-info dirs)
for name in dirs: for name in dirs:
if name.endswith('.egg-info'): if name.endswith('.egg-info'):
if dbg_package: if dbg_package and clean_dbg_pkg:
rmtree(join(root, name)) rmtree(join(root, name))
dirs.remove(name) dirs.remove(name)
continue continue
...@@ -396,7 +396,7 @@ def scan(package, dname=None): ...@@ -396,7 +396,7 @@ def scan(package, dname=None):
os.remove(lpath) os.remove(lpath)
log.info('renaming %s to %s', dstfpath, fn) log.info('renaming %s to %s', dstfpath, fn)
os.rename(dstfpath, fpath) os.rename(dstfpath, fpath)
if dbg_package and fext not in ('so', 'h'): if dbg_package and clean_dbg_pkg and fext not in ('so', 'h'):
os.remove(join(root, fn)) os.remove(join(root, fn))
continue continue
...@@ -449,7 +449,7 @@ def scan(package, dname=None): ...@@ -449,7 +449,7 @@ def scan(package, dname=None):
if res: if res:
r['shebangs'].add(res) r['shebangs'].add(res)
if dbg_package: if dbg_package and clean_dbg_pkg:
# remove empty directories in -dbg packages # remove empty directories in -dbg packages
proot = proot + '/usr/lib' proot = proot + '/usr/lib'
for root, dirs, file_names in os.walk(proot, topdown=False): for root, dirs, file_names in os.walk(proot, topdown=False):
...@@ -516,6 +516,9 @@ def main(): ...@@ -516,6 +516,9 @@ def main():
help='do not translate shebangs into Debian dependencies') help='do not translate shebangs into Debian dependencies')
parser.add_option('--ignore-namespace', action='store_true', default=False, parser.add_option('--ignore-namespace', action='store_true', default=False,
help="ignore Egg's namespace_packages.txt file and --namespace option") help="ignore Egg's namespace_packages.txt file and --namespace option")
parser.add_option('--no-dbg-cleaning', action='store_false',
dest='clean_dbg_pkg', default=True,
help='do not remove files from debug packages')
# ignore some debhelper options: # ignore some debhelper options:
parser.add_option('-O', help=SUPPRESS_HELP) parser.add_option('-O', help=SUPPRESS_HELP)
...@@ -577,7 +580,7 @@ def main(): ...@@ -577,7 +580,7 @@ def main():
if not pyremove(package, options.vrange): if not pyremove(package, options.vrange):
exit(5) exit(5)
fix_locations(package) fix_locations(package)
stats = scan(package, private_dir) stats = scan(package, private_dir, options.clean_dbg_pkg)
if not private_dir: if not private_dir:
share(package, stats, options) share(package, stats, options)
pyshared_dir = "debian/%s/usr/share/pyshared/" % package pyshared_dir = "debian/%s/usr/share/pyshared/" % package
......
...@@ -110,6 +110,8 @@ OPTIONS ...@@ -110,6 +110,8 @@ OPTIONS
--no-guessing-deps disable guessing dependencies --no-guessing-deps disable guessing dependencies
--no-dbg-cleaning do not remove any files from debug packages
--skip-private don't check private directories --skip-private don't check private directories
-v, --verbose turn verbose mode on -v, --verbose turn verbose mode on
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment