mirror of https://github.com/Chizi123/Arch-autobuild-repo.git

Joel Grunbaum
2020-12-06 863ad1d6a0d0b8f7ccf05368f9f3355b6ea5e441
main.sh
@@ -76,7 +76,7 @@
      ver=$pkgver
   fi
   find . -mindepth 1 -maxdepth 1 -type f \( -name "*.pkg.tar.*" -o -name "*.src.tar.*" \) -not -name "*$ver-$pkgrel*" -delete
   #Get build artifact names from PKGBUILD and build artifacts
   #Remove duplicates from the list
   pkgs=()
@@ -111,7 +111,7 @@
         cp $i $REPODIR/
         [[ "$SIGN" == "Y" ]] && cp $i.sig $REPODIR/
      done
   else
   else
      return;
   fi
@@ -129,9 +129,7 @@
   while true; do
      # Wait until package is at the top of the queue and add to db
      if [[ "$(head -n1 $WAITLIST)" == "$1" ]]; then
      #  for i in ${pkgs[@]}; do
            repo-add $([[ "$SIGN" == "Y" ]] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.$([ -n "$COMPRESSION" ] || echo $COMPRESSION && echo zst) ${pkgs[@]}
      #  done
          repo-add $([[ "$SIGN" == "Y" ]] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.$([ -n "$COMPRESSION" ] || echo $COMPRESSION && echo zst) ${pkgs[@]}
         while true; do
            if [[ $(cat $WAITLIST_LCK) == 1 ]]; then
               sleep 1
@@ -201,13 +199,11 @@
#Adding build dependencies is
# Usage: add [package name]
function add {
   echo @: $@
#  read
   local i j k
   for i in $@; do
      cd $BUILDDIR
      if [[ -z $(git ls-remote https://aur.archlinux.org/$i.git) ]]; then
         echo "Not a package"
         echo "Not a package: $i"
         exit 2
      fi
      git clone https://aur.archlinux.org/$i.git
@@ -217,31 +213,28 @@
      local makedeps
      source PKGBUILD
      #check for all build dependencies
      #Check for all build dependencies
      for j in ${makedepends[@]}; do
         k=$(echo $j | sed 's/[>]=.*//g')
         if ! pacman -Si $k; then
         if ! (pacman -Si $k || pacman -Qi $k); then
            makedeps+=($k)
         fi &>/dev/null
      done
      for j in ${depends[@]}; do
         k=$(echo $j | sed 's/[>]=.*//g')
         if ! pacman -Si $k; then
         if ! (pacman -Si $k || pacman -Qi $k); then
            makedeps+=($k)
         fi &>/dev/null
      done
      echo $i: ${makedeps[@]}
#     read
      #Add dependencies and update so overall build can work
      for j in ${makedeps[@]}; do
         add $j
#        read
      done
      echo $i: ${makedeps[@]}
#     read
      if [[ -n "${makedeps[@]}" ]]; then
         sudo pacman -Sy
      fi
#read
      #Actually build wanted package
      cd $BUILDDIR/$i
      build_pkg $i -f
@@ -288,6 +281,7 @@
   rm -f $TMPFILE
}
#Check helper function
function check_pkg {
   if [[ -z "$(curl -sI "https://aur.archlinux.org/packages/$2" | head -n1 | grep 200)" ]]; then
      echo "$2" >> $1