17 # fields enclosed by brackets "[]" replaced with your own identifying |
17 # fields enclosed by brackets "[]" replaced with your own identifying |
18 # information: Portions Copyright [yyyy] [name of copyright owner] |
18 # information: Portions Copyright [yyyy] [name of copyright owner] |
19 # |
19 # |
20 # CDDL HEADER END |
20 # CDDL HEADER END |
21 # |
21 # |
22 # Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved. |
22 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. |
23 # |
23 # |
24 # |
24 # |
25 # unpack.py - an archive unpack utility |
25 # unpack.py - an archive unpack utility |
26 # |
26 # |
27 # A simple program to uncompress and unpack source archive files into a target |
27 # A simple program to uncompress and unpack source archive files into a target |
46 uncompress = "/usr/bin/7z --s" |
46 uncompress = "/usr/bin/7z --s" |
47 elif (re.search("(\.xz)$", filename) != None): |
47 elif (re.search("(\.xz)$", filename) != None): |
48 uncompress = "/usr/bin/xz -dc" |
48 uncompress = "/usr/bin/xz -dc" |
49 elif (re.search("(\.zip)$", filename) != None): |
49 elif (re.search("(\.zip)$", filename) != None): |
50 uncompress = "/usr/bin/unzip -qo" |
50 uncompress = "/usr/bin/unzip -qo" |
|
51 elif (re.search("(\.gem)$", filename) != None): |
|
52 uncompress = "/usr/bin/gem unpack" |
51 |
53 |
52 unpack = " | gtar -xf -" |
54 unpack = " | gtar -xf -" |
53 |
55 |
54 if (re.search("(\.zip)$", filename) != None): |
56 if (re.search("(\.zip)$", filename) != None): |
55 unpack = "" |
57 unpack = "" |
56 elif (re.search("(\.jar)$", filename) != None): |
58 elif (re.search("(\.jar)$", filename) != None): |
57 unpack = " | jar xf -" |
59 unpack = " | jar xf -" |
|
60 elif (re.search("(\.gem)$", filename) != None): |
|
61 unpack = "" |
58 |
62 |
59 if (verbose == True): |
63 if (verbose == True): |
60 print "command: %s %s %s" % (uncompress, filename, unpack) |
64 print "command: %s %s %s" % (uncompress, filename, unpack) |
61 |
65 |
62 return uncompress, unpack |
66 return uncompress, unpack |