CVS: theedge/var/lib/lunar/functions build.lunar, 1.7, 1.8 messages.lunar, 1.8, 1.9 tracking.lunar, 1.3, 1.4

sofar at lunar-linux.org sofar at lunar-linux.org
Mon Jul 28 20:29:22 GMT 2003


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv26554/var/lib/lunar/functions

Modified Files:
	build.lunar messages.lunar tracking.lunar 
Log Message:
Rewriting boost, now making things easy and understandable, as well as simple. doing some shuffling with code. All install log parsing code goes to tracking.lunar. Note I removed debug_msgs from message() and verbose_msg() to reduce clutter a bit.


Index: build.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/build.lunar,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- build.lunar	28 Jul 2003 17:41:56 -0000	1.7
+++ build.lunar	28 Jul 2003 20:29:20 -0000	1.8
@@ -558,79 +558,6 @@
 }
 
 
-archive()  {
-  debug_msg "archive ($@)"
-
-  LINES=`wc  -l  <  $INST_LOG`
-  ((  CHUNKS     =  LINES  /  1024  ))
-  ((  REMAINDER  =  LINES  %  1024  ))
-  if  ((  REMAINDER  !=  0  ));  then
-    ((  CHUNKS++  ))
-  fi
-
-  ((  START  =  1     ))
-  ((  STOP   =  1024  ))
-
-  for  ((  CX  =  0  ;  CX  !=  CHUNKS  ;  CX++  ));  do
-
-    md5sum  $(  sed  -n  ${START},${STOP}p  $INST_LOG  |
-                files  )  >> $MD5_LOG
-
-    ((  START   =  STOP  +  1  ))
-    ((  STOP   +=  1024        ))
-
-  done
-
-  if    [  "$ARCHIVE"  ==  "off"  ]
-  then  return
-  fi
-
-  ((  START  =  1     ))
-  ((  STOP   =  1024  ))
-
-  for  ((  CX  =  0  ;  CX  !=  CHUNKS  ;  CX++  ));  do
- 
-    tar  --no-recursion  \
-         -rPf  $CACHE    \
-         $(  sed  -n ${START},${STOP}p  ${INST_LOG}  )
-
-    ((  START   =  STOP  +  1  ))
-    ((  STOP   +=  1024        ))
-
-  done
-
-  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}${CACHE_BZ}${DEFAULT_COLOR}"
-  bzip2  -9f  <  $CACHE  >  $CACHE_BZ
-  rm     -f      $CACHE  
-
-}
-
-
-boost()	{ (
-
-     CACHE="/tmp/$MODULE-$VERSION-$BUILD.tar"
-  CACHE_BZ="$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.bz2"
-  C_LOG_BZ="$COMPILE_LOGS/$MODULE-$VERSION.bz2"
-   TMP_LOG="/tmp/$MODULE-$VERSION"
-  INST_LOG="$INSTALL_LOGS/$MODULE-$VERSION"
-   MD5_LOG="$MD5SUM_LOGS/$MODULE-$VERSION"
-
-  rm  -f   $CACHE
-  rm  -f   $INST_LOG
-  touch    $INST_LOG
-  rm  -f   $TMP_LOG
-  rm  -f   $MD5_LOG
-  touch    $MD5_LOG
-
-  track    &&
-  archive  &&
-  add_module  $MODULE installed $VERSION `find_module_size $MODULE $VERSION`
-
-  rm  -f  $BOOST_LOCK
-
-) }
-
-
 find_pam_aware()  { (
   debug_msg "find_pam_aware ($@)"
 

Index: messages.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/messages.lunar,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- messages.lunar	28 Jul 2003 17:41:56 -0000	1.8
+++ messages.lunar	28 Jul 2003 20:29:20 -0000	1.9
@@ -29,15 +29,18 @@
 
 
 message() {
-  debug_msg "message ($@)"
-  [ -n "$SILENT" ] || echo  -e  "$*"
+  if [ -z "$SILENT" ] ; then
+    echo -e "$*"
+  fi
 }
 
 
 verbose_msg() {
-  debug_msg "verbose_msg ($@)"
-  [ "$VERBOSE" != "on" ] || message "+ $*"
+  if [ "$VERBOSE" == "on" ] ; then
+    message "+ $*"
+  fi
 }
+
 
 debug_msg() {
   if [ -n "$LUNAR_DEBUG" ] ; then

Index: tracking.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/tracking.lunar,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- tracking.lunar	28 Jul 2003 17:41:56 -0000	1.3
+++ tracking.lunar	28 Jul 2003 20:29:20 -0000	1.4
@@ -63,11 +63,16 @@
 }
 
 
-# function : track
-# usage    : track
+# function : create_install_log
+# usage    : create_install_log
 # purpose  : create an install log
-track() {
-  debug_msg "track ($@)"
+create_install_log() {
+  debug_msg "create_install_log ($@)"
+
+  TMP_INST_LOG=$(temp_create "install-log")
+  INST_LOG="$INSTALL_LOGS/$MODULE-$VERSION"
+  rm -f $INST_LOG &> /dev/null
+
   message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}${INST_LOG}${DEFAULT_COLOR}"
 
   export IFS="$TAB_ENTER_IFS"
@@ -77,21 +82,66 @@
   uniq                       |
   filter  "$EXCLUDED"        |
   filter  "$LOCAL_EXCLUDED"  |
-  exists                     >  $TMP_LOG
+  exists                     >  $TMP_INST_LOG
 
-  echo  "$C_LOG_BZ"         >>  $TMP_LOG
-  echo  "$MD5_LOG"          >>  $TMP_LOG
-  echo  "$INST_LOG"         >>  $TMP_LOG
+  if [ "$ARCHIVE" == "on" ] ; then
+    echo "$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.bz2" >> $TMP_INST_LOG
+  fi
+  echo "$INSTALL_LOGS/$MODULE-$VERSION"                 >> $TMP_INST_LOG
+  echo "$COMPILE_LOGS/$MODULE-$VERSION.bz2"             >> $TMP_INST_LOG
+  echo "$MD5SUM_LOGS/$MODULE-$VERSION"                  >> $TMP_INST_LOG
 
-  MISOWNED_SYMLINKS=`syms_not_owned  $TMP_LOG
-                     echo  -n  "/dev/null"`
+  MISOWNED_SYMLINKS=$(syms_not_owned  $TMP_INST_LOG
+                      echo  -n  "/dev/null")
 
-  if    [  "$MISOWNED_SYMLINKS"  ==  "/dev/null"  ]
-  then  cp  $TMP_LOG  $INST_LOG
-  else  grep  -v  "$MISOWNED_SYMLINKS"  $TMP_LOG  >  $INST_LOG
+  if [ "$MISOWNED_SYMLINKS" == "/dev/null" ] ; then
+    cp $TMP_INST_LOG $INST_LOG
+  else
+    grep -v "$MISOWNED_SYMLINKS" $TMP_INST_LOG > $INST_LOG
   fi
 
-  rm  -f  $TMP_LOG
+  temp_destroy $TMP_INST_LOG
+}
+
+
+create_md5sum_log()  {
+  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
+
 }
+
+create_install_cache() {
+  debug_msg "create_install_cache($@)"
+
+  if [ "$ARCHIVE" == "off" ] ; then
+    return
+  fi
+
+  message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.bz2${DEFAULT_COLOR}"
+  tar cPjf "$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.bz2" --no-recursion -T $INSTALL_LOGS/$MODULE-$VERSION
+
+}
+
+
+boost()	{ (
+  debug_msg "boost ($@)"
+
+  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)"
+
+  rm  -f  $BOOST_LOCK
+
+) }
 
 




More information about the Lunar-commits mailing list