From: Sadoon Albader Date: Fri, 18 Aug 2023 12:17:40 +0000 (+0300) Subject: Add script to build list of packages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02412d5fa84359939745ffac9b25ec8dbd309256;p=dev-env-setup.git Add script to build list of packages --- diff --git a/build-bookworm-sffs b/build-bookworm-sffs new file mode 100644 index 0000000..999ce2b --- /dev/null +++ b/build-bookworm-sffs @@ -0,0 +1,45 @@ +#!/bin/bash + +echo "SCRIPT IS STILL WIP, DO NOT RUN" + +BASEDIR=~/.local/src/bookworm-sffs/ +BUILDDIR=~/.local/src/bookworm-sffs/src/ +REPODIR=~/.local/src/bookworm-sffs/repo/ +JOBS=1 +CHROOT=bookworm-ppc64el-sbuild +OPTS= + +# To be changed to the full list +LIST=hello + + +for pkg in $LIST +do + mkdir -p $BUILDDIR/${pkg:0:1} +done + +cd $BUILDDIR + +# This will loop over every package in the list and attempt to rebuild +# If it succeeds, it will move the .deb files to their respective directory +# in $REPODIR/$LETTER/$PKG/ for preparation to create the repo later +# and add that package to the $BASEDIR/success file +# if not, it will add it to $BASEDIR/failed file +# The build logs will reside in $BUILDDIR/$LETTER/$PKG/*.log + +for pkg in $(BUILDDIR) +do + cd $BUILDDIR/${pkg:0:1}/ + mkdir -p $pkg && cd $BUILDDIR/${pkg:0:1}/$pkg + apt source $pkg + + if sbuild -d $DISTRO -c $CHROOT $OPTS -j$JOBS *.dsc; then + echo Build successful + echo $pkg >> $BASEDIR/success + mkdir -p $REPODIR/${pkg:0:1}/$pkg/ + mv *.deb $REPODIR/${pkg:0:1}/$pkg/ + else + echo Build failed + echo $pkg >> $BASEDIR/failed + fi +done