index : checker | |
Archlinux32 consistency checker | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/check | 3 | ||||
-rwxr-xr-x | bin/setup | 2 | ||||
-rwxr-xr-x | bin/update | 34 |
@@ -115,6 +115,3 @@ for pkg in `find "${state_dir}"/{core,extra}-{any,x86_64} -type f | \ echo "${pkg}\tno git repo" >> "${data_dir}/missing_package_repo" fi done - -# TODO: update all single package directories -# TODO: update all AUR package directories @@ -47,5 +47,3 @@ if test ! -d "${aur_state_dir}"; then else echo "AUR state information directory exists." fi - -# TODO: AUR directory @@ -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.." |