| 1 | Index: haikuporter |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- haikuporter (revision 1221) |
|---|
| 4 | +++ haikuporter (working copy) |
|---|
| 5 | @@ -24,7 +24,7 @@ |
|---|
| 6 | import hashlib |
|---|
| 7 | import shutil |
|---|
| 8 | import commands |
|---|
| 9 | -from subprocess import check_call |
|---|
| 10 | +from subprocess import check_call, Popen |
|---|
| 11 | from optparse import OptionParser |
|---|
| 12 | |
|---|
| 13 | # -- HaikuPorts options ------------------------------------------------------- |
|---|
| 14 | @@ -684,6 +684,14 @@ |
|---|
| 15 | zf = zipfile.ZipFile(self.downloadDir + "/" + self.src_local, 'r') |
|---|
| 16 | zf.extractall(self.workDir) |
|---|
| 17 | zf.close() |
|---|
| 18 | + elif archiveFullPath.split("/")[-1].split(".")[-1] is "xz": |
|---|
| 19 | + Popen(['xz', '-d', archiveFullPath]) |
|---|
| 20 | + tar_unstruct = self.src_local.split(".")[:-1] |
|---|
| 21 | + tar = tar_unstruct[0] + "." + tar_unstruct[1] |
|---|
| 22 | + if tarfile.is_tarfile(tar): |
|---|
| 23 | + tf = tarfile.open(self.downloadDir + "/" + tar, 'r') |
|---|
| 24 | + tf.extractall(self.workDir) |
|---|
| 25 | + tf.close() |
|---|
| 26 | else: |
|---|
| 27 | sys.exit("Error: Unrecognized archive type.") |
|---|
| 28 | |
|---|