index : checker | |
Archlinux32 consistency checker | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2024-09-28 10:14:06 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2024-09-28 10:14:06 +0200 |
commit | d44ce5005d4b5e8de141a4069aca118404225b6f (patch) | |
tree | a36e5686213213b8dd29ec4e84f8116aa569eb69 /bin/update | |
parent | dcee90ac8a940932c0152861467e56743d774529 (diff) |
-rwxr-xr-x | bin/update | 34 |
@@ -98,25 +98,45 @@ if test "${UPDATE_UPSTREAM}" = 1; then IFS=" " while read pkgname pkgver tag revision; do if test "${VERBOSE}" = 1; then - echo "${repo} ${pkgname}" + echo -n "${repo} ${pkgname}" fi if test ! -d "${packages_dir}/${repo}/${pkgname}"; then + if test "${VERBOSE}" = 1; then + echo ".. cloning .." + fi cd "${packages_dir}/${repo}" || exit 1 pkgctl repo clone --protocol=https "${pkgname}" sleep 10 else - true -# TODO: find a way to find out whether the reference revision is in out -# current state repo and update only when we miss it. We can still -# do a full update when we need it, but here it just creates a lot -# of load.. -# git -C "${packages_dir}/${repo}/${pkgname}" pull + # get all revisions from the package repo, check if + # we find the state sha in there, if not, do an + # update of the repo. Doing a full git pull on + # every update is not acceptable as it creates too + # much load + cd "${packages_dir}/${repo}/${pkgname}" || exit 1 + git show-ref --tags > /tmp/update_package_revisions.$$ + grep -F "${revision}" "/tmp/update_package_revisions.$$" 2>&1 >/tmp/update_package_revision_found.$$ + if test $? = 0; then + if test "${VERBOSE}"; then + tag=`cat /tmp/update_package_revision_found.$$ | cut -d ' ' -f 2` + echo ".. ${revision} (${tag}) exists in package history .." + fi + else + if test "${VERBOSE}"; then + echo ".. updating .." + fi + git -C "${packages_dir}/${repo}/${pkgname}" pull + sleep 10 + fi + rm -f /tmp/update_package_revisions.$$ /tmp/update_package_revision_found.$$ fi done < $pkgfile IFS="$OLDIFS" done fi +rm -f /tmp/update_packages.$$ + if test "${UPDATE_AUR}" = 1; then echo "Updating AUR state.." |