summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Fontenelle2022-08-05 22:34:57 -0300
committerRafael Fontenelle2022-08-05 22:34:57 -0300
commit3927b3633bfca88d0d3f878dc7ca2818beb63788 (patch)
treef94157d5be80855efc8d569d148004306127faf6
parentae6094a5dcd7b480cb58aa7aa093422b3efa66b4 (diff)
downloadaur-3927b3633bfca88d0d3f878dc7ca2818beb63788.tar.gz
Fix and simplify getsizes.sh
-rwxr-xr-xgetsizes.sh31
1 files changed, 15 insertions, 16 deletions
diff --git a/getsizes.sh b/getsizes.sh
index 085688039b5..ff728f04da7 100755
--- a/getsizes.sh
+++ b/getsizes.sh
@@ -1,24 +1,23 @@
-#!/bin/bash
+#!/bin/bash -e
# Get sizes of ddnet-maps-git package file, and repository and types dirs
# This should be ran only after a successful build
-test -f PKGBUILD && source PKGBUILD || exit 1
-test -d src/$_name || exit 1
-test -d pkg/$pkgname/usr/share/ddnet/data/types/ || exit 1
+source /etc/makepkg.conf
+source PKGBUILD
+test -d src/${pkgname%%-git}
+test -d pkg/$pkgname/usr/share/ddnet/data/types/
-
-BLK=" "
-echo -e "${BLK} Sizes as of $pkgver\n "
-
-echo -e "${BLK} Source code repository:"
-echo -e "${BLK} $(du -sh src/$_name | cut -d' ' -f1)\n "
-
-echo -e "${BLK} Package:"
-echo -e "${BLK} $(du -shD $pkgname-$pkgver-$pkgrel-$arch.pkg.tar)\n "
+echo "Sizes as of $pkgver"
+echo
+echo "Source code repository:"
+echo " $(du -sh src/${pkgname%%-git} | cut -d' ' -f1)"
+echo
+echo "Package:"
+echo " $(du -shD $pkgname-$pkgver-$pkgrel-$arch${PKGEXT})"
+echo
+echo "Server types packaged:"
cd pkg/$pkgname
-echo -e "${BLK} Server types packaged:"
for type in $(ls usr/share/ddnet/data/types/); do
- echo -e "${BLK} $(du -sh usr/share/ddnet/data/types/$type)"
+ echo " $(du -sh usr/share/ddnet/data/types/$type)"
done
-