Hi!
I would like to have in unattended-upgrade a way to auto-update only
debian security without auto-updating everything else as well.
Please extend the matching mechanism to include an optional label. I think
that something like this would work (diff against 0.62.2):
--- /usr/bin/unattended-upgrade 2010-11-18 08:04:49.000000000 +0000
+++ unattended-upgrade 2011-03-24 12:16:15.000000000 +0000
@@ -84,11 +84,12 @@
for s in apt_pkg.config.value_list("Unattended-Upgrade::Allowed-Origins"):
# if there is a ":" use that as seperator, else use spaces
if ":" in s:
- (distro_id, distro_codename) = s.split(':')
+ origin_fields = s.split(':')
else:
- (distro_id, distro_codename) = s.split()
- allowed_origins.append((substitute(distro_id),
- substitute(distro_codename)))
+ origin_fields = s.split()
+ if len(origin_fields) not in (2, 3):
+ logging.error('Malformed line in
"Unattended-Upgrade::Allowed-Origins": %s', s)
+ allowed_origins.append(tuple(substitute(x) for x in origin_fields))
return allowed_origins
def is_allowed_origin(pkg, allowed_origins):
@@ -96,8 +97,13 @@
return False
for origin in pkg.candidate.origins:
for allowed in allowed_origins:
+ logging.debug('Trying to match with %s', repr(allowed))
if origin.origin == allowed[0] and origin.archive == allowed[1]:
- return True
+ if len(allowed) == 3: # this origin specifies a label as well
+ if origin.label == allowed[2]:
+ return True
+ else:
+ return True
return False
def check_changes_for_sanity(cache, allowed_origins, blacklist):
Thank you!
Luca
--
Beware of programmers who carry screwdrivers.
-- Leonard Brandwein
http://www.artha.org/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]