#!/bin/bash home_dir=$( getent passwd makepkg \ | cut -d: -f6 ) if [ -z "${home_dir}" ]; then >&2 echo 'Cannot find homedir of user "makepkg".' exit 1 fi if [ -n "$1" ]; then arch="$1" else arch=$( pacman-conf Architecture ) fi if ! git -C "${home_dir}/archlinuxewe" pull --ff-only; then >&2 echo 'Cannot update archPackages repository.' fi while true; do "${home_dir}/archlinuxewe/update-sources" "${home_dir}/archlinuxewe/archPackagesUpdate" \ --no-abortOnMakepkgError \ --arch "${arch}" \ || "${home_dir}/archlinuxewe/archPackagesUpdate" \ --cleanChroot \ --arch "${arch}" \ || true sleep $( printf '60 + e(l(%s-%s)/2)\n' $(date +%s) $(git log -1 --pretty='format:%at') \ | bc -l \ | cut -d. -f1 ) done