From 42408f1ec1c1a5474429845641f62349c34cc621 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 28 Sep 2024 12:41:30 +0200 Subject: update: added more statistics --- bin/update | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/update b/bin/update index f7b7c44..ab1ece1 100755 --- a/bin/update +++ b/bin/update @@ -80,17 +80,8 @@ if test "${UPDATE_UPSTREAM}" = 1; then find "${state_dir}"/{core,extra}-{any,x86_64} -type f > /tmp/update_packages.$$ - if test "${STATS}" = 1; then - echo "Checking statistics.." - - nof_packages=`cat /tmp/update_packages.$$ | wc -l` - nof_checked_out_packages=`find "${packages_dir}" -type f -name PKGBUILD | wc -l` - - echo "${nof_packages} packages in state repo" - echo "${nof_checked_out_packages} packages are checked out" - - sleep 10 - fi + nof_checked_out_packages=0 + nof_updated_packages=0 for pkgfile in `cat /tmp/update_packages.$$`; do repo=`echo "${pkgfile}" | rev | cut -f 2 -d / | rev` @@ -106,6 +97,7 @@ if test "${UPDATE_UPSTREAM}" = 1; then fi cd "${packages_dir}/${repo}" || exit 1 pkgctl repo clone --protocol=https "${pkgname}" + nof_updated_packages=`expr ${nof_updated_packages} + 1` sleep 10 else # get all revisions from the package repo, check if @@ -126,6 +118,7 @@ if test "${UPDATE_UPSTREAM}" = 1; then echo ".. updating .." fi git -C "${packages_dir}/${repo}/${pkgname}" pull + nof_checked_out_packages=`expr ${nof_checked_out_packages} + 1` sleep 10 fi rm -f /tmp/update_package_revisions.$$ /tmp/update_package_revision_found.$$ @@ -133,6 +126,18 @@ if test "${UPDATE_UPSTREAM}" = 1; then done < $pkgfile IFS="$OLDIFS" done + + if test "${STATS}" = 1; then + echo "Checking statistics.." + + nof_packages=`cat /tmp/update_packages.$$ | wc -l` + nof_checked_out_packages=`find "${packages_dir}" -type f -name PKGBUILD | wc -l` + + echo "${nof_packages} packages in state repo" + echo "${nof_checked_out_packages} packages are checked out" + echo "${nof_checked_out_packages} packages have been checked out" + echo "${nof_updated_packages} packages have been updated" + fi fi rm -f /tmp/update_packages.$$ -- cgit v1.2.3-70-g09d2