summaryrefslogtreecommitdiff
path: root/xibuild/make_infos.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-06 00:40:22 +0000
committerdavidovski <david@davidovski.xyz>2022-02-06 00:40:22 +0000
commit2c82b81fcd8fc723712ac605041da5142f765730 (patch)
treeda3ebf0f981d9f6e6bf4ccecef4ba55c044ae0a3 /xibuild/make_infos.sh
parent0b0913a10d6714015f1d1afa1a737086e20bac41 (diff)
moved src files to xibuild files
Diffstat (limited to 'xibuild/make_infos.sh')
-rwxr-xr-xxibuild/make_infos.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/xibuild/make_infos.sh b/xibuild/make_infos.sh
new file mode 100755
index 0000000..4817e6a
--- /dev/null
+++ b/xibuild/make_infos.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+
+# TODO remember to update this if there are ever changes
+XIPKG_INFO_VERSION='02'
+
+get_info() {
+ local name=$(basename -s ".xipkg" $1)
+
+ local pkg_ver=$PKG_VER
+ [ -z "$pkg_ver" ] && pkg_ver=$BRANCH
+ [ -z "$pkg_ver" ] && pkg_ver="latest"
+
+ echo "# XiPKG info file version $XIPKG_INFO_VERSION"
+ echo "# automatically generated from the built packages"
+ echo "NAME=$name"
+ echo "DESCRIPTION=$DESC"
+ echo "PKG_FILE=$name.xipkg"
+ echo "CHECKSUM=$(md5sum $1 | awk '{ print $1 }')"
+ echo "VERSION=$pkg_ver"
+ echo "SOURCE=$SOURCE"
+ echo "DATE=$(date -r $1)"
+ echo "DEPS=(${DEPS[*]})"
+ echo "MAKE_DEPS=(${MAKE_DEPS[*]})"
+}
+
+sign () {
+ echo "SIGNATURE="
+ openssl dgst -sign $PRIV_KEY $1
+}
+
+list_line() {
+ local pkg_file=$1
+
+ local name=$(basename -s ".xipkg" $pkg_file)
+ local filecount=$(gzip -cd $pkg_file | tar -tvv | grep -c ^-)
+ local checksum=$(md5sum $pkg_file | awk '{ print $1 }')
+ local size=$(du -s $pkg_file | awk '{print $1}')
+
+ echo $name.xipkg $checksum $size $filecount
+}
+
+
+for repo in $(ls -d "$XIB_EXPORT"/repo/*); do
+ file="$repo/packages.list"
+ [ -e $file ] && rm $file
+ touch $file
+ echo "Removed old package lists in $repo"
+done
+
+for pkg in $(ls "$XIB_EXPORT"/repo/*/*.xipkg); do
+ name=$(basename -s ".xipkg" $pkg)
+ repo=$(echo $pkg | rev | cut -d/ -f2 | rev)
+ info_file="$XIB_EXPORT/repo/$repo/$name.xipkg.info"
+ build_file="$XIB_EXPORT/repo/$repo/$name.xibuild"
+
+ source $build_file
+
+ get_info $pkg > $info_file
+ sign $pkg >> $info_file
+ list_line $pkg >> "$XIB_EXPORT"/repo/$repo/packages.list
+ echo "Enlisted $name to $info_file"
+
+
+done