summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorTim Schumacher2018-07-28 16:29:34 +0200
committerTim Schumacher2018-07-28 16:29:34 +0200
commit7f4a3e900c03e8af0ed519c16fc4349ef60a2e2d (patch)
tree8349e0440652be29f4844be077737385524b3a6d /PKGBUILD
parentcb2604ceabd3ec422c492aded9c5e6019cce518b (diff)
downloadaur-7f4a3e900c03e8af0ed519c16fc4349ef60a2e2d.tar.gz
Automatically search for the GZip archive
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD11
1 files changed, 9 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e23a7504ba3f..5f5c8ae3a528 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -25,9 +25,16 @@ sha256sums=('0585fd5752e2c15ad42602838d216b35a7c628969b3a7e9fca5c9e944302ee5a'
'ba4e21c675ce7f49e6df27df1f29d1bb99c47679c4981657a2a4cf5d59930b4a')
prepare() {
- tail -n +224 gitahead-${pkgver}.bin > gitahead-${pkgver}.tar.gz # if you update, check if it is still line 224
+ gzip_offset=$(grep -baoU -m 1 "$(printf '\x1f\x8b')" gitahead-${pkgver}.bin | awk '{print $1}' FS=':')
+
+ if [ -z "${gzip_offset}" ]; then
+ echo "error: No GZip header found"
+ return 1
+ fi
+
+ dd if=gitahead-${pkgver}.bin of=gitahead-${pkgver}.tar.gz iflag=skip_bytes skip=${gzip_offset} 2> /dev/null
mkdir -p gitahead-${pkgver}
- bsdtar xvf gitahead-${pkgver}.tar.gz -C gitahead-${pkgver}
+ bsdtar xf gitahead-${pkgver}.tar.gz -C gitahead-${pkgver}
}
package() {