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

Joel Grunbaum
2020-10-15 b2c2b530b6ccdf72286ad1c31076745a7c00fcb5
main.sh
@@ -66,10 +66,20 @@
      return 1
   fi
   #Get build artifact names
   source PKGBUILD
   pkgs=()
   for i in ${pkgname[@]}; do
      #pkgs+=("$i-$pkgver-$pkgrel")
      pkgs++("$i")
   done
   #Move package to repodir and add to repo db
   rm $REPODIR/*$1*.pkg.tar.??*
   cp *$1*.pkg.tar.?? $REPODIR/
   [[ "$SIGN" == "Y" ]] && cp *$1*.pkg.tar.??.sig $REPODIR/
   for i in ${pkgs[@]}; do
          rm $REPODIR/$i*.pkg.tar.??*
          cp $i*.pkg.tar.?? $REPODIR/
          [[ "$SIGN" == "Y" ]] && cp $i*.pkg.tar.??.sig $REPODIR/
   done
   # Weird exceptions
   if [[ "$1" == "zoom" ]]; then
@@ -90,7 +100,9 @@
   while true; do
      # Wait until package is at the top of the queue and add to db
      if [[ "$(head -n1 $REPODIR/.waitlist)" == "$1" ]]; then
         repo-add $([[ "$SIGN" == "Y" ]] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.xz $REPODIR/*$1*.pkg.tar.??
         for i in ${pkgs[@]}; do
            repo-add $([[ "$SIGN" == "Y" ]] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.xz $REPODIR/$i*.pkg.tar.??
         done
         while true; do
            if [[ $(cat $REPODIR/.waitlist.lck) == 1 ]]; then
               sleep 1
@@ -105,6 +117,16 @@
         done
         break
      else
         if [[ -z "$(grep $1 $REPODIR/.waitlist)" ]]; then
            # Not on waitlist for some reason, need to readd
            if [[ $(cat $REPODIR/.waitlist.lck) == 1]]; then
               sleep 1
            else
               echo 1 > $REPODIR/.waitlist.lck
               echo $1 >> $REPODIR/.waitlist
               echo 0 > $REPODIR/.waitlist.lck
            fi
         fi
         sleep 10
      fi
   done
@@ -219,7 +241,7 @@
   echo "To: $EMAIL"
   echo "Subject: Build errors"
   echo "There were build errors for the build of $REPONAME at $(date), please address them soon."
   echo "The errors were: $1"
   echo "The errors were: $@"
   ) | sendmail -t
}