mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-20 13:21:28 +00:00
Make CURRENT DSD Blacklisting overrideable
This commit is contained in:
parent
cfa2134468
commit
328e7bb241
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -17,6 +17,7 @@ ubuntu-dev-tools (0.129) UNRELEASED; urgency=low
|
|||||||
|
|
||||||
[ Stefano Rivera ]
|
[ Stefano Rivera ]
|
||||||
* syncpackage: Show changes to be synced when performing native syncs.
|
* syncpackage: Show changes to be synced when performing native syncs.
|
||||||
|
* syncpackage: Check the sync blacklist.
|
||||||
* syncpackage: Support --bug (extra bugs to be closed by the sync) with
|
* syncpackage: Support --bug (extra bugs to be closed by the sync) with
|
||||||
native syncs. (Bugs are closed one individually, via the API, post-sync)
|
native syncs. (Bugs are closed one individually, via the API, post-sync)
|
||||||
* dgetlp, submittodebian, 404main: Use unicode strings for literal strings
|
* dgetlp, submittodebian, 404main: Use unicode strings for literal strings
|
||||||
|
67
syncpackage
67
syncpackage
@ -404,22 +404,25 @@ def copy(src_pkg, release, bugs, simulate=False, force=False):
|
|||||||
|
|
||||||
def is_blacklisted(query):
|
def is_blacklisted(query):
|
||||||
""""Determine if package "query" is in the sync blacklist
|
""""Determine if package "query" is in the sync blacklist
|
||||||
Returns True or a string of all relevant comments if blacklisted,
|
Returns tuple of (blacklisted, comments)
|
||||||
False if not
|
blacklisted is one of False, 'CURRENT', 'ALWAYS'
|
||||||
"""
|
"""
|
||||||
# LP:
|
# LP:
|
||||||
# TODO: Refactor when LP: #833080 is fixed
|
# TODO: Refactor when LP: #833080 is fixed
|
||||||
series = Launchpad.distributions['ubuntu'].current_series
|
series = Launchpad.distributions['ubuntu'].current_series
|
||||||
diffs = (list(series.getDifferencesTo(source_package_name_filter=query,
|
lp_comments = series.getDifferenceComments(source_package_name=query)
|
||||||
status='Blacklisted current version'))
|
blacklisted = False
|
||||||
+ list(series.getDifferencesTo(source_package_name_filter=query,
|
comments = u'; '.join(c.body_text for c in lp_comments)
|
||||||
status='Blacklisted always')))
|
|
||||||
|
diffs = series.getDifferencesTo(source_package_name_filter=query,
|
||||||
|
status='Blacklisted current version')
|
||||||
if len(diffs) > 0:
|
if len(diffs) > 0:
|
||||||
comments = series.getDifferenceComments(source_package_name=query)
|
blacklisted = 'CURRENT'
|
||||||
comment = '; '.join(c.body_text for c in comments)
|
|
||||||
if comment:
|
diffs = series.getDifferencesTo(source_package_name_filter=query,
|
||||||
return comment
|
status='Blacklisted always')
|
||||||
return True
|
if len(diffs) > 0:
|
||||||
|
blacklisted = 'ALWAYS'
|
||||||
|
|
||||||
# Old blacklist:
|
# Old blacklist:
|
||||||
url = 'http://people.canonical.com/~ubuntu-archive/sync-blacklist.txt'
|
url = 'http://people.canonical.com/~ubuntu-archive/sync-blacklist.txt'
|
||||||
@ -434,13 +437,13 @@ def is_blacklisted(query):
|
|||||||
if source and query == source:
|
if source and query == source:
|
||||||
if comment:
|
if comment:
|
||||||
applicable_comments.append(comment)
|
applicable_comments.append(comment)
|
||||||
if applicable_comments:
|
comments = u'; '.join(applicable_comments)
|
||||||
return u'; '.join(applicable_comments)
|
blacklisted = 'ALWAYS'
|
||||||
else:
|
break
|
||||||
return True
|
|
||||||
elif comment:
|
elif comment:
|
||||||
applicable_comments.append(comment)
|
applicable_comments.append(comment)
|
||||||
return False
|
|
||||||
|
return (blacklisted, comments)
|
||||||
|
|
||||||
def close_bugs(bugs, package, version, changes):
|
def close_bugs(bugs, package, version, changes):
|
||||||
"""Close the correct task on all bugs, with changes"""
|
"""Close the correct task on all bugs, with changes"""
|
||||||
@ -590,20 +593,30 @@ def main():
|
|||||||
options.component, options.release,
|
options.component, options.release,
|
||||||
options.debian_mirror)
|
options.debian_mirror)
|
||||||
|
|
||||||
blacklisted = is_blacklisted(src_pkg.source)
|
blacklisted, comments = is_blacklisted(src_pkg.source)
|
||||||
if blacklisted:
|
if blacklisted:
|
||||||
Logger.error("Source package is blacklisted")
|
Logger.error("Source package is blacklisted")
|
||||||
if isinstance(blacklisted, basestring):
|
if comments:
|
||||||
Logger.error(u"Reason: %s", blacklisted)
|
Logger.error(u"Blacklist Comments: %s", comments)
|
||||||
Logger.error("If you think this package shouldn't be blacklisted, "
|
|
||||||
"please file a bug explaining your reasoning and "
|
if blacklisted == 'CURRENT':
|
||||||
"subscribe ~ubuntu-archive.")
|
if options.force:
|
||||||
if options.force and not options.lp:
|
Logger.warn(u"Forcing override of temporary blacklising.")
|
||||||
Logger.warn(u"Forcing fake-sync, overriding blacklist.")
|
else:
|
||||||
|
Logger.error("The blacklisting only applies to the current "
|
||||||
|
"versions in Debian and Ubuntu.")
|
||||||
|
Logger.error("--force is required to override the blacklist.")
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
Logger.error("--force and --no-lp are required to override the "
|
Logger.error("If you think this package shouldn't be blacklisted, "
|
||||||
"blacklist, if this package needs a fakesync.")
|
"please file a bug explaining your reasoning and "
|
||||||
sys.exit(1)
|
"subscribe ~ubuntu-archive.")
|
||||||
|
if options.force and not options.lp:
|
||||||
|
Logger.warn(u"Forcing fake-sync, overriding blacklist.")
|
||||||
|
else:
|
||||||
|
Logger.error("--force and --no-lp are required to override the "
|
||||||
|
"blacklist, if this package needs a fakesync.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if options.lp:
|
if options.lp:
|
||||||
copy(src_pkg, options.release, options.bugs, options.simulate,
|
copy(src_pkg, options.release, options.bugs, options.simulate,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user