On Thu, Mar 24, 2011 at 12:23:58PM +0000, Luca Bigliardi wrote:
> Hi!
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):

I pushed a updated version of unattended-upgrades into sid with a much
more flexible matcher syntax. Could you please give that a try? The
default config should be suitable for your task. It should be possible
to just install it on squeeze, at most a rebuild is required but I
don't think it uses anything fancy that is sid only.

Cheers,
 Michael
 
> --- /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 debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to