aboutsummaryrefslogtreecommitdiff
path: root/utils/repodb.sh
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2021-11-07 13:48:41 +0800
committerKunoiSayami <[email protected]>2021-11-07 13:48:41 +0800
commit254846d3da3f6c7fb70b316f5ebdf2ce4215309f (patch)
tree67b310059f2825fc0555e05704706b5dc7e5d710 /utils/repodb.sh
parentd1e83791bd44afe1c74ba6bd0c4ede86852005bc (diff)
refactor(script): Move all script to utils folder
* feat(script): Build test package not request signing for now Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'utils/repodb.sh')
-rwxr-xr-xutils/repodb.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/repodb.sh b/utils/repodb.sh
new file mode 100755
index 0000000..212b137
--- /dev/null
+++ b/utils/repodb.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# end up when failed
+set -Eeuo pipefail
+
+# clean up when exit
+trap cleanup SIGINT SIGTERM ERR EXIT
+cleanup() {
+ trap - SIGINT SIGTERM ERR EXIT
+ unset ARCH
+ unset PKGDEST
+ unset REPO_DEST
+ unset GPG_KEY
+ unset PACKAGE_NAME
+ unset LATEST
+}
+
+if [ -z $ARCH ]; then
+ ARCH=$(uname -m)
+ echo "Warning: You should specify arch environment variable, use current platform: $ARCH"
+fi
+
+REPO_BASE_NAME="kunoisayami"
+#ARCH=$(uname -m)
+REPO_DEST="${PWD}/packages/$ARCH/$REPO_BASE_NAME.db.tar.xz"
+GPG_KEY="4A0F0C8BC709ACA4341767FB243975C8DB9656B9"
+
+while read PACKAGE_NAME; do
+ #LATEST=$(ls -t "$PKGDEST/$PACKAGE_NAME"* | grep -v ".sig" | head -n 1 | cut -d' ' -f1)
+ if [ -z $PACKAGE_NAME ]; then
+ continue
+ fi
+ repo-add "$REPO_DEST" "$PACKAGE_NAME" -s -v -R -k $GPG_KEY
+done