diff options
author | Kitty Barnett <develop@catznip.com> | 2023-01-02 23:04:02 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2023-01-02 23:04:42 +0100 |
commit | 6850b915fe42f5a75fc9d8bb9ca05f961de3244a (patch) | |
tree | 0921b5e0c74a64ad65d1b5702b00142badb6140c /indra/lib | |
parent | 89456ec88df01565e2c9a424a0097a5a02e1838c (diff) | |
parent | f3f3c493ec2a658cf5c1aac6670c54c550e944fd (diff) |
Merge branch 'master' into texture-preview
Diffstat (limited to 'indra/lib')
-rwxr-xr-x | indra/lib/python/indra/util/llmanifest.py | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 30b7228289..5b277846b7 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -83,8 +83,7 @@ def proper_windows_path(path, current_platform = sys.platform): return drive_letter.upper() + ':\\' + rel.replace('/', '\\') def get_default_platform(dummy): - return {'linux2':'linux', - 'linux1':'linux', + return {'linux':'linux', 'cygwin':'windows', 'win32':'windows', 'darwin':'darwin' @@ -881,6 +880,49 @@ class LLManifest(object, metaclass=LLManifestRegistry): # particular, let caller notice 0. return count + def path_optional(self, src, dst=None): + sys.stdout.flush() + if src == None: + raise ManifestError("No source file, dst is " + dst) + if dst == None: + dst = src + dst = os.path.join(self.get_dst_prefix(), dst) + sys.stdout.write("Processing %s => %s ... " % (src, self._relative_dst_path(dst))) + + def try_path(src): + # expand globs + count = 0 + if self.wildcard_pattern.search(src): + for s,d in self.expand_globs(src, dst): + assert(s != d) + count += self.process_file(s, d) + else: + # if we're specifying a single path (not a glob), + # we should error out if it doesn't exist + self.check_file_exists(src) + count += self.process_either(src, dst) + return count + + try_prefixes = [self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix()] + for pfx in try_prefixes: + try: + count = try_path(os.path.join(pfx, src)) + except MissingError: + # if we produce MissingError, just try the next prefix + continue + # If we actually found nonzero files, stop looking + if count: + break + else: + sys.stdout.write("Skipping %s\n" % (src)) + return 0 + + print("%d files" % count) + + # Let caller check whether we processed as many files as expected. In + # particular, let caller notice 0. + return count + def do(self, *actions): self.actions = actions self.construct() |