[Lunar-commits] <lunar> Backport of ldd check fix.
Auke Kok
sofar at lunar-linux.org
Mon Jul 2 04:43:12 CEST 2012
commit 98aae868d2baf4a27250c4796df0da9dc9de36e3
Author: Auke Kok <sofar at lunar-linux.org>
Date: Sun Apr 9 19:22:11 2006 +0000
Backport of ldd check fix.
---
var/lib/lunar/functions/check.lunar | 275 ++++++++++++++++----------------
var/lib/lunar/plugins/check-ldd.plugin | 2 -
2 files changed, 136 insertions(+), 141 deletions(-)
diff --git a/var/lib/lunar/functions/check.lunar b/var/lib/lunar/functions/check.lunar
index 696e3ca..a20bcf2 100644
--- a/var/lib/lunar/functions/check.lunar
+++ b/var/lib/lunar/functions/check.lunar
@@ -11,156 +11,153 @@
run_checks() {
- debug_msg "run_checks ($@)"
- verbose_msg "Running sanity checks for module \"$1\""
- plugin_call MODULE_CHECK $1
- if [ $? == 2 ]; then
- return 0
- fi
- return 1
+ debug_msg "run_checks ($@)"
+ verbose_msg "Running sanity checks for module \"$1\""
+ (
+ run_details $1
+ plugin_call MODULE_CHECK $1
+ if [ $? == 2 ]; then
+ return 0
+ fi
+ return 1
+ )
}
# rework_module : check depends database for a module
rework_module() {
- local MODULE
- debug_msg "rework_module ($@)"
-
- # we declare these local to override the systems default ones:
- optional_depends() {
- local DEP
- debug_msg " optional_depends ($@)"
- DEP=$(NEVER_ASK=1 DEPS_ONLY= unalias $1)
- if module_exiled $DEP ; then
- echo "$MODULE:$DEP:off:optional:$2:$3"
- else
- if module_installed $DEP || module_held $DEP ; then
- echo "$MODULE:$DEP:on:optional:$2:$3"
- else
- echo "$MODULE:$DEP:off:optional:$2:$3"
- fi
- fi
- }
-
- depends() {
- local DEP
- debug_msg " depends ($@)"
- DEP=$(NEVER_ASK=1 DEPS_ONLY= unalias $1)
- if ! module_installed $DEP && ! module_held $DEP ; then
- if ! is_depends $DEP && module_exiled $DEP ; then
- return 1
- else
- CHANGED_MODULES="$CHANGED_MODULES $DEP"
- fi
- fi
-
- echo "$MODULE:$DEP:on:required:$2:$3"
- }
-
- run_depends() {
- debug_msg " run_depends ($@)"
- (
- if run_details $1 &> /dev/null ; then
- if has_module_file $MODULE DEPENDS ; then
- run_module_file $MODULE DEPENDS | grep -v '%'
- fi
- fi
- )
- }
-
- # here starts the real work:
- MODULE=$1
-
- # remove whatever depends was residing in the depends state file and
- # append the new output:
- lock_file $DEPENDS_STATUS_BACKUP &&
- lock_file $DEPENDS_STATUS &&
- grep -v "^$MODULE:" $DEPENDS_STATUS_BACKUP > $DEPENDS_STATUS &&
- run_depends $MODULE >> $DEPENDS_STATUS
- cat $DEPENDS_STATUS > $DEPENDS_STATUS_BACKUP
- unlock_file $DEPENDS_STATUS
- unlock_file $DEPENDS_STATUS_BACKUP
+ local MODULE
+ debug_msg "rework_module ($@)"
+
+ # we declare these local to override the systems default ones:
+ optional_depends() {
+ local DEP
+ debug_msg " optional_depends ($@)"
+ DEP=$(NEVER_ASK=1 DEPS_ONLY= unalias $1)
+ if module_exiled $DEP ; then
+ echo "$MODULE:$DEP:off:optional:$2:$3"
+ else
+ if module_installed $DEP || module_held $DEP ; then
+ echo "$MODULE:$DEP:on:optional:$2:$3"
+ else
+ echo "$MODULE:$DEP:off:optional:$2:$3"
+ fi
+ fi
+ }
+
+ depends() {
+ local DEP
+ debug_msg " depends ($@)"
+ DEP=$(NEVER_ASK=1 DEPS_ONLY= unalias $1)
+ if ! module_installed $DEP && ! module_held $DEP ; then
+ if ! is_depends $DEP && module_exiled $DEP ; then
+ return 1
+ else
+ CHANGED_MODULES="$CHANGED_MODULES $DEP"
+ fi
+ fi
+
+ echo "$MODULE:$DEP:on:required:$2:$3"
+ }
+
+ run_depends() {
+ debug_msg " run_depends ($@)"
+ (
+ if run_details $1 &> /dev/null ; then
+ if has_module_file $MODULE DEPENDS ; then
+ run_module_file $MODULE DEPENDS | grep -v '%'
+ fi
+ fi
+ )
+ }
+
+ # here starts the real work:
+ MODULE=$1
+
+ # remove whatever depends was residing in the depends state file and
+ # append the new output:
+ lock_file $DEPENDS_STATUS_BACKUP &&
+ lock_file $DEPENDS_STATUS &&
+ grep -v "^$MODULE:" $DEPENDS_STATUS_BACKUP > $DEPENDS_STATUS &&
+ run_depends $MODULE >> $DEPENDS_STATUS
+ cat $DEPENDS_STATUS > $DEPENDS_STATUS_BACKUP
+ unlock_file $DEPENDS_STATUS
+ unlock_file $DEPENDS_STATUS_BACKUP
}
# fix_depends : single pass to fix depends database
fix_depends () {
- local LIST
- debug_msg "fix_depends ($@)"
-
- if [ -n "$1" ] ; then
- LIST="$@"
- else
- LIST=$(grep -v moonbase: $MODULE_STATUS | cut -d: -f1 | sort )
- fi
-
- for MODULE in $LIST ; do
- module_exiled $MODULE || rework_module $MODULE
- done
+ local LIST
+ debug_msg "fix_depends ($@)"
+
+ if [ -n "$1" ] ; then
+ LIST="$@"
+ else
+ LIST=$(grep -v moonbase: $MODULE_STATUS | cut -d: -f1 | sort )
+ fi
+
+ for MODULE in $LIST ; do
+ module_exiled $MODULE || rework_module $MODULE
+ done
}
-
-run_fix() {
- local MODULES MODULE
- debug_msg "run_fix ($@)"
- MODULES=$*
-
- if [ -z "$MODULES" ] ; then
- MODULES=$(list_installed | grep -v moonbase)
- fi
-
- if [[ -n "$FIXDEPENDS" ]] ; then
- for MODULE in $MODULES ; do
- fix_depends $MODULE
- done
- return
- fi
-
- # discover BROKEN modules
- for MODULE in $MODULES ; do
- if ! run_checks $MODULE ; then
- BROKEN_MODULES=( ${BROKEN_MODULES[@]} $MODULE )
- fi
- done
-
- # if we were called with --fixdepends then we may skip the rest
- if [ -n "$FIXDEPENDS" ] ; then
- return
- fi
-
- export TMP_LIN_SUCCESS=$(temp_create "successful")
- export TMP_LIN_FAIL=$(temp_create "failed")
-
- for MODULE in $(sort_by_dependency ${BROKEN_MODULES[@]}) ; do
- (
- run_details $MODULE &&
- if module_installed $MODULE && ! module_held $MODULE ; then
- if ! run_checks $MODULE ; then
- if [[ -n "$NOFIX" ]] ; then
- continue
- fi
- NEVER_ASK=1 DEPS_ONLY= satisfy_depends &&
- NEVER_ASK=1 DEPS_ONLY= FIX= satisfy_depends &&
-
- if ! run_checks $MODULE ; then
- verbose_msg "Attempting to recompile \"$MODULE\""
- if ! FIX= lin --compile $MODULE ; then
- verbose_msg "Attempt to recompile \"$MODULE\" FAILED"
- continue
- elif ! run_checks $MODULE ; then
- verbose_msg "Attempt to recompile \"$MODULE\" succeeded but \"$MODULE\" still is broken!"
- continue
- fi
- fi
- fi
- fi
- )
- done
-
- display_update_log fix
- temp_destroy $TMP_LIN_SUCCESS
- temp_destroy $TMP_LIN_FAIL
+run_fix() {
+ local MODULES MODULE
+ debug_msg "run_fix ($@)"
+ MODULES=$*
+
+ if [ -z "$MODULES" ] ; then
+ MODULES=$(list_installed | grep -v moonbase)
+ fi
+
+ if [[ -n "$FIXDEPENDS" ]] ; then
+ for MODULE in $MODULES ; do
+ fix_depends $MODULE
+ done
+ return
+ fi
+
+ # discover BROKEN modules
+ for MODULE in $MODULES ; do
+ if ! run_checks $MODULE ; then
+ BROKEN_MODULES=( ${BROKEN_MODULES[@]} $MODULE )
+ fi
+ done
+
+ # if we were called with --fixdepends then we may skip the rest
+ if [ -n "$FIXDEPENDS" ] ; then
+ return
+ fi
+
+ export TMP_LIN_SUCCESS=$(temp_create "successful")
+ export TMP_LIN_FAIL=$(temp_create "failed")
+
+ for MODULE in $(sort_by_dependency ${BROKEN_MODULES[@]}) ; do
+ if module_installed $MODULE && ! module_held $MODULE ; then
+ if ! run_checks $MODULE ; then
+ if [[ -n "$NOFIX" ]] ; then
+ continue
+ fi
+ NEVER_ASK=1 DEPS_ONLY= satisfy_depends &&
+ NEVER_ASK=1 DEPS_ONLY= FIX= satisfy_depends &&
+
+ if ! run_checks $MODULE ; then
+ verbose_msg "Attempting to recompile \"$MODULE\""
+ if ! FIX= lin --compile $MODULE ; then
+ verbose_msg "Attempt to recompile \"$MODULE\" FAILED"
+ continue
+ elif ! run_checks $MODULE ; then
+ verbose_msg "Attempt to recompile \"$MODULE\" succeeded but \"$MODULE\" still is broken!"
+ continue
+ fi
+ fi
+ fi
+ fi
+ done
+
+ display_update_log fix
+ temp_destroy $TMP_LIN_SUCCESS
+ temp_destroy $TMP_LIN_FAIL
}
-
-
diff --git a/var/lib/lunar/plugins/check-ldd.plugin b/var/lib/lunar/plugins/check-ldd.plugin
index 359529a..8d4ec77 100644
--- a/var/lib/lunar/plugins/check-ldd.plugin
+++ b/var/lib/lunar/plugins/check-ldd.plugin
@@ -46,5 +46,3 @@ plugin_module_check_ldd() {
plugin_register MODULE_CHECK plugin_module_check_ldd
-
-
More information about the Lunar-commits
mailing list