diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-06-02 19:31:47 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-06-12 07:56:05 -0700 |
commit | f1b7557d23c601a86a03cd5eee4feb4072a3b8b2 (patch) | |
tree | ae21395ce9b8a9aa9cf339629acc3ed123c97d65 /convert-to-any | |
parent | 548a96ef75cd18f3645909031eda062de4546888 (diff) |
compute compression option from file extension
bsdtar does not detect the compression type from the file extension.
So we need to set the right option on our own.
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'convert-to-any')
-rwxr-xr-x | convert-to-any | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/convert-to-any b/convert-to-any index 862c60b..2ad1521 100755 --- a/convert-to-any +++ b/convert-to-any @@ -62,7 +62,13 @@ fi sed -i "s/arch = \(i686\|x86_64\)/arch = any/g" package/.PKGINFO pushd package >/dev/null -fakeroot bsdtar cf "$OUTDIR/$newpkgname" .PKGINFO * +case "$newpkgname" in + *tar.gz) TAR_OPT="z" ;; + *tar.bz2) TAR_OPT="j" ;; + *tar.xz) TAR_OPT="J" ;; + *) die "$newpkgname does not have a valid archive extension." ;; +esac +fakeroot bsdtar c${TAR_OPT}f "$OUTDIR/$newpkgname" .PKGINFO * popd >/dev/null popd >/dev/null |