Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore versions if .ignore file exists #453

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/rezplugins/package_repository/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ class FileSystemPackageRepository(PackageRepository):
"package_filenames": [basestring]}

building_prefix = ".building"
ignore_prefix = ".ignore"

@classmethod
def name(cls):
Expand Down Expand Up @@ -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<version> 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

Expand All @@ -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<version> 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
Expand Down