From 995ddeed0e3d9b9cf9717c592780cc55ed56183b Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 22 Jun 2018 01:15:35 +0200 Subject: [PATCH] Add scripts/generate-repology-metadata.sh --- scripts/generate-repology-metadata.sh | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 scripts/generate-repology-metadata.sh diff --git a/scripts/generate-repology-metadata.sh b/scripts/generate-repology-metadata.sh new file mode 100755 index 000000000..2a85ffb09 --- /dev/null +++ b/scripts/generate-repology-metadata.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +check_package() { # path + local path=$1 + local pkg=`basename $path` + TERMUX_PKG_MAINTAINER="Fredrik Fornwall @fornwall" + . $path/build.sh + + echo " {" + echo " \"name\": \"$pkg\"," + echo " \"version\": \"$TERMUX_PKG_VERSION\"," + DESC=`echo $TERMUX_PKG_DESCRIPTION | head -n 1` + echo " \"description\": \"$DESC\"," + echo " \"homepage\": \"$TERMUX_PKG_HOMEPAGE\"," + + if [ "$TERMUX_PKG_DEPENDS" != "" ]; then + echo -n " \"depends\": [" + FIRST_DEP=yes + for p in ${TERMUX_PKG_DEPENDS//,/}; do + if [ $FIRST_DEP = yes ]; then + FIRST_DEP=no + else + echo -n ", " + fi + echo -n "\"$p\"" + done + echo "]," + fi + + if [ "$TERMUX_PKG_SRCURL" != "" ]; then + echo " \"srcurl\": \"$TERMUX_PKG_SRCURL\"," + fi + + echo " \"maintainer\": \"$TERMUX_PKG_MAINTAINER\"" + echo -n " }" +} + +export TERMUX_ARCH=aarch64 +export TERMUX_NDK_VERSION=17 + +echo '[' + +export FIRST=yes +# Run each package in separate process since we include their environment variables: +for path in packages/*; do + + if [ $FIRST = yes ]; then + FIRST=no + else + echo -n "," + echo "" + fi + + ( check_package $path) +done + +echo "" +echo ']'