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

Joel Grunbaum
2020-11-30 3d918611a7da82247377abf1f12300387ce33c40
Removed testing comments and unused spaces. added todo
2 files modified
23 ■■■■■ changed files
README.org 1 ●●●● patch | view | raw | blame | history
main.sh 22 ●●●●● patch | view | raw | blame | history
README.org
@@ -48,3 +48,4 @@
# - Create a universal variables file :: Not sure how useful this would be, but could be nice
# - Build parallelism :: Try and make packages build in parallel, place a lock on the repo file.
# - Add or remove multiple packages at a time :: Make it less tedious to add packages
- Keep multiple old packages :: Keep so that packages can be downloaded even if repository isn't upgraded. Also allow downgrading
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,8 +199,6 @@
#Adding build dependencies is
# Usage: add [package name]
function add {
    echo @: $@
#    read
    local i j k
    for i in $@; do
        cd $BUILDDIR
@@ -217,7 +213,7 @@
        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
@@ -230,18 +226,15 @@
                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