[Lunar-commits] CVS: theedge/var/lib/lunar/functions build.lunar, 1.28, 1.29 moonbase.lunar, 1.20, 1.21 plugins.lunar, 1.5, 1.6

Auke Kok sofar at lunar-linux.org
Wed Mar 30 11:25:55 UTC 2005


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory espresso.foo-projects.org:/tmp/cvs-serv5766/var/lib/lunar/functions

Modified Files:
	build.lunar moonbase.lunar plugins.lunar 
Log Message:
Merging in moonbase plugins: some plugins are moved to moonbase, a few base plugins are left behind.


Index: build.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/build.lunar,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- build.lunar	24 Mar 2005 16:38:59 -0000	1.28
+++ build.lunar	30 Mar 2005 11:25:53 -0000	1.29
@@ -261,6 +261,7 @@
   } | tee -a $C_LOG
   
   install_initd
+  update_plugin $MODULE
 
   devoke_installwatch
   ldconfig

Index: moonbase.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/moonbase.lunar,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- moonbase.lunar	18 Mar 2005 11:01:31 -0000	1.20
+++ moonbase.lunar	30 Mar 2005 11:25:53 -0000	1.21
@@ -73,6 +73,7 @@
       add_module $MODULE installed $VERSION $(du -hs $SYSTEM_MOONBASE | cut -f1)
       # get ready to regenerate the module index cache file
       check_module_index
+      update_plugins
       display_moonbase_changes
     fi
   else

Index: plugins.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/plugins.lunar,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- plugins.lunar	27 Mar 2005 22:02:29 -0000	1.5
+++ plugins.lunar	30 Mar 2005 11:25:53 -0000	1.6
@@ -31,6 +31,7 @@
 	# 6 - KERNEL_UPDATEBOOTLOADER - automate bootloader maintenance
 	LUNAR_PLUGINS=(${LUNAR_PLUGINS[@]} "$1:$2")
 	((LUNAR_PLUGIN_COUNT++))
+	debug_msg "Registered plugin #$LUNAR_PLUGIN_COUNT, $1 -> $2()"
 }
 
 
@@ -57,10 +58,46 @@
 	return 2
 }
 
-# source the plugins now:
-PLUGINS=/var/lib/lunar/plugins
-for LUNAR_PLUGIN in $PLUGINS/*.plugin; do
-	. $LUNAR_PLUGIN
-done
+
+update_plugin() {
+	debug_msg "update_plugin($@)"
+	# update plugins of all modules or a specific one
+	#
+	# $1 - module name
+	# $2 - forced removal of plugin
+	#
+	# scan module for plugins, and add/delete them as needed
+	if SECTION=$(find_section $1); then
+		if [ -d $MOONBASE/$SECTION/$1/plugin.d ]; then
+			if ! module_installed $1 ; then
+				for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do
+					debug_msg "Removed \"$(basename $PLUGIN)\""
+					rm -f $PLUGIN_DIR/$(basename $PLUGIN)
+				done
+			elif [ -n "$2" ] ; then
+				for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do
+					debug_msg "Removed \"$(basename $PLUGIN)\""
+					rm -f $PLUGIN_DIR/$(basename $PLUGIN)
+				done
+			else
+				for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do
+					debug_msg "Installed \"$(basename $PLUGIN)\""
+					install -m644 $PLUGIN $PLUGIN_DIR/
+				done
+			fi
+		fi
+	fi
+}
+
+
+update_plugins() {
+	debug_msg "update_plugins($@)"
+	# rework all plugins	
+	verbose_msg "Updating plugins"
+	for MODULE in $(list_moonbase); do
+		update_plugin $MODULE
+	done
+}
+
 
 



More information about the Lunar-commits mailing list