From bb1c2bc407f0cfefbaaab876dd08b59a4e7b2ccf Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 28 Sep 2024 15:17:38 +0200 Subject: update: some stat fixes --- bin/update | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/update b/bin/update index 17642cc..a09b7e7 100755 --- a/bin/update +++ b/bin/update @@ -80,8 +80,9 @@ if test "${UPDATE_UPSTREAM}" = 1; then find "${state_dir}"/{core,extra}-{any,x86_64} -type f | sort > /tmp/update_packages.$$ - nof_checked_out_packages=0 nof_updated_packages=0 + nof_cloned_packages=0 + nof_checked_out_packages=0 for pkgfile in `cat /tmp/update_packages.$$`; do repo=`echo "${pkgfile}" | rev | cut -f 2 -d / | rev` @@ -91,6 +92,7 @@ if test "${UPDATE_UPSTREAM}" = 1; then if test "${VERBOSE}" = 1; then echo -n "${repo} ${pkgname}" fi + nof_checked_out_packages=`expr ${nof_checked_out_packages} + 1` if test ! -d "${packages_dir}/${repo}/${pkgname}"; then if test "${VERBOSE}" = 1; then echo ".. cloning .." @@ -109,16 +111,16 @@ if test "${UPDATE_UPSTREAM}" = 1; then 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 + if test "${VERBOSE}" = 1; 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 + if test "${VERBOSE}" = 1; then echo ".. updating .." fi git -C "${packages_dir}/${repo}/${pkgname}" pull - nof_checked_out_packages=`expr ${nof_checked_out_packages} + 1` + nof_cloned_packages=`expr ${nof_cloned_packages} + 1` sleep 10 fi rm -f /tmp/update_package_revisions.$$ /tmp/update_package_revision_found.$$ @@ -131,11 +133,10 @@ if test "${UPDATE_UPSTREAM}" = 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_checked_out_packages} packages are checked out totally" + echo "${nof_cloned_packages} packages have been newly cloned" echo "${nof_updated_packages} packages have been updated" fi fi -- cgit v1.2.3-70-g09d2