diff options
author | Petteri Räty <betelgeuse@gentoo.org> | 2008-04-25 00:31:41 +0000 |
---|---|---|
committer | Petteri Räty <betelgeuse@gentoo.org> | 2008-04-25 00:31:41 +0000 |
commit | 7f65de07e885b11b86cdaea3760336480eefed9e (patch) | |
tree | ecdcf1e423fdbb9203ebbb1c35f139c8a5cab68e | |
parent | Increase version number to 2.1.5 and add data to MANIFEST.in. (diff) | |
download | java-config-7f65de07e885b11b86cdaea3760336480eefed9e.tar.gz java-config-7f65de07e885b11b86cdaea3760336480eefed9e.tar.bz2 java-config-7f65de07e885b11b86cdaea3760336480eefed9e.zip |
Fix provides not to return True when a VM does not have a PROVIDES entry at all.
svn path=/projects/java-config-2/trunk/; revision=6209
-rw-r--r-- | src/java_config_2/VM.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/java_config_2/VM.py b/src/java_config_2/VM.py index 3f7605d..42c2a0f 100644 --- a/src/java_config_2/VM.py +++ b/src/java_config_2/VM.py @@ -87,11 +87,19 @@ class VM: return [] def provides(self, virtuals): + if self.config.has_key('PROVIDES'): + vp = self.config['PROVIDES'].split(' ') + else: + return False + + found = 0 + for virtual in virtuals: - if self.config.has_key('PROVIDES'): - vp = self.config['PROVIDES'].split(' ') - if virtual not in vp: - return False - return True + if virtual in vp: + found += 1 + else: + return False + + return found == len(virtuals) # vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap: |