Merge lp:~didrocks/python-distutils-extra/handle-submodules into lp:python-distutils-extra

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: not available
Proposed branch: lp:~didrocks/python-distutils-extra/handle-submodules
Merge into: lp:python-distutils-extra
Diff against target: None lines
To merge this branch: bzr merge lp:~didrocks/python-distutils-extra/handle-submodules
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+11593@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

This enables to fix bug #421689: if a module contains a submodule packaged independently, python-mkdebian will only to the parent module as a dep, not the child one.

This make projects depends on python-desktopcouch instead of python-desktopcouch-records

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUtilsExtra/auto.py'
2--- DistUtilsExtra/auto.py 2009-08-08 07:16:13 +0000
3+++ DistUtilsExtra/auto.py 2009-09-11 08:49:28 +0000
4@@ -32,7 +32,7 @@
5 author, license, etc.) in ./setup.py.
6 '''
7
8-__version__ = '2.9'
9+__version__ = '2.10'
10
11 # (c) 2009 Canonical Ltd.
12 # Author: Martin Pitt <martin.pitt@ubuntu.com>
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2009-08-08 10:10:20 +0000
16+++ debian/changelog 2009-09-11 08:48:16 +0000
17@@ -1,3 +1,10 @@
18+python-distutils-extra (2.10) unstable; urgency=low
19+
20+ * python-mkdebian: handle complex cases where submodules of a module
21+ can be in different packages
22+
23+ -- Didier Roche <didrocks@ubuntu.com> Fri, 11 Sep 2009 10:46:56 +0200
24+
25 python-distutils-extra (2.9) unstable; urgency=low
26
27 * Add missing intltool build dependency. (Closes: #536914)
28
29=== modified file 'debian/local/python-mkdebian'
30--- debian/local/python-mkdebian 2009-08-08 07:03:46 +0000
31+++ debian/local/python-mkdebian 2009-09-11 08:49:28 +0000
32@@ -140,7 +140,7 @@
33 debhelper (>= 6),
34 python,
35 python-central (>= 0.6.11),
36- python-distutils-extra (>= 2.9)%s''' % bdeps,
37+ python-distutils-extra (>= 2.10)%s''' % bdeps,
38 'Maintainer': author,
39 'Package': egg['Name'],
40 'Description' : egg.get('Summary', '') + '\n '.join(['',] + list(textwrap.wrap(egg.get('Description', ''), 72)))
41@@ -228,21 +228,26 @@
42 return package
43
44 # bigger hammer: dpkg -S for Python packages
45- dpkg = subprocess.Popen(['dpkg', '-S', '*/%s/__init__.py' % module.split('.')[0]],
46- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
47- out = dpkg.communicate()[0]
48- pkgs = set()
49- for line in out.splitlines():
50- pkgs.add(line.split(':')[0])
51- if len(pkgs) == 1:
52- package = list(pkgs)[0]
53- return package
54- elif len(pkgs) > 1:
55- py_pkgs = [p for p in pkgs if p.startswith('python-')]
56- if len(py_pkgs) == 1:
57- return py_pkgs[0]
58- else:
59- print '[dpkg -S found more than one package: %s; ignoring]' % ', '.join(pkgs),
60+ # module can be module.submodule.subsubmodule packaged independentaly
61+ # (case of python-desktopcouh and python-desktopcouchi-records)
62+ module_name = module.split('.')
63+ while(module_name):
64+ dpkg = subprocess.Popen(['dpkg', '-S', '*/%s/__init__.py' % '/'.join(module_name)],
65+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
66+ out = dpkg.communicate()[0]
67+ pkgs = set()
68+ for line in out.splitlines():
69+ pkgs.add(line.split(':')[0])
70+ if len(pkgs) == 1:
71+ package = list(pkgs)[0]
72+ return package
73+ elif len(pkgs) > 1:
74+ py_pkgs = [p for p in pkgs if p.startswith('python-')]
75+ if len(py_pkgs) == 1:
76+ return py_pkgs[0]
77+ else:
78+ print '[dpkg -S found more than one package: %s; ignoring]' % ', '.join(pkgs),
79+ module_name = module_name[:-1]
80
81 # bigger hammer: dpkg -S for compiled extensions
82 dpkg = subprocess.Popen(['dpkg', '-S', '*/%s.so' % module.replace('.', '/')],
83
84=== modified file 'setup.py'
85--- setup.py 2009-08-08 07:03:46 +0000
86+++ setup.py 2009-09-11 08:49:28 +0000
87@@ -5,7 +5,7 @@
88
89 setup(
90 name = 'python-distutils-extra',
91- version = '2.9',
92+ version = '2.10',
93 author = 'Sebastian Heinlein, Martin Pitt',
94 author_email = 'sebi@glatzor.de, martin.pitt@ubuntu.com',
95 description = 'Add support for i18n, documentation and icons to distutils',

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: