diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-20 21:27:56 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-11-20 21:56:37 +0100 |
commit | 4ef7331c2fb8073b2eeba90af1a427bd1f3c811a (patch) | |
tree | 0dc387098d0dcc9b92a56cf738e58552b4ba2426 | |
parent | 153133c08fb00deba3ef0800060153a54fb949ab (diff) | |
download | gemato-4ef7331c2fb8073b2eeba90af1a427bd1f3c811a.tar.gz |
recursiveloader: Fix adding top-level ignore entries to sub-Manifests
-rw-r--r-- | gemato/recursiveloader.py | 11 | ||||
-rw-r--r-- | tests/test_profile.py | 13 |
2 files changed, 19 insertions, 5 deletions
diff --git a/gemato/recursiveloader.py b/gemato/recursiveloader.py index 270b6ce..262552f 100644 --- a/gemato/recursiveloader.py +++ b/gemato/recursiveloader.py @@ -148,11 +148,12 @@ class ManifestRecursiveLoader(object): # trigger saving self.updated_manifests.add(relpath) - # add initial IGNORE entries - for ip in (self.profile - .get_ignore_paths_for_new_manifest('')): - ie = gemato.manifest.ManifestEntryIGNORE(ip) - m.entries.append(ie) + # add initial IGNORE entries to top-level Manifest + if relpath == 'Manifest': + for ip in (self.profile + .get_ignore_paths_for_new_manifest('')): + ie = gemato.manifest.ManifestEntryIGNORE(ip) + m.entries.append(ie) else: raise err diff --git a/tests/test_profile.py b/tests/test_profile.py index bf4156f..a19b269 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -138,6 +138,19 @@ class EbuildRepositoryTests(TempDirTestCase): "type mismatch for {}".format(f)) return m + def test_regression_top_level_ignore_in_all_manifests(self): + assert 'distfiles' in self.EXPECTED_IGNORE[0] + assert 'dev-foo/Manifest' in self.EXPECTED_MANIFESTS + + m = gemato.recursiveloader.ManifestRecursiveLoader( + os.path.join(self.dir, 'Manifest'), + hashes=['SHA256', 'SHA512'], + allow_create=True, + profile=self.PROFILE()) + m.update_entries_for_directory('') + + self.assertIsNone(m.find_path_entry('dev-foo/distfiles')) + def test_set_loader_options(self): m = gemato.recursiveloader.ManifestRecursiveLoader( os.path.join(self.dir, 'Manifest'), |