* syncpackage:

- Ignore CURRENT blacklisting: it's buggy, and we don't have a good use
    for it.
  - Always display blacklist comments, if they exist.
  - Display timestamps for DSD blacklist comments.
This commit is contained in:
Stefano Rivera 2011-10-26 21:08:17 +02:00
parent 2ad6ec42dd
commit 08513b1897
2 changed files with 30 additions and 29 deletions

5
debian/changelog vendored
View File

@ -4,6 +4,11 @@ ubuntu-dev-tools (0.134) UNRELEASED; urgency=low
* mk-sbuild: Correct typo in variable name. Thanks Laurent Declercq.
(Closes: #645917)
* Remove massfile. Neglected and unused (LP: #145598)
* syncpackage:
- Ignore CURRENT blacklisting: it's buggy, and we don't have a good use
for it.
- Always display blacklist comments, if they exist.
- Display timestamps for DSD blacklist comments.
[ Benjamin Drung ]
* syncpackage: Catch user abort.

View File

@ -414,7 +414,9 @@ def is_blacklisted(query):
series = Launchpad.distributions['ubuntu'].current_series
lp_comments = series.getDifferenceComments(source_package_name=query)
blacklisted = False
comments = [c.body_text + u' -- ' + c.comment_author.name
comments = [u'%s\n -- %s %s'
%(c.body_text, c.comment_author.name,
c.comment_date.strftime('%a, %d %b %Y %H:%M:%S +0000'))
for c in lp_comments]
for diff in series.getDifferencesTo(source_package_name_filter=query):
@ -427,21 +429,18 @@ def is_blacklisted(query):
# Old blacklist:
url = 'http://people.canonical.com/~ubuntu-archive/sync-blacklist.txt'
with codecs.EncodedFile(urllib.urlopen(url), 'UTF-8') as f:
applicable_comments = []
applicable_lines = []
for line in f:
if not line.strip():
applicable_comments = []
applicable_lines = []
continue
m = re.match(r'^\s*([a-z0-9.+-]+)?\s*(?:#\s*(.+)?)?$', line)
source, comment = m.groups()
m = re.match(r'^\s*([a-z0-9.+-]+)?', line)
source = m.group(0)
applicable_lines.append(line)
if source and query == source:
if comment:
applicable_comments.append(comment)
comments += applicable_comments
comments += ["From sync-blacklist.txt:"] + applicable_lines
blacklisted = 'ALWAYS'
break
elif comment:
applicable_comments.append(comment)
return (blacklisted, comments)
@ -603,44 +602,41 @@ def main():
options.debian_mirror)
blacklisted, comments = is_blacklisted(src_pkg.source)
blacklist_fail = False
if blacklisted:
fail = False
messages = []
if blacklisted == 'CURRENT':
if options.force:
messages += ["Forcing override of temporary blacklisting."]
else:
fail = True
messages += ["The blacklisting only applies to the current "
"versions in Debian and Ubuntu.",
"--force is required to override the blacklist."]
Logger.debug("Source package %s is temporarily blacklisted "
"(blacklisted_current). Ubuntu ignores these for now. "
"See also LP: #841372", src_pkg.source)
else:
if options.force and not options.lp:
messages += ["Forcing fake-sync, overriding blacklist."]
else:
fail = True
blacklist_fail = True
messages += ["--force and --no-lp are required to override the "
"blacklist, if this package needs a fakesync."]
messages += ["If you think this package shouldn't be blacklisted, "
"please file a bug explaining your reasoning and "
"subscribe ~ubuntu-archive."]
if fail:
if blacklist_fail:
Logger.error(u"Source package %s is blacklisted.", src_pkg.source)
else:
elif blacklisted == 'ALWAYS':
Logger.normal(u"Source package %s is blacklisted.", src_pkg.source)
if messages:
for message in messages:
for line in textwrap.wrap(message):
Logger.normal(line)
if comments:
Logger.normal("Blacklist Comments:")
for comment in comments:
for line in textwrap.wrap(comment):
Logger.normal(u" " + line)
if messages:
for message in messages:
for line in textwrap.wrap(message):
Logger.normal(line)
if fail:
if blacklist_fail:
sys.exit(1)
if options.lp: