From c16c7d9e1c3a5d22ea11c7e055eea9933e63d393 Mon Sep 17 00:00:00 2001 From: Sebastian Kral Date: Tue, 29 Aug 2017 19:25:19 -0400 Subject: [PATCH] Ignore versions if .ignore file exists --- src/rezplugins/package_repository/filesystem.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rezplugins/package_repository/filesystem.py b/src/rezplugins/package_repository/filesystem.py index 564bbfbd8..2dba35a45 100644 --- a/src/rezplugins/package_repository/filesystem.py +++ b/src/rezplugins/package_repository/filesystem.py @@ -432,6 +432,7 @@ class FileSystemPackageRepository(PackageRepository): "package_filenames": [basestring]} building_prefix = ".building" + ignore_prefix = ".ignore" @classmethod def name(cls): @@ -629,7 +630,9 @@ def _get_version_dirs(self, root): continue path = os.path.join(root, name) - if os.path.isdir(path): + # Ignore a version if there is a .ignore file next to it + ignore_path = os.path.join(root, self.ignore_prefix + name) + if os.path.isdir(path) and not os.path.isfile(ignore_path): if not self._is_valid_package_directory(path): continue @@ -653,7 +656,9 @@ def _get_version_dirs(self, root): building_dirs.add(ver_str) path = os.path.join(root, name) - if os.path.isdir(path): + # Ignore a version if there is a .ignore file next to it + ignore_path = os.path.join(root, self.ignore_prefix + name) + if os.path.isdir(path) and not os.path.isfile(ignore_path): dirs.add(name) # check 'building' dirs for validity