[Lunar-commits] r22021 - lunar/trunk/var/lib/lunar/functions
Auke Kok
sofar at lunar-linux.org
Wed Nov 1 03:51:31 CET 2006
Author: sofar
Date: 2006-11-01 03:51:31 +0100 (Wed, 01 Nov 2006)
New Revision: 22021
Modified:
lunar/trunk/var/lib/lunar/functions/moonbase.lunar
lunar/trunk/var/lib/lunar/functions/plugins.lunar
lunar/trunk/var/lib/lunar/functions/tracking.lunar
Log:
Speed improvements suggested by Lurch: shaves down a `lin moonbase` from 39s to 9s.
Modified: lunar/trunk/var/lib/lunar/functions/moonbase.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/moonbase.lunar 2006-10-31 22:34:07 UTC (rev 22020)
+++ lunar/trunk/var/lib/lunar/functions/moonbase.lunar 2006-11-01 02:51:31 UTC (rev 22021)
@@ -52,8 +52,8 @@
"${DEFAULT_COLOR}${MESSAGE_COLOR}...${DEFAULT_COLOR}" &&
mv $SYSTEM_MOONBASE/zlocal/ /var/lib/lunar/.zlocal-backup &&
rm -rf $SYSTEM_MOONBASE &&
- TMP_MODULE_INDEX=$(temp_create "temp.module.index") &&
- cp $MODULE_INDEX $TMP_MODULE_INDEX &&
+ TMP_MODULE_INDEX=$(temp_create "temp.module.index") &&
+ cp $MODULE_INDEX $TMP_MODULE_INDEX &&
lrm moonbase &&
mkdir $SYSTEM_MOONBASE &&
mv /var/lib/lunar/.zlocal-backup $SYSTEM_MOONBASE/zlocal &&
@@ -68,20 +68,18 @@
echo "$MD5SUM_LOGS/$MODULE-$VERSION" >> $INSTALL_LOGS/$MODULE-$VERSION
message "${MESSAGE_COLOR}Created ${FILE_COLOR}$INSTALL_LOGS/$MODULE-$VERSION" \
"${DEFAULT_COLOR}${MESSAGE_COLOR}${DEFAULT_COLOR}"
-
+
# create an md5sum log
- message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$MD5SUM_LOGS/$MODULE-$VERSION${DEFAULT_COLOR}"
- for file in $(cat /var/log/lunar/install/moonbase-$VERSION) ; do
- test -f "$file" && md5sum "$file"
- done >> $MD5SUM_LOGS/$MODULE-$VERSION
-
- add_module $MODULE installed $VERSION $(du -hs $SYSTEM_MOONBASE | cut -f1)
+ create_md5sum_log &&
+
+ add_module $MODULE installed $VERSION $(du -hs $SYSTEM_MOONBASE | cut -f1) &&
# get ready to regenerate the module index cache file
- create_module_index
- create_depends_cache
- update_plugins
- display_moonbase_changes
- temp_destroy $TMP_MODULE_INDEX
+ create_module_index &&
+ create_depends_cache &&
+ update_plugins &&
+ display_moonbase_changes &&
+ temp_destroy $TMP_MODULE_INDEX ||
+ OUTCOME=failed
fi
else
OUTCOME=failed
Modified: lunar/trunk/var/lib/lunar/functions/plugins.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/plugins.lunar 2006-10-31 22:34:07 UTC (rev 22020)
+++ lunar/trunk/var/lib/lunar/functions/plugins.lunar 2006-11-01 02:51:31 UTC (rev 22021)
@@ -105,10 +105,10 @@
update_plugins() {
local MODULE
debug_msg "update_plugins($@)"
- # rework all plugins
+ # find all plugins in moonbase and run update_plugin() on them
verbose_msg "Updating plugins"
- for MODULE in $(list_moonbase); do
- update_plugin $MODULE
+ find $MOONBASE -wholename "*/plugin.d/*.plugin" | while read PLUGIN ; do
+ update_plugin `basename $(echo $PLUGIN | sed 's/\/plugin.d\/.*//g')`
done
}
Modified: lunar/trunk/var/lib/lunar/functions/tracking.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/tracking.lunar 2006-10-31 22:34:07 UTC (rev 22020)
+++ lunar/trunk/var/lib/lunar/functions/tracking.lunar 2006-11-01 02:51:31 UTC (rev 22021)
@@ -96,13 +96,9 @@
debug_msg "create_md5sum_log ($@)"
rm -f $MD5SUM_LOGS/$MODULE-$VERSION &> /dev/null
-
message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$MD5SUM_LOGS/$MODULE-$VERSION${DEFAULT_COLOR}"
- files < $INSTALL_LOGS/$MODULE-$VERSION | while read FILE ; do
- md5sum "$FILE" >> $MD5SUM_LOGS/$MODULE-$VERSION
- done
-
+ files < $INSTALL_LOGS/$MODULE-$VERSION | xargs md5sum >> $MD5SUM_LOGS/$MODULE-$VERSION
}
create_install_cache() {
@@ -124,7 +120,7 @@
create_install_log &&
create_md5sum_log &&
create_install_cache &&
-
+
add_module $MODULE installed $VERSION $(find_module_size $MODULE $VERSION)
verbose_msg "module size is $(find_module_size $MODULE $VERSION)"
}
More information about the Lunar-commits
mailing list