[Lunar-commits] <lunar> Merge pull request #44 from cavalier38/lunar-module-add

Auke Kok sofar+github at foo-projects.org
Sat May 4 08:53:52 CEST 2013


commit 9b3024ce42a9585753364996c832db986232c011
Author: Auke Kok <sofar+github at foo-projects.org>
Date: Fri, 03 May 2013 23:53:50 -0700
URL: https://github.com/lunar-linux/lunar/commit/9b3024ce42a9585753364996c832db986232c011

Merge pull request #44 from cavalier38/lunar-module-add

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