[Lunar-commits] r24891 - lunar/trunk/var/lib/lunar/functions
Auke Kok
sofar at lunar-linux.org
Mon Jun 18 07:49:04 CEST 2007
Author: sofar
Date: 2007-06-18 07:49:04 +0200 (Mon, 18 Jun 2007)
New Revision: 24891
Modified:
lunar/trunk/var/lib/lunar/functions/modules.lunar
Log:
Add a little safetynet: don't wipe all modules
if a lin moonbase fails, renew or update calls purge_modules which starts
to delete all installed modules. If the count of modules in moonbase
is unrealistically small, this code will stop processing and halt
immediately.
Modified: lunar/trunk/var/lib/lunar/functions/modules.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/modules.lunar 2007-06-18 05:28:52 UTC (rev 24890)
+++ lunar/trunk/var/lib/lunar/functions/modules.lunar 2007-06-18 05:49:04 UTC (rev 24891)
@@ -524,6 +524,11 @@
local MODULE
debug_msg "purge_modules ($@)"
verbose_msg "Discovering modules that were removed from moonbase"
+ # safetynet: don't wipe everything
+ if [ $(list_moonbase | wc -l) -lt 100 ]; then
+ error_message "${PROBLEM_COLOR}Error: ${DEFAULT_COLOR}${MESSAGE_COLOR} your moonbase seems damaged. Re-lin moonbase to fix.${DEFAULT_COLOR}"
+ exit 1
+ fi
for MODULE in $(list_installed | grep -v "^moonbase$") ; do
(
if ! run_details $MODULE &> /dev/null ; then
More information about the Lunar-commits
mailing list