summary refs log tree commit diff
path: root/build-template
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-01-31 15:59:31 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-01-31 15:59:31 +0100
commit8b4c9aad73a0ec3bcf2bc2c66a356fc829a487ec (patch)
tree3dcd6061810fe0298cc9913f5b93f0df142f1eab /build-template
parent289055301db8c7bf26eaf47228e0747c69623bfd (diff)
downloadmewix-8b4c9aad73a0ec3bcf2bc2c66a356fc829a487ec.tar.gz
mewix-8b4c9aad73a0ec3bcf2bc2c66a356fc829a487ec.tar.xz
mewix-8b4c9aad73a0ec3bcf2bc2c66a356fc829a487ec.zip
add package categories, defaulting to a/
Diffstat (limited to 'build-template')
-rwxr-xr-xbuild-template16
1 files changed, 13 insertions, 3 deletions
diff --git a/build-template b/build-template
index 5fe652c..7d51a3a 100755
--- a/build-template
+++ b/build-template
@@ -3,11 +3,21 @@
 rm -rf dst
 mkdir dst
 
-cat lib1.sh $1 lib2.sh | ./enter-newroot
+x=$1
+pkgname=${x##*/}
+x=${x%/*}
+pkgcat=${x##*/}
 
-for d in dst/*/*; do
+{
+  echo "export pkgname=$pkgname pkgcat=$pkgcat;"
+  cat lib1.sh $1 lib2.sh
+} | ./enter-newroot
+
+for d in dst/$pkgcat/$pkgname/*; do
   [ -d "$d" ] || continue
 
-  tar czvf pkg/$( echo "$d" | sed 's/^dst\///; s:/:@:g' ).tar.xz -C $d . --sort=name --mtime="@0" --owner=0 --group=0 --numeric-owner
+  mkdir -p pkg/$pkgcat
+  tar czvf pkg/$pkgcat/$pkgname@${d##*/}.tar.xz -C dst $pkgcat/$pkgname \
+    --sort=name --mtime="@0" --owner=0 --group=0 --numeric-owner
   echo $d
 done