mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-06-26 07:31:29 +00:00
ubuntutools/requestsync/mail.py: rmadison() returns now the most recent source
line (Closes: #560758)
This commit is contained in:
parent
a6002f06e0
commit
0a3d905cf4
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -11,8 +11,10 @@ ubuntu-dev-tools (0.86) UNRELEASED; urgency=low
|
|||||||
[ Michael Bienia ]
|
[ Michael Bienia ]
|
||||||
* ubuntutools/requestsync/common.py: convert the changelog into a unicode
|
* ubuntutools/requestsync/common.py: convert the changelog into a unicode
|
||||||
string (lp: #498349)
|
string (lp: #498349)
|
||||||
|
* ubuntutools/requestsync/mail.py: rmadison() returns now the most recent
|
||||||
|
source line (Closes: #560758)
|
||||||
|
|
||||||
-- Michael Bienia <geser@ubuntu.com> Sun, 20 Dec 2009 14:08:31 +0100
|
-- Michael Bienia <geser@ubuntu.com> Sun, 20 Dec 2009 15:40:40 +0100
|
||||||
|
|
||||||
ubuntu-dev-tools (0.85) lucid; urgency=low
|
ubuntu-dev-tools (0.85) lucid; urgency=low
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
import smtplib
|
import smtplib
|
||||||
import socket
|
import socket
|
||||||
|
from debian_bundle.changelog import Version
|
||||||
from .common import raw_input_exit_on_ctrlc
|
from .common import raw_input_exit_on_ctrlc
|
||||||
from ..lp.udtexceptions import PackageNotFoundException
|
from ..lp.udtexceptions import PackageNotFoundException
|
||||||
|
|
||||||
@ -63,13 +64,18 @@ def rmadison(distro, package, release):
|
|||||||
rmadison_out = rmadison_cmd.communicate()[0]
|
rmadison_out = rmadison_cmd.communicate()[0]
|
||||||
assert (rmadison_cmd.returncode == 0)
|
assert (rmadison_cmd.returncode == 0)
|
||||||
|
|
||||||
# Work-around for a bug in Debians madison.php script not returning
|
# Return the most recent source line
|
||||||
# only the source line
|
lines = rmadison_out.splitlines()
|
||||||
for line in rmadison_out.splitlines():
|
if not lines:
|
||||||
if line.find('source') > 0:
|
# no output
|
||||||
return map(lambda x: x.strip(), line.split('|'))
|
return None
|
||||||
|
lines = [map(lambda x: x.strip(), line.split('|')) for line in lines]
|
||||||
return None
|
lines = [line for line in lines if line[3].find('source') != -1]
|
||||||
|
if lines:
|
||||||
|
return max(lines, key = lambda x: Version(x[1]))
|
||||||
|
else:
|
||||||
|
# no source line
|
||||||
|
return None
|
||||||
|
|
||||||
def getSrcPkg(distro, name, release):
|
def getSrcPkg(distro, name, release):
|
||||||
out = rmadison(distro, name, release)
|
out = rmadison(distro, name, release)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user