| | |
| | | #!/usr/bin/python3.5 |
| | | #!/usr/bin/python3.9 |
| | | # |
| | | # CDDL HEADER START |
| | | # |
| | |
| | | elif (re.search("(\.Z)$", filename) != None): |
| | | uncompress = "/usr/bin/uncompress -c" |
| | | elif (re.search("(\.7z)$", filename) != None): |
| | | uncompress = "/usr/bin/7z --s" |
| | | uncompress = "/usr/bin/7z x" |
| | | elif (re.search("(\.lz)$", filename) != None): |
| | | uncompress = "/usr/bin/lzip -dc" |
| | | elif (re.search("(\.xz)$", filename) != None): |
| | |
| | | ruby_ver = os.getenv('RUBY_VERSION', '') |
| | | uncompress = "/usr/ruby/" + ruby_ver + "/bin/gem unpack" |
| | | |
| | | unpack = " | gtar -xf -" |
| | | # if the file is just compressed, redirect stdout to ./filename with |
| | | # one less extension. |
| | | unpack = " > ./" + '.'.join(os.path.basename(filename).split('.')[:-1]) |
| | | |
| | | if (re.search("(\.zip)$", filename) != None): |
| | | if (re.search("(\.tar\.[^\.]+|\.tgz|\.txz|\.tbz2?)$",filename) != None): |
| | | unpack = " | gtar -xf -" |
| | | elif (re.search("(\.zip)$", filename) != None): |
| | | unpack = "" |
| | | elif (re.search("(\.oxt)$", filename) != None): |
| | | unpack = "" |
| | |
| | | unpack = "" |
| | | |
| | | if (verbose == True): |
| | | print("command: %s %s %s" % (uncompress, filename, unpack)) |
| | | print("command: %s %s%s" % (uncompress, filename, unpack)) |
| | | |
| | | return uncompress, unpack |
| | | |
| | |
| | | permissions = None |
| | | relocate_to = None |
| | | |
| | | if len(sys.argv) == 1: |
| | | usage() |
| | | |
| | | try: |
| | | opts, args = getopt.getopt(sys.argv[1:], "fr:v", |
| | | ["fix-permissions", "relocate-to=", "verbose"]) |