summaryrefslogtreecommitdiff
path: root/indra/lib/python
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-27 02:51:33 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-27 02:51:33 +0300
commit3da7a50b71d4ef5919c2d4d5b9547b3ef0abab7d (patch)
treec51119f79b734a7d503bb3adeac1759b819c8f92 /indra/lib/python
parent3c215ee885f846f4ab4923c03b51f1b2203394af (diff)
parentcdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff)
Merge branch 'master' into DRTVWR-543-maint
# Conflicts: # autobuild.xml # indra/cmake/LLCommon.cmake # indra/llcommon/CMakeLists.txt # indra/llrender/llgl.cpp # indra/newview/llappviewer.cpp # indra/newview/llface.cpp # indra/newview/llflexibleobject.cpp # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/lib/python')
-rwxr-xr-xindra/lib/python/indra/util/llmanifest.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index c1c199a438..5b277846b7 100755
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -880,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()