From a32d663e2cab44c3d071992273ed5ebe871911f4 Mon Sep 17 00:00:00 2001 From: wg01018 Date: Mon, 9 Oct 2017 15:06:05 +0200 Subject: [PATCH] Support importing libraries that have .tgz as extension --- .../python/importer/distribution/SourceDistPackage.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy b/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy index 99de133a..2209cddd 100644 --- a/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy +++ b/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy @@ -151,7 +151,7 @@ class SourceDistPackage { } private String getRequiresTextFile() { - if (packageFile.absolutePath.contains('.tar.')) { + if (packageFile.absolutePath.contains('.tar.') || packageFile.absolutePath.endsWith('.tgz')) { return explodeTarForRequiresText() } else { return explodeZipForRequiresText() @@ -167,7 +167,6 @@ class SourceDistPackage { return '' } - private String explodeTarForRequiresText() { TarArchiveInputStream tarIn = explodeArtifact() @@ -191,7 +190,7 @@ class SourceDistPackage { BufferedInputStream inputStream = new BufferedInputStream(fin) InputStream compressorInputStream - if (packageFile.absolutePath.endsWith('.gz')) { + if (packageFile.absolutePath.endsWith('.gz') || packageFile.absolutePath.endsWith('.tgz')) { compressorInputStream = new GzipCompressorInputStream(inputStream) } else if (packageFile.absolutePath.endsWith('.bz2')) { compressorInputStream = new BZip2CompressorInputStream(inputStream)