diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/lib/python | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to 'linden/indra/lib/python')
-rw-r--r-- | linden/indra/lib/python/indra/llmanifest.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/linden/indra/lib/python/indra/llmanifest.py b/linden/indra/lib/python/indra/llmanifest.py index 6697299..c49e39a 100644 --- a/linden/indra/lib/python/indra/llmanifest.py +++ b/linden/indra/lib/python/indra/llmanifest.py | |||
@@ -5,6 +5,7 @@ | |||
5 | # | 5 | # |
6 | # Copyright (c) 2006-2007, Linden Research, Inc. | 6 | # Copyright (c) 2006-2007, Linden Research, Inc. |
7 | # | 7 | # |
8 | # Second Life Viewer Source Code | ||
8 | # The source code in this file ("Source Code") is provided by Linden Lab | 9 | # The source code in this file ("Source Code") is provided by Linden Lab |
9 | # to you under the terms of the GNU General Public License, version 2.0 | 10 | # to you under the terms of the GNU General Public License, version 2.0 |
10 | # ("GPL"), unless you have obtained a separate licensing agreement | 11 | # ("GPL"), unless you have obtained a separate licensing agreement |
@@ -150,15 +151,15 @@ def main(argv=None, srctree='.', dsttree='./dst'): | |||
150 | if(argv == None): | 151 | if(argv == None): |
151 | argv = sys.argv | 152 | argv = sys.argv |
152 | 153 | ||
153 | print "Source tree:", srctree | ||
154 | print "Destination tree:", dsttree | ||
155 | |||
156 | option_names = [arg['name'] + '=' for arg in ARGUMENTS] | 154 | option_names = [arg['name'] + '=' for arg in ARGUMENTS] |
157 | option_names.append('help') | 155 | option_names.append('help') |
158 | options, remainder = getopt.getopt(argv[1:], "", option_names) | 156 | options, remainder = getopt.getopt(argv[1:], "", option_names) |
159 | if len(remainder) >= 1: | 157 | if len(remainder) >= 1: |
160 | dsttree = remainder[0] | 158 | dsttree = remainder[0] |
161 | 159 | ||
160 | print "Source tree:", srctree | ||
161 | print "Destination tree:", dsttree | ||
162 | |||
162 | # convert options to a hash | 163 | # convert options to a hash |
163 | args = {} | 164 | args = {} |
164 | for opt in options: | 165 | for opt in options: |
@@ -323,7 +324,7 @@ class LLManifest(object): | |||
323 | 324 | ||
324 | def put_in_file(self, contents, dst): | 325 | def put_in_file(self, contents, dst): |
325 | # write contents as dst | 326 | # write contents as dst |
326 | f = open(self.dst_path_of(dst), "wbU") | 327 | f = open(self.dst_path_of(dst), "wb") |
327 | f.write(contents) | 328 | f.write(contents) |
328 | f.close() | 329 | f.close() |
329 | 330 | ||
@@ -480,6 +481,11 @@ class LLManifest(object): | |||
480 | for f in list: | 481 | for f in list: |
481 | if(os.path.exists(f)): | 482 | if(os.path.exists(f)): |
482 | return f | 483 | return f |
484 | # didn't find it, return last item in list | ||
485 | if len(list) > 0: | ||
486 | return list[-1] | ||
487 | else: | ||
488 | return None | ||
483 | 489 | ||
484 | def contents_of_tar(self, src_tar, dst_dir): | 490 | def contents_of_tar(self, src_tar, dst_dir): |
485 | """ Extracts the contents of the tarfile (specified | 491 | """ Extracts the contents of the tarfile (specified |
@@ -509,7 +515,8 @@ class LLManifest(object): | |||
509 | 515 | ||
510 | def check_file_exists(self, path): | 516 | def check_file_exists(self, path): |
511 | if(not os.path.exists(path) and not os.path.islink(path)): | 517 | if(not os.path.exists(path) and not os.path.islink(path)): |
512 | raise RuntimeError, "Path " + path + " doesn't exist" | 518 | raise RuntimeError("Path %s doesn't exist" % ( |
519 | os.path.normpath(os.path.join(os.getcwd(), path)),)) | ||
513 | 520 | ||
514 | 521 | ||
515 | wildcard_pattern = re.compile('\*') | 522 | wildcard_pattern = re.compile('\*') |
@@ -530,6 +537,8 @@ class LLManifest(object): | |||
530 | 537 | ||
531 | def path(self, src, dst=None): | 538 | def path(self, src, dst=None): |
532 | print "Processing", src, "=>", dst | 539 | print "Processing", src, "=>", dst |
540 | if src == None: | ||
541 | raise RuntimeError("No source file, dst is " + dst) | ||
533 | if dst == None: | 542 | if dst == None: |
534 | dst = src | 543 | dst = src |
535 | dst = os.path.join(self.get_dst_prefix(), dst) | 544 | dst = os.path.join(self.get_dst_prefix(), dst) |