From 49f3f0aa5a3b61b1dcb4ce08043ec44f8823d967 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 6 Oct 2021 19:48:45 +0100 Subject: added package.txt --- build-repo.sh | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ xibuild | 19 ++++++++++-- 2 files changed, 112 insertions(+), 2 deletions(-) create mode 100755 build-repo.sh diff --git a/build-repo.sh b/build-repo.sh new file mode 100755 index 0000000..038e4f6 --- /dev/null +++ b/build-repo.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +XIBUILD=./xibuild + +fetch-pkg-builds () { + git clone https://git.davidovski.xyz/xilinux/xipkgs + + mkdir dist + + for REPO in $(du -h xipkgs/repo/* | awk '{print $2}'); do + REPO_NAME=$(echo $REPO | cut -d"/" -f2-) + + REPO_INDEX=dist/$REPO_NAME/index.html + REPO_LIST=dist/$REPO_NAME/packages.txt + + echo " + + packages for $REPO_NAME + + + +

Packages in $REPO_NAME

+ " > $REPO_INDEX + + printf "" > xibuild.report.log + for BUILD_FILE in $REPO/*; do + DEST=dist/$REPO_NAME + + $XIBUILD -o $DEST $BUILD_FILE + + PKG_NAME=$(basename $BUILD_FILE .xibuild) + DESC=$(grep $PKG_NAME xibuild.report.log | cut -d" " -f3-) + + COLOR="none" + if grep $PKG_NAME xibuild.report.log | grep -q new; then + COLOR="lime" + fi + if grep $PKG_NAME xibuild.report.log | grep -q fail; then + if [ ! -f $DEST ]; then + COLOR="orange" + else + COLOR="red" + fi + fi + echo " + + + + + + + + +" >> $REPO_INDEX + done; + + rm xibuild.report.log + + echo "
$PKG_NAMEsrclog$DESC$PKG_NAME.xipkg.info
+ +

Latest builds: $(date)

+ +

Legend:

+ + + + " >> $REPO_INDEX + + cd dist/$REPO_NAME + ls -1 *.xipkg.info > packages.txt + cd - + + # move logs and sources + mv logs/* dist/$REPO_NAME/logs + + mkdir -p dist/$REPO_NAME/src + mv $REPO/* dist/$REPO_NAME/src/ + + # add key for whole repo + cp keychain/xi.pub dist/repo/ + done; + + + rm -rf xipkgs + rm -rf logs + rm -rf tmp + rm -rf xibuild.log +} + +fetch-pkg-builds diff --git a/xibuild b/xibuild index 3c202c9..1ef7264 100755 --- a/xibuild +++ b/xibuild @@ -32,6 +32,10 @@ extract () { esac } +pkgname () { + echo $(basename $1 .xibuild) +} + xibuild () { BUILD_FILE=${@: -1} @@ -56,7 +60,7 @@ xibuild () { source $BUILD_FILE - PKG_NAME=$(basename $BUILD_FILE .xibuild) + PKG_NAME=$(pkgname $BUILD_FILE) LOGFILE=$XI_ROOT/logs/$PKG_NAME.log PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.xipkg @@ -100,6 +104,7 @@ xibuild () { printf "$INFO\tvalidating commit hash..."; if echo "$EXISTING_HASH" | grep -q "$VER_HASH"; then printf "$NEUTRAL package exists$RESET\n" + echo "exists $PKG_NAME $DESC" >> $REPORT_LOG return; else printf "$NEUTRAL package outdated\n" @@ -161,6 +166,7 @@ xibuild () { printf "$PASS successfully built $PKG_NAME to $(basename $PKG_FILE)$RESET\n" clean + echo "new $PKG_NAME $DESC" >> $REPORT_LOG return 0 } @@ -195,7 +201,14 @@ build-all () { usage ;; * ) - xibuild $1 && printf "$RESET" || printf "$ERROR error! See log$RESET\n" + REPORT_LOG=$XI_ROOT/xibuild.report.log + BUILD_FILE=$1 + if xibuild $BUILD_FILE; then + printf "$RESET" + else + printf "$ERROR error! See log$RESET\n" + echo "fail $PKG_NAME $DESC" >> $REPORT_LOG + fi cd $XI_ROOT ;; esac @@ -205,5 +218,7 @@ build-all () { } if [ $# -gt 0 ]; then build-all $@ | tee -a xibuild.log +else + usage; return 1 fi -- cgit v1.2.1