[Lunar-commits] <lunar> Only show sections which contain installable modules.

Peter de Ridder peter at lunar-linux.org
Sat May 4 08:53:52 CEST 2013


commit c53473b561f53f0b0fa2dbdf9cb267cdeca45cd9
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Fri, 26 Apr 2013 15:35:42 -0700
URL: https://github.com/lunar-linux/lunar/commit/c53473b561f53f0b0fa2dbdf9cb267cdeca45cd9

Only show sections which contain installable modules.
---
  prog/lunar | +14/-1    
  1 file changed, 14 insertions(+), 1 deletion(-)

--- a/prog/lunar
+++ b/prog/lunar
@@ -84,9 +84,22 @@ show_modules()	{
 }
 
 
+has_modules()	{ 
+  for  MODULE in `list_modules "$1"`;  do
+    if  !  module_installed  $MODULE  &&
+        !  module_held       $MODULE  &&
+        !  module_exiled     $MODULE
+    then
+      return 0
+    fi
+  done
+  return 1
+}
+
+
 show_sections()  {
   for SECTION in $(list_sections);  do
-    [ -z "$(list_modules $SECTION)" ] || {
+    has_modules $SECTION && {
       echo  "$SECTION"
       echo  "section"
     }




More information about the Lunar-commits mailing list