Merge ubottu Bugtracker with bzr.
Treat the Architecture key from apt-cache as a list, rather than a single string.
This commit is contained in:
parent
3d087845f1
commit
f0d7e799d1
|
@ -772,8 +772,22 @@ class Launchpad(IBugtracker):
|
||||||
|
|
||||||
if tasks.total_size != 1:
|
if tasks.total_size != 1:
|
||||||
tasks = list(tasks)
|
tasks = list(tasks)
|
||||||
tasks.sort(self._sort)
|
try:
|
||||||
taskdata = tasks[-1]
|
tasks.sort(self._sort)
|
||||||
|
taskdata = tasks[-1]
|
||||||
|
except ValueError:
|
||||||
|
tasks = [_ for _ in tasks if _.bug_target_name.endswith(u'(Ubuntu)')]
|
||||||
|
if tasks:
|
||||||
|
if len(tasks) != 1:
|
||||||
|
try:
|
||||||
|
tasks.sort(self._sort)
|
||||||
|
taskdata = tasks[-1]
|
||||||
|
except ValueError:
|
||||||
|
taskdata = bugdata.bug_tasks[bugdata.bug_tasks.total_size - 1]
|
||||||
|
else:
|
||||||
|
taskdata = tasks[-1]
|
||||||
|
else:
|
||||||
|
taskdata = tasks[-1]
|
||||||
else:
|
else:
|
||||||
taskdata = tasks[0]
|
taskdata = tasks[0]
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,8 @@ class Apt:
|
||||||
self.aptfilecommand = """apt-file -s %s/%%s.list -c %s/apt-file/%%s -l search %%s""" % (self.aptdir, self.aptdir)
|
self.aptfilecommand = """apt-file -s %s/%%s.list -c %s/apt-file/%%s -l search %%s""" % (self.aptdir, self.aptdir)
|
||||||
|
|
||||||
def find(self, pkg, chkdistro, filelookup=True):
|
def find(self, pkg, chkdistro, filelookup=True):
|
||||||
_pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-_+'])
|
_pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-_+/'])
|
||||||
|
distro = ''
|
||||||
if len(pkg.strip().split()) > 1:
|
if len(pkg.strip().split()) > 1:
|
||||||
distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '.-_+'])
|
distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '.-_+'])
|
||||||
if not distro:
|
if not distro:
|
||||||
|
@ -129,8 +130,17 @@ class Apt:
|
||||||
del parser
|
del parser
|
||||||
archs = ''
|
archs = ''
|
||||||
if maxp2.has_key('Architecture'):
|
if maxp2.has_key('Architecture'):
|
||||||
if maxp2['Architecture'] not in ('all','any'):
|
archs = [_.strip() for _ in maxp2['Architecture'].split() if _.strip()]
|
||||||
archs = ' (Only available for %s)' % maxp2['Architecture']
|
for arch in archs:
|
||||||
|
if arch not in ('any', 'all'):
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
archs = ''
|
||||||
|
break
|
||||||
|
|
||||||
|
if archs:
|
||||||
|
archs = ' (Only available for %s)' % '; '.join(archs)
|
||||||
|
|
||||||
maxp["Distrobution"] = distro
|
maxp["Distrobution"] = distro
|
||||||
return("%s (source: %s): %s. In component %s, is %s. Version %s (%s), package size %s kB, installed size %s kB%s" %
|
return("%s (source: %s): %s. In component %s, is %s. Version %s (%s), package size %s kB, installed size %s kB%s" %
|
||||||
(maxp['Package'], maxp['Source'] or maxp['Package'], maxp['Description'].split('\n')[0], component(maxp['Section']),
|
(maxp['Package'], maxp['Source'] or maxp['Package'], maxp['Description'].split('\n')[0], component(maxp['Section']),
|
||||||
|
|
Loading…
Reference in New Issue