From df8ca4fc587f9416aa8544a755cd6e9a66b4a573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miko=C5=82ajczyk?= Date: Mon, 22 Sep 2014 10:22:57 +0200 Subject: [PATCH] fix for situation, where the package tar filename is different from the actual package name (ie. chromium-pepper-flash != chromium-plugins.tar.gz) Signed-off-by: Philip --- pamac/aur.py | 10 +++++++++- pamac/transaction.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pamac/aur.py b/pamac/aur.py index cf48304..b22b6a1 100644 --- a/pamac/aur.py +++ b/pamac/aur.py @@ -210,4 +210,12 @@ def get_extract_tarball(pkg): print(e) return None else: - return os.path.join(srcpkgdir, pkg.name) + return os.path.join(srcpkgdir, get_name(pkg)) + +def get_name(pkg): + # the splitext is to remove the original extension + # which is tar.foo - currently foo is gz, but this can change + # the rstrip is to remove the trailing tar part. + if pkg.name not in pkg.tarpath: + return os.path.splitext(os.path.basename(pkg.tarpath))[0].rstrip('.tar') + return pkg.name diff --git a/pamac/transaction.py b/pamac/transaction.py index 7ff89a9..fad2548 100644 --- a/pamac/transaction.py +++ b/pamac/transaction.py @@ -640,7 +640,7 @@ def download(url_list, path): def build_next(): global build_proc pkg = to_build[0] - path = os.path.join(aur.srcpkgdir, pkg.name) + path = os.path.join(aur.srcpkgdir, aur.get_name(pkg)) new_pkgs = aur.get_pkgs(path + '/PKGBUILD') # sources are identicals for splitted packages # (not complete) download(new_pkgs[0].source, path)