From a6bcf08a21dec30434058dca9b5ab1f1763dd556 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 12 Jul 2013 02:03:09 +0200 Subject: [PATCH] automaint: added -v option to display explainatory messages on skipped packages --- automaint | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/automaint b/automaint index 98c309c..d082974 100755 --- a/automaint +++ b/automaint @@ -21,12 +21,13 @@ ${me[0]} ${me[1]} "$"Batch automatic maintainance tool of the autodist suite."" "$"Usage"": - $me [-s repository -d repository ] [-p repository] [-h] + $me [-s repository -d repository ] [-p repository] [-h] [-v] -s repository "$"Automatic/Staging builds source repository -d repository "$"Main destination repository -p repository "$"Port repository -h "$"Show this help and exit + -v "$"Verbose mode " } @@ -129,6 +130,8 @@ for ((i=1; i<=$#; i++)); do -p) shift PORT_REPOSITORY="${!i}" ;; + -v) VERBOSE=1 + ;; -h|--help) usage exit 0 @@ -169,6 +172,11 @@ for p in ${pkglist[0]}; do spkg_release=$pkg_release get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$DEST_REPOSITORY ${ARCHS[0]} $p + [ "$pkg_name" ] || { + echo "$p: looks like a new package; skipping." + continue + } + if [ "$pkg_version" = "$spkg_version" ]; then update_type="release" else @@ -182,12 +190,12 @@ for p in ${pkglist[0]}; do done if [ "$i" = "${#SVER[*]}" ]; then if [[ 64#${SVER[i-1]} -gt 64#89 && 64#${VER[i-1]} -lt 64#80 ]]; then - echo "$p: dubious beta upgrade from ${VER[i-1]} to ${SVER[i-1]}" + [ "$VERBOSE" ] && echo "$p: dubious beta upgrade from ${VER[i-1]} to ${SVER[i-1]}; skipping." continue fi update_type="minor" else - #echo "$p: dubios not-minor version update $i/${#SVER[*]}: ${SVER[i-1]} != ${VER[i-1]}" + [ "$VERBOSE" ] && echo "$p: dubious not-minor version update $i/${#SVER[*]}: ${SVER[i-1]} != ${VER[i-1]}; skipping." continue fi fi