index : checker | |
Archlinux32 consistency checker | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2024-09-28 09:27:19 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2024-09-28 09:27:19 +0200 |
commit | dcee90ac8a940932c0152861467e56743d774529 (patch) | |
tree | 9d7c6d28b42b81ed249c15c6fdd526eef9a7a8a8 /bin/check | |
parent | 0b28119272480c89f038501a4e9fa2b1720ace29 (diff) |
-rwxr-xr-x | bin/check | 49 |
@@ -3,6 +3,40 @@ BASE="${0%/*}/.." . "${BASE}/conf/default.conf" +VERBOSE=0 +OPTIONS=`getopt -n check -o hv -l help,verbose -- "$@"` +if test $? != 0; then + echo "ERROR: internal error which using getopt.." >&2; + exit 1 +fi +eval set -- "$OPTIONS" +while true; do + case "$1" in + -h|--help) + echo "check [options]" + echo "" + echo "-v --verbose be verbose" + exit 0 + ;; + + -v|--verbose) + VERBOSE=1 + shift + ;; + + --) + shift + break + ;; + + *) + echo "ERROR: Internal error in getopt" >&2 + exit 1 + esac +done + +shift `expr $OPTIND - 1` + if test ! -d "${state_dir}"; then echo "no upstream git state repo of packages.. exiting.." exit 1 @@ -19,9 +53,12 @@ nof_aur_packages=`wc -l ${aur_state_dir}/packages | cut -f 1 -d ' '` 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_aur_packages} packages in AUR" +if test "${VERBOSE}" = 1; then + echo "${nof_packages} packages in state repo" + echo "${nof_checked_out_packages} packages are checked out" + echo "${nof_aur_packages} packages in AUR" + sleep 10 +fi > "${data_dir}/stats" echo "packages_state\t${nof_packages}" >> "${data_dir}/stats" @@ -33,6 +70,9 @@ for duplicate in `find "${state_dir}"/{core,extra}-{any,x86_64} -type f | \ rev | cut -f 1 -d / | rev | sort | uniq -D | uniq`; do for packages in `ls ${state_dir}/{core,extra}-{any,x86_64}/$duplicate 2>/dev/null`; do for instance in `echo $packages | rev | cut -f 1,2 -d / | rev`; do + if test "${VERBOSE}" = 1; then + echo "Found duplicate state git entry for '${instance}'" + fi echo -n "${instance}\t" >> "${data_dir}/duplicates" cat "${state_dir}/$instance" | tr -s ' ' '\t' >> "${data_dir}/duplicates" done @@ -56,6 +96,9 @@ for pkgfile in `find "${packages_dir}" -type f -name PKGBUILD`; do state='missing' aur_state='missing' fi + if test "${VERBOSE}" = 1; then + echo "Missing state file for '${repo_in_pkgfile}'" + fi echo "${repo_in_pkgfile}\t${state}\t${aur_state}" >> "${data_dir}/missing_state_file" fi done |