summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-08-17 09:17:07 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-08-17 09:17:07 -0500
commitd3aa0c11d66ec50ce18bada80bbf2e6beba32a93 (patch)
treea489e2a93916b7a6f09f970d4296f1a055c7cf92
parent58efdb361c20a1094a6b44c7847adcfd768c8f75 (diff)
downloadbcfg2-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>
-rw-r--r--doc/server/configurationentries.txt2
-rw-r--r--src/lib/Client/Tools/APT.py13
2 files changed, 12 insertions, 3 deletions
diff --git a/doc/server/configurationentries.txt b/doc/server/configurationentries.txt
index 35200da37..fbce092b9 100644
--- a/doc/server/configurationentries.txt
+++ b/doc/server/configurationentries.txt
@@ -101,7 +101,7 @@ Path type specified.
| | | failures | |
| | | (currently | |
| | | applies to only | |
-| | | YUMng) | |
+| | | APT and YUMng) | |
+-------------+----------------------+-----------------+--------------------------+
| nonexistent | New | Specify a path | name, recursive |
| | | that should not | |
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