Welcome to little lamb

Code » comain » commit a230f20

mktarball: Some little fixes/tweaks

author Olivier Brunel
2023-01-25 13:52:15 UTC
committer Olivier Brunel
2023-01-25 13:52:15 UTC
parent 29d6248ceb46630e5bf3322440e2d19d0a344a27

mktarball: Some little fixes/tweaks

mktarball +6 -7

diff --git a/mktarball b/mktarball
index 566b67b..9b69205 100755
--- a/mktarball
+++ b/mktarball
@@ -2,11 +2,8 @@
 
 . "$(dirname $0)"/libcomain
 
-if test ! -e meta/version; then error 2 "File 'meta/version' missing"; fi
-ver="$(cat meta/version)"
-
 echo " => Prepare new directory..."
-tb="$name-$version"
+tb="$(pwd)/$name-$version"
 if test -e $tb; then error 2 "File '$tb' already exists"; fi
 if test -e $tb.tar.xz; then error 2 "File '$tb.tar.xz' already exists"; fi
 
@@ -22,7 +19,7 @@ adddep()
 
     local ref="$(cat $dep/ref 2>/dev/null)"
     if test -z "$ref"; then ref="$(cat $dep/version)"; fi
-    run git -C ../$depname worktree add ../$tb/$depname -b tarball $ref
+    run git -C ../$depname worktree add $tb/$depname -b tarball $ref
 }
 echo "  -> Add components & \"internal\" dependencies..."
 cd $tb
@@ -38,8 +35,10 @@ echo "  -> Generate README..."
 run rm $tb/README
 run comain/mkreadme > $tb/README
 
+if ! test -e $tb/include; then mkdir $tb/include; fi
+
 echo " => Create tarball..."
-run tar -cJp --owner=0 --group=0 --numeric-owner --exclude=".git"* -f $tb.tar.xz $tb
+run tar -cJp --owner=0 --group=0 --numeric-owner --exclude=".git"* -f $tb.tar.xz "$prjname-$prjver"
 
 echo " => Clean up..."
 deldep()
@@ -51,7 +50,7 @@ deldep()
 
     local ref="$(cat $dep/ref 2>/dev/null)"
     if test -z "$ref"; then ref="$(cat $dep/version)"; fi
-    run git -C ../$depname worktree remove --force ../$tb/$depname
+    run git -C ../$depname worktree remove --force $tb/$depname
     run git -C ../$depname branch -D tarball
 }
 echo "  -> Remove components & \"internal\" dependencies..."