[Lunar-commits] CVS: theedge/var/lib/lunar/functions depends.lunar,
1.37, 1.38 main.lunar, 1.14, 1.15 messages.lunar, 1.15,
1.16 modules.lunar, 1.39, 1.40 prune.lunar, 1.9,
1.10 recovery.lunar, 1.4, 1.5
Auke Kok
sofar at lunar-linux.org
Sun May 9 12:08:57 GMT 2004
Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv14252/var/lib/lunar/functions
Modified Files:
depends.lunar main.lunar messages.lunar modules.lunar
prune.lunar recovery.lunar
Log Message:
Some bugfixes regarding locking, ordering of locks and return status of locking, some fixes with missing depends (important one), visual adjustment of titlebar display (compile instead of processing, added hostname, $0[$$]).
Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- depends.lunar 11 Apr 2004 21:54:36 -0000 1.37
+++ depends.lunar 9 May 2004 12:08:55 -0000 1.38
@@ -238,6 +238,16 @@
TMP_FILE=$(temp_create "${MODULE}.satify-depends")
grep "^$MODULE:" $DEPENDS_STATUS > $TMP_FILE
+ # first recursively check if all required dependencies are installed
+ for DEP_MODULE in $(find_depends $MODULE) ; do
+ if ! module_installed $DEP_MODULE ; then
+ if ! SINGLE_MODULE=1 lin $SILENT $COMPILE $DEP_MODULE ; then
+ exit 1
+ fi
+ fi
+ done
+
+ # then parse $OPTS
while read LINE; do
DEP_MODULE=$(echo $LINE | cut -d: -f2)
DEP_STATUS=$(echo $LINE | cut -d: -f3)
@@ -261,7 +271,7 @@
OPTS="$OPTS $DEP_ON"
fi
done < $TMP_FILE
-
+
temp_destroy $TMP_FILE
}
Index: main.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/main.lunar,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- main.lunar 2 May 2004 09:32:59 -0000 1.14
+++ main.lunar 9 May 2004 12:08:55 -0000 1.15
@@ -166,7 +166,7 @@
lin_module() {
(
debug_msg "lin_module ($@)"
- xterm_msg "lin: Processing $1"
+ xterm_msg "compiling $1"
# make sure we got all the info
if ! run_details $1 ; then
return 1
Index: messages.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/messages.lunar,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- messages.lunar 23 Feb 2004 21:15:53 -0000 1.15
+++ messages.lunar 9 May 2004 12:08:55 -0000 1.16
@@ -72,7 +72,8 @@
debug_msg "xterm_bar ($@)"
case $TERM in
xterm*|gnome*|konsole*|rxvt*)
- echo -n "]0; $* "
+ MSG="$(hostname) $(basename $0)[$$]: $@"
+ echo -n "]0; $MSG "
;;
esac
}
Index: modules.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/modules.lunar,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- modules.lunar 16 Apr 2004 10:18:49 -0000 1.39
+++ modules.lunar 9 May 2004 12:08:55 -0000 1.40
@@ -298,14 +298,14 @@
hold_modules() {
debug_msg "hold_modules ($@)"
if [ -n "$1" ] ; then
- lock_file $MODULE_STATUS_BACKUP
- lock_file $MODULE_STATUS
+ lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
for MODULE in "$@" ; do
grep -v "^$MODULE:" $MODULE_STATUS > $MODULE_STATUS_BACKUP
grep "^$MODULE:" $MODULE_STATUS | sed "s:installed:held:" >> $MODULE_STATUS_BACKUP
cp $MODULE_STATUS_BACKUP $MODULE_STATUS
- done
- unlock_file $MODULE_STATUS
+ done &&
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP
fi
}
@@ -317,14 +317,14 @@
unhold_modules () {
debug_msg "unhold_modules ($@)"
if [ -n "$1" ] ; then
- lock_file $MODULE_STATUS_BACKUP
- lock_file $MODULE_STATUS
+ lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
for MODULE in "$@" ; do
grep -v "^$MODULE:" $MODULE_STATUS > $MODULE_STATUS_BACKUP
grep "^$MODULE:" $MODULE_STATUS | sed "s:held:installed:" >> $MODULE_STATUS_BACKUP
cp $MODULE_STATUS_BACKUP $MODULE_STATUS
- done
- unlock_file $MODULE_STATUS
+ done &&
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP
fi
}
@@ -336,8 +336,8 @@
exile_modules() {
debug_msg "exile_modules ($@)"
if [ -n "$1" ] ; then
- lock_file $MODULE_STATUS_BACKUP
- lock_file $MODULE_STATUS
+ lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
for MODULE in "$@" ; do
if $(module_installed $MODULE) ; then
grep -v "^$MODULE:" $MODULE_STATUS > $MODULE_STATUS_BACKUP
@@ -346,8 +346,8 @@
echo "$MODULE::exiled:0.0" >> $MODULE_STATUS_BACKUP
fi
cp $MODULE_STATUS_BACKUP $MODULE_STATUS
- done
- unlock_file $MODULE_STATUS
+ done &&
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP
fi
}
@@ -359,14 +359,14 @@
unexile_modules () {
debug_msg "unexile_modules ($@)"
if [ -n "$1" ] ; then
- lock_file $MODULE_STATUS_BACKUP
- lock_file $MODULE_STATUS
+ lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
for MODULE in "$@" ; do
grep -v "^$MODULE:" $MODULE_STATUS > $MODULE_STATUS_BACKUP
grep "^$MODULE:" $MODULE_STATUS | sed "s:exiled:installed:" >> $MODULE_STATUS_BACKUP
cp $MODULE_STATUS_BACKUP $MODULE_STATUS
- done
- unlock_file $MODULE_STATUS
+ done &&
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP
fi
}
@@ -393,23 +393,23 @@
fi
verbose_msg "updating lunar state files after module removal"
- lock_file $MODULE_STATUS &&
lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
grep -v "^$1:" $MODULE_STATUS_BACKUP > $MODULE_STATUS 2>/dev/null
cat $MODULE_STATUS > $MODULE_STATUS_BACKUP 2>/dev/null
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP &&
- unlock_file $MODULE_STATUS
if [ -n "$EXILE" ] ; then
- lock_file $MODULE_STATUS &&
lock_file $MODULE_STATUS_BACKUP &&
+ lock_file $MODULE_STATUS &&
echo "$1::exiled:0.0" >> $MODULE_STATUS &&
cat $MODULE_STATUS > $MODULE_STATUS_BACKUP &&
+ unlock_file $MODULE_STATUS &&
unlock_file $MODULE_STATUS_BACKUP &&
- unlock_file $MODULE_STATUS
- lock_file $DEPENDS_STATUS &&
lock_file $DEPENDS_STATUS_BACKUP &&
+ lock_file $DEPENDS_STATUS &&
grep -v ":$1:" $DEPENDS_STATUS_BACKUP > $DEPENDS_STATUS &&
cat $DEPENDS_STATUS > $DEPENDS_STATUS_BACKUP &&
unlock_file $DEPENDS_STATUS &&
@@ -430,13 +430,14 @@
fi
verbose_msg "updating lunar state files after module installation"
- lock_file $MODULE_STATUS &&
lock_file $MODULE_STATUS_BACKUP &&
- grep -v "^$1:" $MODULE_STATUS_BACKUP > $MODULE_STATUS 2>/dev/null &&
- echo "$1:`date -u +%Y%m%d`:$2:$3:$4" >> $MODULE_STATUS &&
- cat $MODULE_STATUS > $MODULE_STATUS_BACKUP &&
- unlock_file $MODULE_STATUS_BACKUP &&
- unlock_file $MODULE_STATUS
+ lock_file $MODULE_STATUS &&
+ # the next statement MUST be allowed to fail if statfiles are empty:
+ grep -v "^$1:" $MODULE_STATUS_BACKUP > $MODULE_STATUS 2>/dev/null
+ echo "$1:$(date -u +%Y%m%d):$2:$3:$4" >> $MODULE_STATUS &&
+ cp $MODULE_STATUS $MODULE_STATUS_BACKUP &&
+ unlock_file $MODULE_STATUS &&
+ unlock_file $MODULE_STATUS_BACKUP
}
Index: prune.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/prune.lunar,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- prune.lunar 15 Mar 2004 22:54:34 -0000 1.9
+++ prune.lunar 9 May 2004 12:08:55 -0000 1.10
@@ -59,7 +59,7 @@
temp_destroy $TMP_CACHE_KEEP
# the log files are easy:
- LOGS=$(cat $MODULE_STATUS_BACKUP | cut -d: -f1,4 --output-delimiter="-")
+ LOGS=$(cat $MODULE_STATUS | cut -d: -f1,4 --output-delimiter="-")
verbose_msg "finding stale install logs"
for FILE in $(ls $INSTALL_LOGS) ; do
Index: recovery.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/recovery.lunar,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- recovery.lunar 2 May 2004 09:32:59 -0000 1.4
+++ recovery.lunar 9 May 2004 12:08:55 -0000 1.5
@@ -50,33 +50,28 @@
"${PROBLEM_COLOR}DO NOT BREAK!!" \
"${DEFAULT_COLOR}"
- trap "" 2
- LOG_FILES=`ls -rt $INSTALL_LOGS`
+ LOG_FILES=$(ls -rt $INSTALL_LOGS)
for MODULE_NAME in $LOG_FILES; do
- let "COUNTS=3"
- REAL_NAME=$MODULE_NAME
- unset SECTION
- while [ "$COUNTS" -gt "0" ]; do
- REAL_NAME=`echo $REAL_NAME | cut -d "-" -f -"$COUNTS"`
- SECTION=`find_section $REAL_NAME`
- if [ -n "$SECTION" ]; then
- let "COUNTS++"
- VERSION=`echo $MODULE_NAME | cut -d "-" -f "$COUNTS"-`
- add_module $REAL_NAME installed $VERSION
- OUTTEXT="Processing: $REAL_NAME-$VERSION "
- echo -en "$OUTTEXT"
- for ((II=1; II<=${#OUTTEXT}; II++)); do echo -en "\b"; done
- break;
- fi
- let "COUNTS--"
- done
- done
- echo " "
- cp $MODULE_STATUS $MODULE_STATUS_BACKUP
- message "${MESSAGE_COLOR}Success!!" \
- "${DEFAULT_COLOR}\n"
+ COUNTS=3
+ REAL_NAME=$MODULE_NAME
+ unset SECTION
+ while [ "$COUNTS" -gt "0" ]; do
+ REAL_NAME=$(echo $REAL_NAME | cut -d "-" -f -"$COUNTS")
+ SECTION=$(find_section $REAL_NAME)
+ if [ -n "$SECTION" ]; then
+ ((COUNTS++))
+ VERSION=$(echo $MODULE_NAME | cut -d "-" -f "$COUNTS"-)
+ SIZE=$(find_module_size $REAL_NAME $VERSION)
+ add_module $REAL_NAME installed $VERSION $SIZE
+ message "Added: $REAL_NAME-$VERSION ($SIZE)"
+ break;
+ fi
+ ((COUNTS--))
+ done
+ done
- trap 2
+ message "${MESSAGE_COLOR}Success!!" \
+ "${DEFAULT_COLOR}\n"
}
More information about the Lunar-commits
mailing list