diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-08-17 09:17:07 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-08-17 09:17:07 -0500 |
commit | d3aa0c11d66ec50ce18bada80bbf2e6beba32a93 (patch) | |
tree | a489e2a93916b7a6f09f970d4296f1a055c7cf92 /src | |
parent | 58efdb361c20a1094a6b44c7847adcfd768c8f75 (diff) | |
download | bcfg2-d3aa0c11d66ec50ce18bada80bbf2e6beba32a93.tar.gz bcfg2-d3aa0c11d66ec50ce18bada80bbf2e6beba32a93.tar.bz2 bcfg2-d3aa0c11d66ec50ce18bada80bbf2e6beba32a93.zip |
APT: Add type='ignore' support (patch from tie on IRC)
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/APT.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py index 2b8cc3304..b2b8120ba 100644 --- a/src/lib/Client/Tools/APT.py +++ b/src/lib/Client/Tools/APT.py @@ -37,8 +37,8 @@ class APT(Bcfg2.Client.Tools.Tool): """ name = 'APT' __execs__ = [DEBSUMS, APTGET, DPKG] - __handles__ = [('Package', 'deb')] - __req__ = {'Package': ['name', 'version']} + __handles__ = [('Package', 'deb'), ('Path', 'ignore')] + __req__ = {'Package': ['name', 'version'], 'Path': ['type']} def __init__(self, logger, setup, config): Bcfg2.Client.Tools.Tool.__init__(self, logger, setup, config) @@ -55,6 +55,10 @@ class APT(Bcfg2.Client.Tools.Tool): if not self.setup['debug']: self.pkgcmd += '-q=2 ' self.pkgcmd += '-y install %s' + self.ignores = [entry.get('name') for struct in config \ + for entry in struct \ + if entry.tag == 'Path' and \ + entry.get('type') == 'ignore'] self.__important__ = self.__important__ + \ ["%s/cache/debconf/config.dat" % var_path, "%s/cache/debconf/templates.dat" % var_path, @@ -117,6 +121,7 @@ class APT(Bcfg2.Client.Tools.Tool): self.logger.error("Got Unsupported pattern %s from debsums" \ % item) files.append(item) + files = list(set(files) - set(self.ignores)) # We check if there is file in the checksum to do if files: # if files are found there we try to be sure our modlist is sane @@ -231,3 +236,7 @@ class APT(Bcfg2.Client.Tools.Tool): states[package] = self.VerifyPackage(package, [], checksums=False) if states[package]: self.modified.append(package) + + def VerifyPath(self, entry, _): + """Do nothing here since we only verify Path type=ignore""" + return True |