Add script to build list of packages
authorSadoon Albader <sadoon@soulserv.xyz>
Fri, 18 Aug 2023 12:17:40 +0000 (15:17 +0300)
committerSadoon Albader <sadoon@soulserv.xyz>
Fri, 18 Aug 2023 12:17:40 +0000 (15:17 +0300)
build-bookworm-sffs [new file with mode: 0644]

diff --git a/build-bookworm-sffs b/build-bookworm-sffs
new file mode 100644 (file)
index 0000000..999ce2b
--- /dev/null
@@ -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