CVS: theedge/var/lib/lunar/functions build.lunar, 1.5, 1.6 download.lunar, 1.26, 1.27 install.lunar, 1.8, 1.9 messages.lunar, 1.6, 1.7 temp.lunar, 1.1, 1.2

sofar at lunar-linux.org sofar at lunar-linux.org
Sun Jul 27 23:05:34 GMT 2003


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

Modified Files:
	build.lunar download.lunar install.lunar messages.lunar 
	temp.lunar 
Log Message:
adding debugging code, to use do: DEBUG=on lin $MODULE (or any other lunar core program)


Index: build.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/build.lunar,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- build.lunar	23 Jul 2003 22:54:16 -0000	1.5
+++ build.lunar	27 Jul 2003 23:05:32 -0000	1.6
@@ -26,6 +26,7 @@
 
 
 save_libraries()  {
+  debug_msg "save_libraries ($@)"
 
   [ "$MODULE" == "glibc" ] && return 0
 
@@ -72,6 +73,7 @@
 
 
 release_saved_libraries()  {
+  debug_msg "release_saved_libraries ($@)"
    OLD_LIBS=$SOURCE_DIRECTORY/old.libraries
    SAVED=$OLD_LIBS/$MODULE.saved.libraries
 
@@ -87,6 +89,7 @@
 
 
 prepare_install() {
+  debug_msg "prepare_install ($@)"
   if  module_installed $MODULE  || module_held $MODULE ; then
     message  "${MESSAGE_COLOR}Preparing to install"  \
              "${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}"
@@ -106,6 +109,7 @@
 
 
 rm_source_dir() {
+  debug_msg "rm_source_dir ($@)"
 
   [ "$KEEP_SOURCE" == "on" ] && return 0
 
@@ -129,6 +133,7 @@
 
 
 mk_source_dir() {
+  debug_msg "mk_source_dir ($@)"
 
   cd  $BUILD_DIRECTORY
 
@@ -151,6 +156,7 @@
 
 
 validate_source_dir()  {
+  debug_msg "validate_source_dir ($@)"
 
   verbose_msg "validating \"$SOURCE_DIRECTORY\""
   if  [  -n    "$SOURCE_DIRECTORY"                                   ]  &&
@@ -169,6 +175,7 @@
 
 
 default_pre_build() {
+  debug_msg "default_pre_build ($@)"
   verbose_msg "running \"default_pre_build\""
   if [[ $CVS_SERVER ]]; then
     validate_source_dir  $SOURCE_DIRECTORY
@@ -196,6 +203,7 @@
 
 
 default_config() {
+  debug_msg "default_config ($@)"
    verbose_msg "running \"default_config\""
 
    verbose_msg "CFLAGS=\"$CFLAGS\""            &&
@@ -213,6 +221,7 @@
 
 
 default_cvs_config() {
+  debug_msg "default_cvs_config ($@)"
    verbose_msg "running \"default_cvs_config\""
 
    verbose_msg "CFLAGS=\"$CFLAGS\""            &&
@@ -230,6 +239,7 @@
 
 
 default_make() {
+  debug_msg "default_make ($@)"
    verbose_msg "running \"default_make\""
    make                               &&
    prepare_install                    &&
@@ -238,6 +248,7 @@
 
 
 default_build() {
+  debug_msg "default_build ($@)"
    verbose_msg "running \"default_build\""
    default_config  &&
    default_make
@@ -245,6 +256,7 @@
 
 
 default_cvs_build() {
+  debug_msg "default_cvs_build ($@)"
    verbose_msg "running \"default_cvs_build\""
    default_cvs_config  &&
    default_make
@@ -252,6 +264,7 @@
 
 
 default_post_build() {
+  debug_msg "default_post_build ($@)"
   {
     gather_docs
 
@@ -273,6 +286,7 @@
 # usage    : remove_module; but $MODULE must be defined earlier
 # purpose  : removed a module from the MODULE_STATUS files, no source removal
 remove_module() {
+  debug_msg "remove_module ($@)"
 
   verbose_msg "updating lunar state files after module removal"
   lock_file $MODULE_STATUS                                     && 
@@ -304,6 +318,7 @@
 # usage   : add_module <module_name>
 # purpose : adds the 1st parameter as the module name to the MODULE_STATUS files
 add_module()  {
+  debug_msg "add_module ($@)"
   verbose_msg "updating lunar state files after module installation"
   lock_file $MODULE_STATUS                                    && 
   lock_file $MODULE_STATUS_BACKUP                             &&
@@ -316,6 +331,7 @@
 
 
 push_install_queue() {
+  debug_msg "push_install_queue ($@)"
   remove_queue   $REMOVE_QUEUE    "$1"
   remove_queue   $INSTALL_QUEUE   "$1"
   !  module_installed             "$1"  &&
@@ -324,6 +340,7 @@
 
 
 push_remove_queue() {
+  debug_msg "push_remove_queue ($@)"
 
   remove_queue   $INSTALL_QUEUE  "$1"
   remove_queue   $REMOVE_QUEUE   "$1"
@@ -336,6 +353,7 @@
 # usage    : sort_install_queue
 # purpose  : sorts the install queue according to the dependencies
 sort_install_queue() {
+  debug_msg "sort_install_queue ($@)"
    for MODULE in $@; do
      QUEUE="$QUEUE $MODULE"
      show_fancy_progress "Processing: $MODULE"
@@ -354,6 +372,7 @@
 # usage    : purge_modules
 # purpose  : purge modules that were removed from moonbase
 purge_modules() {
+  debug_msg "purge_modules ($@)"
   verbose_msg "Discovering modules that were removed from moonbase"
   for MODULE in $(list_installed | grep -v "^moonbase$") ; do
     if ! run_details $MODULE &> /dev/null ; then
@@ -373,6 +392,7 @@
 # usage    : list_expired_modules
 # purpose  : return a list of modules that need to be updated
 list_expired_modules() {
+  debug_msg "list_expired_modules ($@)"
   for LINE in $(cat $MODULE_STATUS | grep -v "^moonbase" | sort) ; do
     MODULE=$(echo "$LINE" | cut -d: -f1)
     IDATE=$(echo "$LINE" | cut -d: -f2)
@@ -396,6 +416,7 @@
 # usage    : LIST=$(sort_by_dependency $LIST)
 # purpose  : return a LIST sorted by dependency
 sort_by_dependency() {
+  debug_msg "sort_by_dependency ($@)"
   LIST=$@
   for MODULE in $LIST ; do
     unset DEPS
@@ -421,6 +442,7 @@
 # usage    : update_modules
 # purpose  : update all installed modules that need to be updated
 update_modules() {(
+  debug_msg "update_modules ($@)"
 
   export IFS="$STANDARD_IFS"
 
@@ -458,6 +480,7 @@
 
 
 log_list()  {
+  debug_msg "log_list ($@)"
 
    echo `cat  $MODULE_STATUS_BACKUP                | \
          cut  -d  :  -f1,4 --output-delimiter="-"`
@@ -466,6 +489,7 @@
 
 
 clean_logs()  {
+  debug_msg "clean_logs ($@)"
 
   LOGS=`log_list`
 
@@ -493,6 +517,7 @@
 }
 
 activity_log()  { (
+  debug_msg "activity_log ($@)"
 
     DATE=`date  -u  +%Y%m%d-%T`
   COMMAND=$1
@@ -508,6 +533,7 @@
 
 
 syms_not_owned()  {
+  debug_msg "syms_not_owned ($@)"
 
   cat  $1  |
   while read ITEM ; do
@@ -534,7 +560,8 @@
 
 
 archive()  {
-
+  debug_msg "archive ($@)"
+  
   LINES=`wc  -l  <  $INST_LOG`
   ((  CHUNKS     =  LINES  /  1024  ))
   ((  REMAINDER  =  LINES  %  1024  ))
@@ -581,6 +608,7 @@
 
 
 boost()	{ (
+  debug_msg "boost ($@)"
 
      CACHE="/tmp/$MODULE-$VERSION-$BUILD.tar"
   CACHE_BZ="$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.bz2"
@@ -606,6 +634,7 @@
 
 
 find_pam_aware()  { (
+  debug_msg "find_pam_aware ($@)"
 
   cat  $MODULE_STATUS_BACKUP  |
   while  read  LINE;  do

Index: download.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/download.lunar,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- download.lunar	24 Jul 2003 22:04:02 -0000	1.26
+++ download.lunar	27 Jul 2003 23:05:32 -0000	1.27
@@ -34,6 +34,7 @@
 
 
 get_svn() {(
+  debug_msg "get_svn ($@)"
   if ! module_installed subversion ; then
     message "${PROBLEM_COLOR}! Cannot fetch SVN sources without \"subversion\" installed${DEFAULT_COLOR}"
     exit 1
@@ -99,6 +100,7 @@
 
 
 get_cvs() {(
+  debug_msg "get_cvs ($@)"
   if ! module_installed cvs ; then
     message "${PROBLEM_COLOR}! Cannot fetch CVS sources without \"cvs\" installed!${DEFAULT_COLOR}"
     exit 1
@@ -183,6 +185,7 @@
 
 
 erase()  {
+  debug_msg "erase ($@)"
   if [ "$PARTIAL" = "off" ]; then
     verbose_msg "erase: deleting \"$(guess_filename $1)\""
     rm -f $(guess_filename $1)
@@ -191,6 +194,7 @@
 
 
 call_wget()  {  
+  debug_msg "call_wget ($@)"
    [ -n "$http_proxy" ] && export http_proxy=$http_proxy
    [ -n  "$ftp_proxy" ] && export  ftp_proxy=$ftp_proxy
    [ -n   "$no_proxy" ] && export   no_proxy=$no_proxy
@@ -201,6 +205,7 @@
 
 
 fuzzy_wget()  {
+  debug_msg "fuzzy_wget ($@)"
 
   FTP_CONNECTION="--passive-ftp"
   [ "$FTP_ACTIVE"  == "on"   ] || 
@@ -250,6 +255,7 @@
 
 
 get_url() {
+  debug_msg "get_url ($@)"
   if  [  -n  "$1"  ] ;  then
     if [ "${1:0:6}" == "cvs://" ] ; then
       # cvs urls
@@ -306,11 +312,13 @@
 
 
 lget_lock()  {
+  debug_msg "lget_lock ($@)"
   echo $$ > /var/lock/lgetting.$1
 }
 
 
 lget_locked()  {
+  debug_msg "lget_locked ($@)"
   if [ -f "/var/lock/lgetting.$1" ] &&
         ps `cat /var/lock/lgetting.$1` | grep  -q  "lget" ; then
     true
@@ -321,11 +329,13 @@
 
 
 lget_unlock()  {
+  debug_msg "lget_unlock ($@)"
   rm -f /var/lock/lgetting.$1 &> /dev/null
 }
 
 
 download_module() { (
+  debug_msg "download_module ($@)"
   if ! run_details $1 ; then
     exit 1
   fi
@@ -390,6 +400,7 @@
 
 
 testpack () {
+  debug_msg "testpack ($@)"
   FILENAME=`guess_filename $1` || FILENAME=`guess_filename $SOURCE_CACHE/$1`
   if [ -f $FILENAME ] ; then
     COMPRESSOR=`file -b $FILENAME | cut -d ' ' -f1`

Index: install.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/install.lunar,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- install.lunar	25 Jul 2003 08:52:16 -0000	1.8
+++ install.lunar	27 Jul 2003 23:05:32 -0000	1.9
@@ -28,6 +28,7 @@
 
 
 check_blacklist() {
+  debug_msg "check_blacklist ($@)"
   #Copyrighted Jason Johnston  2002 under GPLv2
 
   # This checks the /var/state/lunar/gcc.<platform>
@@ -58,18 +59,21 @@
 
 
 run_conflicts() {
+  debug_msg "run_conflicts ($@)"
   run_module_file $MODULE CONFLICTS
 }
 
 
 # create the dependency files if they do not exist
 prepare_depends_status()  {
+  debug_msg "prepare_depends_status ($@)"
   [ -f $DEPENDS_STATUS ]        || touch  $DEPENDS_STATUS
   [ -f $DEPENDS_STATUS_BACKUP ] || touch  $DEPENDS_STATUS_BACKUP
 }
 
 
 prepare_module_config()  {
+  debug_msg "prepare_module_config ($@)"
   if [ ! -x $MODULE_CONFIG  ] ; then
     touch $MODULE_CONFIG
     chmod a+x $MODULE_CONFIG
@@ -79,6 +83,7 @@
 
 # run the CONFIGURE script
 run_configure() {
+  debug_msg "run_configure ($@)"
   if [ -n "$RECONFIGURE" ];  then
     verbose_msg "Reconfiguring \"$MODULE\""
     rm -f $DEPENDS_CONFIG/$MODULE
@@ -98,6 +103,7 @@
 
 
 run_pre_build() {
+  debug_msg "run_pre_build ($@)"
   message "${MESSAGE_COLOR}Building ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
 
   cd $BUILD_DIRECTORY
@@ -117,6 +123,7 @@
 
 
 stop_logging() {
+  debug_msg "stop_logging ($@)"
   message  "${MESSAGE_COLOR}Creating"                        \
            "${FILE_COLOR}$COMPILE_LOGS/$MODULE-$VERSION.bz2"  \
            "${DEFAULT_COLOR}"
@@ -128,6 +135,7 @@
 
 
 start_logging () {
+  debug_msg "start_logging ($@)"
   export C_LOG=$(temp_create "${MODULE}.compile-log")
   export C_FIFO=$(temp_create "${MODULE}.compile-fifo")
 
@@ -141,6 +149,7 @@
 
 
 activate_voyeur()  {
+  debug_msg "activate_voyeur ($@)"
   if [ -z "$SILENT" ] ; then
     case $VOYEUR in
       on) tee -a $C_LOG < $C_FIFO              & ;;
@@ -153,6 +162,7 @@
 
 
 run_build()  {
+  debug_msg "run_build ($@)"
   if [ -d "$SOURCE_DIRECTORY" ] ; then
     cd $SOURCE_DIRECTORY
   fi
@@ -185,6 +195,7 @@
 
 
 run_post_build() {
+  debug_msg "run_post_build ($@)"
   if [ -s $SCRIPT_DIRECTORY/POST_BUILD ] ; then
     run_module_file $MODULE POST_BUILD
   fi
@@ -193,6 +204,7 @@
 
 
 run_post_install() {
+  debug_msg "run_post_install ($@)"
   if [ -s $SCRIPT_DIRECTORY/POST_INSTALL ] ; then
     run_module_file $MODULE POST_INSTALL
   fi
@@ -200,6 +212,7 @@
 
 
 export_ld()  {
+  debug_msg "export_ld ($@)"
   for  DIRECTORY  in  $*;  do
     if  file  -b  $DIRECTORY/*.so*  |
         grep  -q  "shared object"
@@ -215,6 +228,7 @@
 
 
 show_owner()  {
+  debug_msg "show_owner ($@)"
   OWNER=`grep  $TARGET  $INSTALL_LOGS/*  |
          cut  -d :  -f1                  |
          sed  -n  1p`
@@ -225,6 +239,7 @@
 
 
 remove_line()  {
+  debug_msg "remove_line ($@)"
   F_TMP=$(temp_create "${MODULE}.remove-line")
   cp $I_LOG $F_TMP
   grep -v $ITEM $F_TMP > $I_LOG
@@ -239,6 +254,7 @@
 
 
 run_fix()  { (
+  debug_msg "run_fix ($@)"
   MODULES=$*
 
   if  [  -z  "$MODULES"  ];  then
@@ -318,6 +334,7 @@
 
 
 resurrect()  {  ( 
+  debug_msg "resurrect ($@)"
   if ! run_details $1 ; then
     return 1
   fi
@@ -349,6 +366,7 @@
 
 
 show_download_progress()  {
+  debug_msg "show_download_progress ($@)"
   if [ -f "$TEMP_DOWNLOADLOG" ] ; then
     if [ -z "$LC_OLD" ] ; then
       LC_OLD=0
@@ -366,6 +384,7 @@
 
 
 show_downloading() {
+  debug_msg "show_downloading ($@)"
   if [ -e "$TEMP_DOWNLOADLOG" ] ; then
     verbose_msg "====== download progess:"
     while ! lget $MODULE >> $TEMP_DOWNLOADLOG 2>&1 ; do
@@ -380,6 +399,7 @@
 
 
 lin_module()  { (
+  debug_msg "lin_module ($@)"
   # make sure we got all the info
   if ! run_details $1 ; then
     return 1
@@ -500,6 +520,7 @@
 
 
 lin_locked()  {
+  debug_msg "lin_locked ($@)"
   [     -f        /var/lock/installing.$1  ]  &&
   ps        `cat  /var/lock/installing.$1`    |
   grep  -q  "lin"
@@ -507,6 +528,7 @@
 
 
 solo_locked()  {
+  debug_msg "solo_locked ($@)"
   for SOLO_MODULE in `cat $SOLO` ; do
     if lin_locked $SOLO_MODULE ; then
       message  "${PROBLEM_COLOR}lining${DEFAULT_COLOR}"  \
@@ -521,6 +543,7 @@
 
 
 current_locked() {
+  debug_msg "current_locked ($@)"
   if  lin_locked  $MODULE;  then
     message  "${QUERY_COLOR}Detected lin lock file: ${FILE_COLOR}${linING}${MESSAE_COLOR}"
     message  "${MESSAGE_COLOR}Now waiting for ${MODULE_COLOR}${MODULE}${DEFAULTT_COLOR}${MESSAGE_COLOR}to finish installing or for the lock to clear."
@@ -534,6 +557,7 @@
 
 
 build_depends()  {
+  debug_msg "build_depends ($@)"
   for MODULE in $@ ; do
     if ! module_installed $MODULE || [ ! -n "$PROBE" ] ; then
       if ! module_held $MODULE ; then

Index: messages.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/messages.lunar,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- messages.lunar	14 Jul 2003 22:38:20 -0000	1.6
+++ messages.lunar	27 Jul 2003 23:05:32 -0000	1.7
@@ -39,8 +39,16 @@
 }
 
 
+debug_msg() {
+  if [ -n "$DEBUG" ] ; then
+    echo "++ $@" > /dev/stderr
+  fi
+}
+
+
 # function : report FILE [description] MODULE VERSION
 report() {
+  debug_msg "report ($@)"
   if [ ! -f "$1" ] ; then
     return
   fi
@@ -67,6 +75,7 @@
 
 
 query() {
+  debug_msg "query ($@)"
   #  2 arguments
   #  query  "what do you want?  "  DEFAULT
 
@@ -102,6 +111,7 @@
 
 
 color()  {
+  debug_msg "color($@)"
   case  $1  in
     off)  unset  MODULE_COLOR
           unset  VERSION_COLOR
@@ -123,6 +133,7 @@
 
 
 sound()  {
+  debug_msg "sound ($@)"
   case  $SOUND  in
     on)  SOUND_FILE=$SOUND_DIRECTORY/$SOUND_THEME/$1
          if  [  -e  $SOUND_FILE  ];  then

Index: temp.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/temp.lunar,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- temp.lunar	8 Jun 2003 19:17:52 -0000	1.1
+++ temp.lunar	27 Jul 2003 23:05:32 -0000	1.2
@@ -18,6 +18,7 @@
 
 
 temp_create() {
+  debug_msg "temp_create ($@)"
   TMPDIR=${TMPDIR:-/var/tmp}
  
   if TMPFILE=$(mktemp -p "$TMPDIR" -t lunar.`basename $0`.$$.$1.XXXXXXXXXX ) ; then
@@ -31,6 +32,7 @@
 
 
 temp_destroy() {
+  debug_msg "temp_destroy ($@)"
   if [ -e "$1" ] ; then
     rm -f "$1"
   fi




More information about the Lunar-commits mailing list