CVS: brutus/elaine/lunar+versions/functions install.lunar, 1.1, 1.2 locking.lunar, 1.1, 1.2

elaine at lunar-linux.org elaine at lunar-linux.org
Fri Sep 5 03:41:56 GMT 2003


Update of /var/cvs/lunar/brutus/elaine/lunar+versions/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv1769

Modified Files:
	install.lunar locking.lunar 
Log Message:
fixed locking and status/log files


Index: install.lunar
===================================================================
RCS file: /var/cvs/lunar/brutus/elaine/lunar+versions/functions/install.lunar,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- install.lunar	5 Sep 2003 01:15:08 -0000	1.1
+++ install.lunar	5 Sep 2003 03:41:54 -0000	1.2
@@ -124,11 +124,12 @@
 
 stop_logging() {
   debug_msg "stop_logging ($@)"
+  MOD_SNAME=$(echo $MODULE | sed 's:/:.:g')
   message  "${MESSAGE_COLOR}Creating"                        \
-           "${FILE_COLOR}$COMPILE_LOGS/$MODULE-$VERSION.bz2"  \
+           "${FILE_COLOR}$COMPILE_LOGS/$MOD_SNAME-$VERSION.bz2"  \
            "${DEFAULT_COLOR}"
 
-  bzip2 -9f < $C_LOG > $COMPILE_LOGS/$MODULE-$VERSION.bz2
+  bzip2 -9f < $C_LOG > $COMPILE_LOGS/$MOD_SNAME-$VERSION.bz2
   temp_destroy $C_LOG
   temp_destroy $C_FIFO
 }
@@ -412,7 +413,7 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected during ${FILE_COLOR}$LIN_ERROR${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MODULE-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MOD_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
       activity_log  "lin"  "$MODULE"  "$VERSION"  "failed" "Due to build errors during $LIN_ERROR"
       return 1
     fi  
@@ -433,13 +434,13 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected during ${FILE_COLOR}$LIN_ERROR${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MODULE-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MOD_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
       activity_log  "lin"  "$MODULE"  "$VERSION"  "failed" "Due to build errors during $LIN_ERROR"
       return 1
     fi
 
     rm_source_dir               &&
-    report $INSTALL_LOGS/$MODULE-$VERSION "install log" $MODULE $VERSION &&
+    report $INSTALL_LOGS/$MOD_SNAME-$VERSION "install log" $MODULE $VERSION &&
     rm -f $linING               &&
     sound SUCCESS               &&
     activity_log  "lin"  "$MODULE"  "$VERSION"  "success"
@@ -448,7 +449,7 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MODULE-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MOD_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
       activity_log  "lin"  "$MODULE"  "$VERSION"  "failed" "Due to build errors during or after $LIN_ERROR"
       return 1
     fi

Index: locking.lunar
===================================================================
RCS file: /var/cvs/lunar/brutus/elaine/lunar+versions/functions/locking.lunar,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- locking.lunar	5 Sep 2003 01:15:08 -0000	1.1
+++ locking.lunar	5 Sep 2003 03:41:54 -0000	1.2
@@ -25,9 +25,13 @@
       #locking is disabled if ln or rm not found!!
       [ -x "/bin/ln" ] || return 0
       [ -x "/bin/rm" ] || return 0
-      LOCK_SNAME=$(echo $1 | sed 's:/:.:g')
-      TEMPFILE="$LOCK_SNAME.$$"
-      LOCKFILE="$LOCK_SNAME.lock"
+#      LOCK_SNAME=$(echo $1 | sed 's:/:.:g')
+#      TEMPFILE="$LOCK_SNAME.$$"
+#      LOCKFILE="$LOCK_SNAME.lock"
+
+      TEMPFILE="$1.$$"
+      LOCKFILE="$1.lock"
+
       echo $$ > $TEMPFILE 2>/dev/null ||
       {
          message "${PROBLEM_COLOR}You don't have permission to access" \
@@ -58,7 +62,8 @@
       return 1
    }
 
-   while ! file_lock $LOCK_SNAME
+   while ! file_lock $1
+#   while ! file_lock $LOCK_SNAME
    do
       message "${MESSAGE_COLOR}Waiting to lock the file $1${DEFAULT_COLOR}"
       sleep 1
@@ -72,10 +77,11 @@
 # purpose : unlocks a file
 function unlock_file() {
   debug_msg "unlock_file ($@)"
-  LOCK_SNAME=$(echo $1 | sed 's:/:.:g')
+#  LOCK_SNAME=$(echo $1 | sed 's:/:.:g')
   #unlocking is disabled if rm not found!!
   [ -x "/bin/rm" ] || return 0
-  rm -f $LOCK_SNAME.lock 2>/dev/null && return 0
+  rm -f $1.lock 2>/dev/null && return 0
+#  rm -f $LOCK_SNAME.lock 2>/dev/null && return 0
   return 1
 }
 




More information about the Lunar-commits mailing list