mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-12 02:41:07 +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
|
||||
|
||||
* Team upload.
|
||||
|
11
syncpackage
11
syncpackage
@ -21,9 +21,9 @@
|
||||
# ##################################################################
|
||||
|
||||
import codecs
|
||||
import fnmatch
|
||||
import optparse
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import textwrap
|
||||
@ -436,10 +436,13 @@ def is_blacklisted(query):
|
||||
if not line.strip():
|
||||
applicable_lines = []
|
||||
continue
|
||||
m = re.match(r'^\s*([a-z0-9.+-]+)?', line)
|
||||
source = m.group(0)
|
||||
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
|
||||
blacklisted = 'ALWAYS'
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user