[Lunar-commits] <lunar> Add a bit more to expired's list display.

Auke Kok sofar at foo-projects.org
Tue Apr 24 09:19:10 CEST 2012


commit 3671bd24108768b1ff8689b54e0445f9c156a09c
Author: Auke Kok <sofar at foo-projects.org>
Date:   Tue Apr 24 00:19:10 2012 -0700

    Add a bit more to expired's list display.
---
 bin/lvu |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/bin/lvu b/bin/lvu
index 0fea681..1a5acc4 100755
--- a/bin/lvu
+++ b/bin/lvu
@@ -1152,7 +1152,49 @@ main()  {
 
     expired)
       for MODULE in $(list_expired_modules); do
-        echo "$MODULE ($(installed_version $MODULE) -> $(run_details $MODULE > /dev/null ; echo $VERSION))"
+        L=$(installed_version $MODULE)
+	R=$(run_details $MODULE > /dev/null ; echo $VERSION)
+
+	CL=( `echo $L | sed 's/[.]/ /g'` )
+	CR=( `echo $R | sed 's/[.]/ /g'` )
+	
+	S="(equal)"
+
+	for N in $(seq 0 $(( ${#CL[@]} - 1 ))); do
+	
+	  TL="${CL[$N]}"
+	  TR="${CR[$N]}"
+
+          if [ "$TL" == "$TR" ]; then
+	    continue
+	  fi
+
+	  if [ -z "$(echo $TL$TR | sed 's/[0-9]//g')" ] ; then
+	    # numerical
+	    if [ "$TL" -eq "$TR" ] ; then
+	      continue
+	    elif [ "$TL" -lt "$TR" ] ; then
+	      # normal upgrade
+	      S="" 
+	      break
+	    else
+	      S="(downgrade)"
+	      break
+	    fi
+	  else
+	    # string order
+	    if [[ "$TL" < "$TR" ]] ; then
+	      # normal upgrade
+	      S=""
+	      break
+	    else
+	      S="(downgrade)"
+	      break
+	    fi
+	  fi
+	done
+
+        echo "$MODULE ($L -> $R) $S"
       done
       ;;
     failed)


More information about the Lunar-commits mailing list