tags  536754+ patch
thanks

Attached are 2 patches. One for Lenny to help people patch this into
lenny for the rest of lennys life time
(u-u-lenny.patch).

The second and more important patch is for unstable/testing/squeeze
(u-u-0.61.patch).

Of course it would be great if this could make it into squeeze....

Comments??

Regards
Alex Owen

PS: now to make an ubuntu patch!
diff -uNr -x'*.py' unattended-upgrades-0.25.1debian1.original/debian/changelog unattended-upgrades-0.25.1debian1/debian/changelog
--- unattended-upgrades-0.25.1debian1.original/debian/changelog	2008-06-14 14:02:35.000000000 +0100
+++ unattended-upgrades-0.25.1debian1/debian/changelog	2010-08-13 13:44:52.000000000 +0100
@@ -1,3 +1,11 @@
+unattended-upgrades (0.25.1debian1-0.2) lenny; urgency=low
+
+  * Non-maintainer upload.
+  * allow ":" as seperator in Unattended-Upgrade::Allowed-Origins
+    (closes: #536754) 
+
+ -- Alex Owen <r.a.o...@qmul.ac.uk>  Fri, 13 Aug 2010 13:43:24 +0100
+
 unattended-upgrades (0.25.1debian1-0.1) unstable; urgency=low
 
   * Non-Maintainter Update (BSP)
diff -uNr -x'*.py' unattended-upgrades-0.25.1debian1.original/README unattended-upgrades-0.25.1debian1/README
--- unattended-upgrades-0.25.1debian1.original/README	2007-06-07 12:38:35.000000000 +0100
+++ unattended-upgrades-0.25.1debian1/README	2010-08-13 13:42:15.000000000 +0100
@@ -24,6 +24,8 @@
 be configured to allow any (origin, archive) combination. Those values
 are taken from the "Release" file on the archive server. It is
 recommended to use the default (only stable updates from Debian).
+The new syntax is to colon seperate ":" the origin archive pair the old
+space seperated syntax will still work if no colon is found .
 
 All operations will be logged in /var/log/unattended-upgrades/. This
 includes the dpkg output as well.
diff -uNr -x'*.py' unattended-upgrades-0.25.1debian1.original/unattended-upgrade unattended-upgrades-0.25.1debian1/unattended-upgrade
--- unattended-upgrades-0.25.1debian1.original/unattended-upgrade	2007-04-24 22:32:11.000000000 +0100
+++ unattended-upgrades-0.25.1debian1/unattended-upgrade	2010-08-13 13:42:15.000000000 +0100
@@ -25,6 +25,19 @@
                self._depcache.BrokenCount == 0 \
                and self._depcache.DelCount == 0
         
+def get_allowed_origins():
+    """ return a list of allowed origins from apt.conf
+
+    This will NOT take substitutions (like distro_id) into account.
+    """
+    allowed_origins = []
+    for s in apt_pkg.Config.ValueList("Unattended-Upgrade::Allowed-Origins"):
+        if s.find(':')==-1:
+            (distro_id, distro_codename) = s.split()
+        else
+            (distro_id, distro_codename) = s.split(':')
+        allowed_origins.append((distro_id, distro_codename))
+    return allowed_origins
 
 def is_allowed_origin(pkg, allowed_origins):
     if not pkg.candidateOrigin:
@@ -116,7 +129,7 @@
     #apt_pkg.Config.Set("Dir::Cache::archives",dldir)
 
     # format (origin, archive), e.g. ("Ubuntu","dapper-security")
-    allowed_origins = map(string.split, apt_pkg.Config.ValueList("Unattended-Upgrade::Allowed-Origins"))
+    allowed_origins = get_allowed_origins()
 
     # pkgs that are (for some reason) not save to install
     blacklisted_pkgs = apt_pkg.Config.ValueList("Unattended-Upgrade::Package-Blacklist")
diff -uNr -x'*.py' unattended-upgrades-0.61.original/debian/changelog unattended-upgrades-0.61/debian/changelog
--- unattended-upgrades-0.61.original/debian/changelog	2010-08-02 12:23:08.000000000 +0100
+++ unattended-upgrades-0.61/debian/changelog	2010-08-13 12:45:31.000000000 +0100
@@ -1,3 +1,11 @@
+unattended-upgrades (0.61+nmu1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * allow ":" as seperator in Unattended-Upgrade::Allowed-Origins
+    (closes: #536754) 
+
+ -- Alex Owen <r.a.o...@qmul.ac.uk>  Fri, 13 Aug 2010 12:34:36 +0100
+
 unattended-upgrades (0.61) unstable; urgency=low
 
   * merged changes from the ubuntu branch
diff -uNr -x'*.py' unattended-upgrades-0.61.original/README unattended-upgrades-0.61/README
--- unattended-upgrades-0.61.original/README	2010-08-02 12:23:08.000000000 +0100
+++ unattended-upgrades-0.61/README	2010-08-13 13:06:36.000000000 +0100
@@ -44,6 +44,8 @@
 The value of "origin" is taken from the "Origin:" header in the file, 
 the value of "archive" is taken from the "Suite:" header.
 It is recommended to use the default (only security updates from Ubuntu).
+The new syntax is to colon seperate ":" the origin archive pair the old 
+space seperated syntax will still work if no colon is found .
 
 All operations will be logged in /var/log/unattended-upgrades/. This
 includes the dpkg output as well.
@@ -80,8 +82,8 @@
 ------------------------------8<--------------------------------------
 // Automaticall upgrade packages from these (origin, archive) pairs
 Unattended-Upgrade::Allowed-Origins {
-	"Ubuntu jaunty-security";
-	"Ubuntu jaunty-updates";
+	"Ubuntu:jaunty-security";
+	"Ubuntu:jaunty-updates";
 };
  
 // List of packages to not update
diff -uNr -x'*.py' unattended-upgrades-0.61.original/unattended-upgrade unattended-upgrades-0.61/unattended-upgrade
--- unattended-upgrades-0.61.original/unattended-upgrade	2010-08-02 12:23:08.000000000 +0100
+++ unattended-upgrades-0.61/unattended-upgrade	2010-08-13 12:45:31.000000000 +0100
@@ -82,7 +82,10 @@
     """
     allowed_origins = []
     for s in apt_pkg.config.value_list("Unattended-Upgrade::Allowed-Origins"):
-        (distro_id, distro_codename) = s.split()
+        if s.find(':')==-1:
+            (distro_id, distro_codename) = s.split()
+        else
+            (distro_id, distro_codename) = s.split(':')
         allowed_origins.append((substitute(distro_id), 
                                 substitute(distro_codename)))
     return allowed_origins

Reply via email to