mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +00:00
syncpackage: s/syncblacklist/syncblocklist/g
This commit is contained in:
parent
3d11516599
commit
6c8a5d74bd
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -13,6 +13,7 @@ ubuntu-dev-tools (0.206) UNRELEASED; urgency=medium
|
|||||||
* Read ~/.devscripts in a more robust way, to ideally pick up multi-line
|
* Read ~/.devscripts in a more robust way, to ideally pick up multi-line
|
||||||
variables (Closes: #725418).
|
variables (Closes: #725418).
|
||||||
* mk-sbuild: default to using UTC for schroots (LP: #2097159).
|
* mk-sbuild: default to using UTC for schroots (LP: #2097159).
|
||||||
|
* syncpackage: s/syncblacklist/syncblocklist/g
|
||||||
|
|
||||||
-- Simon Quigley <tsimonq2@debian.org> Tue, 04 Mar 2025 13:04:30 -0600
|
-- Simon Quigley <tsimonq2@debian.org> Tue, 04 Mar 2025 13:04:30 -0600
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ Display more progress information.
|
|||||||
\fB\-F\fR, \fB\-\-fakesync\fR
|
\fB\-F\fR, \fB\-\-fakesync\fR
|
||||||
Perform a fakesync, to work around a tarball mismatch between Debian and
|
Perform a fakesync, to work around a tarball mismatch between Debian and
|
||||||
Ubuntu.
|
Ubuntu.
|
||||||
This option ignores blacklisting, and performs a local sync.
|
This option ignores blocklisting, and performs a local sync.
|
||||||
It implies \fB\-\-no\-lp\fR, and will leave a signed \fB.changes\fR file
|
It implies \fB\-\-no\-lp\fR, and will leave a signed \fB.changes\fR file
|
||||||
for you to upload.
|
for you to upload.
|
||||||
.TP
|
.TP
|
||||||
|
54
syncpackage
54
syncpackage
@ -435,14 +435,14 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
|
|||||||
close_bugs(bugs, src_pkg.source, src_pkg.version.full_version, changes, sponsoree)
|
close_bugs(bugs, src_pkg.source, src_pkg.version.full_version, changes, sponsoree)
|
||||||
|
|
||||||
|
|
||||||
def is_blacklisted(query):
|
def is_blocklisted(query):
|
||||||
"""Determine if package "query" is in the sync blacklist
|
"""Determine if package "query" is in the sync blocklist
|
||||||
Returns tuple of (blacklisted, comments)
|
Returns tuple of (blocklisted, comments)
|
||||||
blacklisted is one of False, 'CURRENT', 'ALWAYS'
|
blocklisted is one of False, 'CURRENT', 'ALWAYS'
|
||||||
"""
|
"""
|
||||||
series = Launchpad.distributions["ubuntu"].current_series
|
series = Launchpad.distributions["ubuntu"].current_series
|
||||||
lp_comments = series.getDifferenceComments(source_package_name=query)
|
lp_comments = series.getDifferenceComments(source_package_name=query)
|
||||||
blacklisted = False
|
blocklisted = False
|
||||||
comments = [
|
comments = [
|
||||||
f"{c.body_text}\n -- {c.comment_author.name}"
|
f"{c.body_text}\n -- {c.comment_author.name}"
|
||||||
f" {c.comment_date.strftime('%a, %d %b %Y %H:%M:%S +0000')}"
|
f" {c.comment_date.strftime('%a, %d %b %Y %H:%M:%S +0000')}"
|
||||||
@ -450,13 +450,13 @@ def is_blacklisted(query):
|
|||||||
]
|
]
|
||||||
|
|
||||||
for diff in series.getDifferencesTo(source_package_name_filter=query):
|
for diff in series.getDifferencesTo(source_package_name_filter=query):
|
||||||
if diff.status == "Blacklisted current version" and blacklisted != "ALWAYS":
|
if diff.status == "Blacklisted current version" and blocklisted != "ALWAYS":
|
||||||
blacklisted = "CURRENT"
|
blocklisted = "CURRENT"
|
||||||
if diff.status == "Blacklisted always":
|
if diff.status == "Blacklisted always":
|
||||||
blacklisted = "ALWAYS"
|
blocklisted = "ALWAYS"
|
||||||
|
|
||||||
# Old blacklist:
|
# Old blocklist:
|
||||||
url = "https://ubuntu-archive-team.ubuntu.com/sync-blacklist.txt"
|
url = "https://ubuntu-archive-team.ubuntu.com/sync-blocklist.txt"
|
||||||
with urllib.request.urlopen(url) as f:
|
with urllib.request.urlopen(url) as f:
|
||||||
applicable_lines = []
|
applicable_lines = []
|
||||||
for line in f:
|
for line in f:
|
||||||
@ -471,11 +471,11 @@ def is_blacklisted(query):
|
|||||||
pass
|
pass
|
||||||
source = line.strip()
|
source = line.strip()
|
||||||
if source and fnmatch.fnmatch(query, source):
|
if source and fnmatch.fnmatch(query, source):
|
||||||
comments += ["From sync-blacklist.txt:"] + applicable_lines
|
comments += ["From sync-blocklist.txt:"] + applicable_lines
|
||||||
blacklisted = "ALWAYS"
|
blocklisted = "ALWAYS"
|
||||||
break
|
break
|
||||||
|
|
||||||
return (blacklisted, comments)
|
return (blocklisted, comments)
|
||||||
|
|
||||||
|
|
||||||
def close_bugs(bugs, package, version, changes, sponsoree):
|
def close_bugs(bugs, package, version, changes, sponsoree):
|
||||||
@ -725,35 +725,35 @@ def main():
|
|||||||
if not src_pkg:
|
if not src_pkg:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
blacklisted, comments = is_blacklisted(src_pkg.source)
|
blocklisted, comments = is_blocklisted(src_pkg.source)
|
||||||
blacklist_fail = False
|
blocklist_fail = False
|
||||||
if blacklisted:
|
if blocklisted:
|
||||||
messages = []
|
messages = []
|
||||||
|
|
||||||
if blacklisted == "CURRENT":
|
if blocklisted == "CURRENT":
|
||||||
Logger.debug(
|
Logger.debug(
|
||||||
"Source package %s is temporarily blacklisted "
|
"Source package %s is temporarily blocklisted "
|
||||||
"(blacklisted_current). "
|
"(blocklisted_current). "
|
||||||
"Ubuntu ignores these for now. "
|
"Ubuntu ignores these for now. "
|
||||||
"See also LP: #841372",
|
"See also LP: #841372",
|
||||||
src_pkg.source,
|
src_pkg.source,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if args.fakesync:
|
if args.fakesync:
|
||||||
messages += ["Doing a fakesync, overriding blacklist."]
|
messages += ["Doing a fakesync, overriding blocklist."]
|
||||||
else:
|
else:
|
||||||
blacklist_fail = True
|
blocklist_fail = True
|
||||||
messages += [
|
messages += [
|
||||||
"If this package needs a fakesync, use --fakesync",
|
"If this package needs a fakesync, use --fakesync",
|
||||||
"If you think this package shouldn't be "
|
"If you think this package shouldn't be "
|
||||||
"blacklisted, please file a bug explaining your "
|
"blocklisted, please file a bug explaining your "
|
||||||
"reasoning and subscribe ~ubuntu-archive.",
|
"reasoning and subscribe ~ubuntu-archive.",
|
||||||
]
|
]
|
||||||
|
|
||||||
if blacklist_fail:
|
if blocklist_fail:
|
||||||
Logger.error("Source package %s is blacklisted.", src_pkg.source)
|
Logger.error("Source package %s is blocklisted.", src_pkg.source)
|
||||||
elif blacklisted == "ALWAYS":
|
elif blocklisted == "ALWAYS":
|
||||||
Logger.info("Source package %s is blacklisted.", src_pkg.source)
|
Logger.info("Source package %s is blocklisted.", src_pkg.source)
|
||||||
if messages:
|
if messages:
|
||||||
for message in messages:
|
for message in messages:
|
||||||
for line in textwrap.wrap(message):
|
for line in textwrap.wrap(message):
|
||||||
@ -765,7 +765,7 @@ def main():
|
|||||||
for line in textwrap.wrap(comment):
|
for line in textwrap.wrap(comment):
|
||||||
Logger.info(" %s", line)
|
Logger.info(" %s", line)
|
||||||
|
|
||||||
if blacklist_fail:
|
if blocklist_fail:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if args.lp:
|
if args.lp:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user