rpathsync / conary-policy
Pluggable policies for conary (http://wiki.rpath.com/wiki/Conary)
$ hg clone http://bitbucket.org/rpathsync/conary-policy/
| commit 272: | b7366edb515d |
| parent 271: | 66dd27e5da8a |
| branch: | default |
4 months ago
Changed (Δ70 bytes):
policy/eggrequires.py (2 lines added, 2 lines removed)
policy/httpdconf.py (2 lines added, 2 lines removed)
policy/phprequires.py (2 lines added, 2 lines removed)
policy/pkgconfig.py (3 lines added, 3 lines removed)
policy/symlinks.py (3 lines added, 3 lines removed)
policy/xinetd.py (2 lines added, 2 lines removed)
Up to file-list policy/eggrequires.py:
| … | … | @@ -115,7 +115,7 @@ class EggRequires(_basePluggableRequires |
115 |
115 |
optionalReqs = [x for x in allReqs if x not in mandatoryReqs] |
116 |
116 |
return mandatoryReqs, optionalReqs |
117 |
117 |
|
118 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
118 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
119 |
119 |
mandatoryReqs, optionalReqs = self._parseEggRequires(path, fullpath) |
120 |
120 |
filesRequired = [] |
121 |
121 |
for req in itertools.chain(mandatoryReqs, optionalReqs): |
| … | … | @@ -152,5 +152,5 @@ class EggRequires(_basePluggableRequires |
152 |
152 |
fileType='egg-info', |
153 |
153 |
unmanagedError=True) |
154 |
154 |
if troveName: |
155 |
self._addRequirement(path, troveName, [], pkg |
|
155 |
self._addRequirement(path, troveName, [], pkgFiles, |
|
156 |
156 |
deps.TroveDependencies) |
Up to file-list policy/httpdconf.py:
| … | … | @@ -70,7 +70,7 @@ class HttpdConfigRequires(_basePluggable |
70 |
70 |
|
71 |
71 |
invariantinclusions = [ r'%(sysconfdir)s/httpd/conf.d/.*\.conf' ] |
72 |
72 |
|
73 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
73 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
74 |
74 |
# test stripped lines to ignore all leading and trailing whitespace |
75 |
75 |
# so that indented comments and lines with only whitespace are |
76 |
76 |
# not counted as having configuration information in them |
| … | … | @@ -80,5 +80,5 @@ class HttpdConfigRequires(_basePluggable |
80 |
80 |
# All lines are blank or commented |
81 |
81 |
return |
82 |
82 |
|
83 |
self._addRequirement(path, "/usr/sbin/httpd", [], pkg |
|
83 |
self._addRequirement(path, "/usr/sbin/httpd", [], pkgFiles, |
|
84 |
84 |
deps.FileDependencies) |
Up to file-list policy/phprequires.py:
| … | … | @@ -157,7 +157,7 @@ class PHPRequires(_basePluggableRequires |
157 |
157 |
(path, "', '".join(phpPkgList))) |
158 |
158 |
return False |
159 |
159 |
|
160 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
160 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
161 |
161 |
if not self._isPHPFile(fullpath): |
162 |
162 |
return |
163 |
163 |
if self.repos is None: |
| … | … | @@ -186,7 +186,7 @@ class PHPRequires(_basePluggableRequires |
186 |
186 |
if self.phpTrove: |
187 |
187 |
self.info('Adding dependency on %s for file %s', |
188 |
188 |
self.phpTrove, path) |
189 |
self._addRequirement(path, self.phpTrove, [], pkg |
|
189 |
self._addRequirement(path, self.phpTrove, [], pkgFiles, |
|
190 |
190 |
deps.TroveDependencies) |
191 |
191 |
else: |
192 |
192 |
self.phpTrove = False |
Up to file-list policy/pkgconfig.py:
| … | … | @@ -117,7 +117,7 @@ class PkgConfigRequires(_basePluggableRe |
117 |
117 |
|
118 |
118 |
invariantinclusions = [ r'(%(libdir)s|%(datadir)s)/pkgconfig/.*\.pc$' ] |
119 |
119 |
|
120 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
120 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
121 |
121 |
if hasattr(self.recipe, '_getCapsulePathsForFile'): |
122 |
122 |
if self.recipe._getCapsulePathsForFile(path): |
123 |
123 |
# since capsules do not convert to relative symlinks, |
| … | … | @@ -235,12 +235,12 @@ class PkgConfigRequires(_basePluggableRe |
235 |
235 |
# found a non-empty :devel compoment |
236 |
236 |
troveName = develTroveName |
237 |
237 |
break |
238 |
self._addRequirement(path, troveName, [], pkg |
|
238 |
self._addRequirement(path, troveName, [], pkgFiles, |
|
239 |
239 |
deps.TroveDependencies) |
240 |
240 |
else: |
241 |
241 |
troveName = self._enforceProvidedPath(fileRequired, |
242 |
242 |
fileType=fileType, |
243 |
243 |
unmanagedError=True) |
244 |
244 |
if troveName: |
245 |
self._addRequirement(path, troveName, [], pkg |
|
245 |
self._addRequirement(path, troveName, [], pkgFiles, |
|
246 |
246 |
deps.TroveDependencies) |
Up to file-list policy/symlinks.py:
| … | … | @@ -120,7 +120,7 @@ class SymlinkTargetRequires(_basePluggab |
120 |
120 |
self.db = database.Database(self.recipe.cfg.root, |
121 |
121 |
self.recipe.cfg.dbPath) |
122 |
122 |
|
123 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
123 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
124 |
124 |
d = macros.destdir |
125 |
125 |
f = util.joinPaths(d, path) |
126 |
126 |
if not os.path.islink(f): |
| … | … | @@ -152,14 +152,14 @@ class SymlinkTargetRequires(_basePluggab |
152 |
152 |
|
153 |
153 |
provides = trv.getProvides() |
154 |
154 |
if provides.satisfies(fileDep): |
155 |
self._addRequirement(path, contents, [], pkg |
|
155 |
self._addRequirement(path, contents, [], pkgFiles, |
|
156 |
156 |
deps.FileDependencies) |
157 |
157 |
self.recipe.DanglingSymlinks(exceptions = re.escape(path), |
158 |
158 |
allowUnusedFilters = True) |
159 |
159 |
if trv.getName() not in self.recipe.buildRequires: |
160 |
160 |
self.recipe.reportMissingBuildRequires(trv.getName()) |
161 |
161 |
elif provides.satisfies(troveDep): |
162 |
self._addRequirement(path, trv.getName(), [], pkg |
|
162 |
self._addRequirement(path, trv.getName(), [], pkgFiles, |
|
163 |
163 |
deps.TroveDependencies) |
164 |
164 |
# warn that a file dep would be better, but we'll settle for a |
165 |
165 |
# dep on the trove that contains the file |
Up to file-list policy/xinetd.py:
| … | … | @@ -66,7 +66,7 @@ class XinetdConfigRequires(_basePluggabl |
66 |
66 |
|
67 |
67 |
invariantinclusions = [ r'%(sysconfdir)s/xinetd.d/' ] |
68 |
68 |
|
69 |
def addPluggableRequirements(self, path, fullpath, pkg |
|
69 |
def addPluggableRequirements(self, path, fullpath, pkgFiles, macros): |
|
70 |
70 |
|
71 |
71 |
# parse file |
72 |
72 |
fContents = [x.strip() for x in file(fullpath).readlines()] |
| … | … | @@ -86,5 +86,5 @@ class XinetdConfigRequires(_basePluggabl |
86 |
86 |
|
87 |
87 |
if not enabled: |
88 |
88 |
return |
89 |
self._addRequirement(path, "xinetd:runtime", [], pkg |
|
89 |
self._addRequirement(path, "xinetd:runtime", [], pkgFiles, |
|
90 |
90 |
deps.TroveDependencies) |
