mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-21 05:41:29 +00:00
syncpackage: Support wildcards in sync-blacklist
This brings syncpackage's parsing of sync-blacklist.txt roughly into line with that in auto-sync (from lp:ubuntu-archive-tools).
This commit is contained in:
parent
6b8a75bc99
commit
fb22ba116f
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
|||||||
|
ubuntu-dev-tools (0.167) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* syncpackage:
|
||||||
|
+ Support wildcards in sync-blacklist.
|
||||||
|
|
||||||
|
-- Colin Watson <cjwatson@ubuntu.com> Tue, 11 Dec 2018 16:39:00 +0000
|
||||||
|
|
||||||
ubuntu-dev-tools (0.166) unstable; urgency=medium
|
ubuntu-dev-tools (0.166) unstable; urgency=medium
|
||||||
|
|
||||||
* Team upload.
|
* Team upload.
|
||||||
|
11
syncpackage
11
syncpackage
@ -21,9 +21,9 @@
|
|||||||
# ##################################################################
|
# ##################################################################
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
import fnmatch
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
@ -436,10 +436,13 @@ def is_blacklisted(query):
|
|||||||
if not line.strip():
|
if not line.strip():
|
||||||
applicable_lines = []
|
applicable_lines = []
|
||||||
continue
|
continue
|
||||||
m = re.match(r'^\s*([a-z0-9.+-]+)?', line)
|
|
||||||
source = m.group(0)
|
|
||||||
applicable_lines.append(line)
|
applicable_lines.append(line)
|
||||||
if source and query == source:
|
try:
|
||||||
|
line = line[:line.index('#')]
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
source = line.strip()
|
||||||
|
if source and fnmatch.fnmatch(query, source):
|
||||||
comments += ["From sync-blacklist.txt:"] + applicable_lines
|
comments += ["From sync-blacklist.txt:"] + applicable_lines
|
||||||
blacklisted = 'ALWAYS'
|
blacklisted = 'ALWAYS'
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user