[Lunar-commits] r27005 - in lunar/branches/stable: bin etc/lunar etc/lunar/mirrors sbin usr/share/doc/lunar/core-documentation usr/share/man/man8 var/lib/lunar var/lib/lunar/functions var/lib/lunar/plugins

Auke Kok sofar at lunar-linux.org
Tue Dec 11 22:41:23 CET 2007


Author: sofar
Date: 2007-12-11 22:41:22 +0100 (Tue, 11 Dec 2007)
New Revision: 27005

Added:
   lunar/branches/stable/var/lib/lunar/plugins/build-zpatches.plugin
Modified:
   lunar/branches/stable/bin/lvu
   lunar/branches/stable/etc/lunar/config
   lunar/branches/stable/etc/lunar/mirrors/SFORGE
   lunar/branches/stable/etc/lunar/mirrors/XORG
   lunar/branches/stable/sbin/lin
   lunar/branches/stable/sbin/lrm
   lunar/branches/stable/sbin/lunar
   lunar/branches/stable/usr/share/doc/lunar/core-documentation/_etc_lunar_local_config.html
   lunar/branches/stable/usr/share/man/man8/lunar.8
   lunar/branches/stable/var/lib/lunar/functions/config.lunar
   lunar/branches/stable/var/lib/lunar/functions/depends.lunar
   lunar/branches/stable/var/lib/lunar/functions/main.lunar
   lunar/branches/stable/var/lib/lunar/functions/optimize.lunar
   lunar/branches/stable/var/lib/lunar/functions/sources.lunar
   lunar/branches/stable/var/lib/lunar/plugins/check-md5sum.plugin
   lunar/branches/stable/var/lib/lunar/unset.sh
Log:
Full sync with theedge:
- lvu submit update
- TMPFS removal
- zpatches code
- cleanups
- config fixes
- man page updates
- lvu conflicts
- mirror formatting fixes


Modified: lunar/branches/stable/bin/lvu
===================================================================
--- lunar/branches/stable/bin/lvu	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/bin/lvu	2007-12-11 21:41:22 UTC (rev 27005)
@@ -59,6 +59,7 @@
                                dependencies on them
 orphans                    display installed modules that are missing
                                dependencies
+conflicts                  display conflicting files
 held                       display held modules
 exiled                     display exiled modules
 expired                    display a list of modules which need an update
@@ -427,13 +428,26 @@
   done
 }
 
+show_conflicts()  {
+  TMP_CONFLICTS=$(temp_create "conflicts")
+  for MODULE in $(list_installed); do
+    VERSION=$(installed_version $MODULE)
+    cat $INSTALL_LOGS/$MODULE-$VERSION | grep "/bin/\|/games/\|/include/\|/lib/\|/sbin/" | 
+    grep -v "/doc/\|/etc/\|/fonts/\|/man/\|/var/\|/lib/modules\|/site-packages/\|/lib/perl5" | 
+    while read LINE; do 
+        [ ! -d "$LINE" ] && echo "${MODULE} ${LINE}" >> $TMP_CONFLICTS
+    done
+  done
+  sort -k 2,2 < $TMP_CONFLICTS | uniq -D -f 1
+  trap "rm -f $TMP_CONFLICTS ; exit" INT TERM KILL EXIT
+}
 
 show_depends()  {
   if  !  echo  "$DONE"  |  grep  -q  "$1";  then
     DONE="$DONE  $1"
 
-    for  LINE  in  $(grep  ":$1:"  $DEPENDS_STATUS) ; do
-       MODULE=$(echo  $LINE  |  cut  -d :  -f1)
+    grep ":$1:" $DEPENDS_STATUS | while read LINE ; do
+      MODULE=${LINE%%:*}
       STATUS=$(echo  $LINE  |  cut  -d :  -f3)
 
       if    [  "$STATUS"  ==  "on"  ]
@@ -752,12 +766,12 @@
   fi
   if ! run_details $1 ; then
     message "diff requires an existing zlocal module"
-      exit 1
-      fi
+    exit 1
+  fi
   if ! echo $SECTION | grep -q zlocal ; then
     message "$1 is not a zlocal module, cannot diff"
-      exit 1
-    fi
+    exit 1
+  fi
   NZSECTION=$(ZLOCAL_OVERRIDES=off find_section $1)
   if [ "$SECTION" == "$NZSECTION" ] ; then
     # new module
@@ -778,9 +792,9 @@
   # as good as it gets
   if [ "$ZLOCAL_OVERRIDES" != "on" ]; then
     message "You can't submit non-zlocal modules. Turn on ZLOCAL_OVERRIDES"
-	message "and do \`lvu edit \$MODULE; lin moonbase\`"
-	message "so that module changes can be tracked properly!"
-	exit 1
+    message "and do \`lvu edit \$MODULE; lin moonbase\`"
+    message "so that module changes can be tracked properly!"
+    exit 1
   fi
   if [ -z "$1" ]; then
     message "submit requires a single module name."
@@ -790,37 +804,50 @@
     message "submit requires curl, please \`lin curl\`"
     exit 1
   fi
-  if [ -z "$ADMIN" -o "$ADMIN" == "$USER" ]; then
+  if [ -z "$ADMIN" -o "$ADMIN" == "$USER" -o "$ADMIN" == "root" ]; then
     message "Please set ADMIN to your e-mail address: lunar set ADMIN \"me at my.mail.domain\""
     exit 1
   fi
+  if [ -z "$REALNAME" ]; then
+    REALNAME="getent passwd $USER | cut -d: -f5 | cut -d, -f1"
+    if [ -z "$G_REALNAME" ]; then
+      message "Please set REALNAME to your real name: lunar set REALNAME \"John Notdoe\""
+      exit 1
+    fi
+  fi
   if ! run_details "$1" ; then
-      message "submit requires an existing module"
-      exit 1
+    message "submit requires an existing module"
+    exit 1
   else
     if echo $SECTION | grep -q '^zlocal' ; then
-	  ZLOCAL_OVERRIDES=off SECTION=$(find_section $1)
-	  if echo $SECTION | grep -q '^zlocal' ; then
-	    unset SECTION
-	  fi
-	else
-	  message "Please don't edit modules outside of the 'zlocal' section!"
-	  message "do this first: \`lvu edit \$MODULE ; lin moonbase\`"
-	  message "so that module changes can be tracked properly!"
-	  exit 1
+      ZLOCAL_OVERRIDES=off SECTION=$(find_section $1)
+      if echo $SECTION | grep -q '^zlocal' ; then
+        unset SECTION
+      fi
+    else
+      message "Please don't edit modules outside of the 'zlocal' section!"
+      message "do this first: \`lvu edit \$MODULE ; lin moonbase\`"
+      message "so that module changes can be tracked properly!"
+      exit 1
     fi
     TMP_MSG=$(temp_create "submission")
+    TMP_MSG2=$(temp_create "submission")
     (
+      echo "$1: "
       echo ""
-      echo "# type a changelog message here"
-      echo "# all lines starting with '#' will be removed"
+      echo ""
+      echo "# type a changelog message here. The first line should start with"
+      echo "# the module name and summarize your change. All lines starting with '#'"
+      echo "# will be removed automatically"
     ) > $TMP_MSG
     edit_file $TMP_MSG
     sed -i '/^#/d' $TMP_MSG
     (
+      head -n 1 $TMP_MSG
       echo ''
+      echo "From: $REALNAME <$ADMIN>"
+      tail +2 $TMP_MSG
       echo '---'
-      echo 'from:' $ADMIN
       echo 'module:' $1
       echo "id: $UNIQID"
       echo "lvu submit: $1"
@@ -831,14 +858,18 @@
       echo "glibc: $(installed_version glibc)"
       echo ''
       echo '---'
+      lvu diff $1 | diffstat -p1
+      echo ''
+      echo '---'
       lvu diff $1
-    ) >> $TMP_MSG
-    cat $TMP_MSG
+    ) >> $TMP_MSG2
+    cat $TMP_MSG2
     if query "Submit this module now?" y; then
-      curl -F file=@$TMP_MSG -F module=$1 -F id=$UNIQID "http://lunar-linux.org/submit.php"
+      curl -F file=@$TMP_MSG2 -F module=$1 -F id=$UNIQID "http://lunar-linux.org/submit.php"
+      temp_destroy $TMP_MSG2
       temp_destroy $TMP_MSG
     else
-      message "Submission aborted. your submission was saved as $TMP_MSG"
+      message "Submission aborted. your submission was saved as $TMP_MSG2"
     fi
   fi
 }
@@ -1027,6 +1058,10 @@
       show_orphans
       ;;
 
+    conflicts)
+      show_conflicts
+      ;;
+
     updatelog)
       if [ -e /var/log/lunar/update ]; then
         view_file /var/log/lunar/update

Modified: lunar/branches/stable/etc/lunar/config
===================================================================
--- lunar/branches/stable/etc/lunar/config	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/etc/lunar/config	2007-12-11 21:41:22 UTC (rev 27005)
@@ -61,7 +61,6 @@
               GARBAGE=${GARBAGE:-on}
          PROMPT_DELAY=${PROMPT_DELAY:-150}
         PROBE_EXPIRED=${PROBE_EXPIRED:-on}
-                TMPFS=${TMPFS:-off}
        LUNAR_PRIORITY="+10"
 
             LDD_CHECK=${LDD_CHECK:-on}

Modified: lunar/branches/stable/etc/lunar/mirrors/SFORGE
===================================================================
--- lunar/branches/stable/etc/lunar/mirrors/SFORGE	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/etc/lunar/mirrors/SFORGE	2007-12-11 21:41:22 UTC (rev 27005)
@@ -19,12 +19,12 @@
 Seattle WA (US)		http://superb-west.dl.sourceforge.net/sourceforge
 McLean VA (US)		http://superb-east.dl.sourceforge.net/sourceforge
 Phoenix AZ (US)		http://easynews.dl.sourceforge.net/sourceforge
-United States	http://aleron.dl.sourceforge.net/sourceforge
-United States	http://telia.dl.sourceforge.net/sourceforge
-United States	http://twtelecom.dl.sourceforge.net/sourceforge
-United States	http://unc.dl.sourceforge.net/sourceforge
+United States		http://aleron.dl.sourceforge.net/sourceforge
+United States		http://telia.dl.sourceforge.net/sourceforge
+United States		http://twtelecom.dl.sourceforge.net/sourceforge
+United States		http://unc.dl.sourceforge.net/sourceforge
 Minneapolis MN (US)	http://umn.dl.sourceforge.net/sourceforge
-United States	http://west.dl.sourceforge.net/sourceforge
+United States		http://west.dl.sourceforge.net/sourceforge
 OSDN (US)		http://osdn.dl.sourceforge.net/sourceforge
 voxel (US)		http://voxel.dl.sourceforge.net/sourceforge
 cogent (US)		http://cogent.dl.sourceforge.net/sourceforge

Modified: lunar/branches/stable/etc/lunar/mirrors/XORG
===================================================================
--- lunar/branches/stable/etc/lunar/mirrors/XORG	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/etc/lunar/mirrors/XORG	2007-12-11 21:41:22 UTC (rev 27005)
@@ -1,15 +1,15 @@
-"Master Site"			ftp://ftp.x.org/pub/
-"Custom Mirror"			Custom
+"Master Site"		ftp://ftp.x.org/pub/
+"Custom Mirror"		Custom
 Australia		ftp://mirror.isp.net.au/pub/x.org/
-Belgium		ftp://x.mirrors.skynet.be/pub/x.org/
-Belgium		http://x.mirrors.skynet.be/pub/x.org/
+Belgium			ftp://x.mirrors.skynet.be/pub/x.org/
+Belgium			http://x.mirrors.skynet.be/pub/x.org/
 Brazilia		ftp://ftp.unicamp.br/pub/X11/releases/
 France			ftp://mirror.cict.fr/x.org/
 France			http://mirror.cict.fr/x.org/
-Germany		ftp://ftp.gwdg.de/pub/x11/x.org/pub/
-Germany		ftp://ftp.portal-to-web.de/pub/mirrors/x.org/
-Germany		http://www.portal-to-web.de/pub/mirrors/x.org/
-Germany		ftp://ftp.fu-berlin.de/unix/X11/FTP.X.ORG/pub/
+Germany			ftp://ftp.gwdg.de/pub/x11/x.org/pub/
+Germany			ftp://ftp.portal-to-web.de/pub/mirrors/x.org/
+Germany			http://www.portal-to-web.de/pub/mirrors/x.org/
+Germany			ftp://ftp.fu-berlin.de/unix/X11/FTP.X.ORG/pub/
 Greece			ftp://ftp.ntua.gr/pub/X11/
 HongKong		ftp://ftp.cs.cuhk.edu.hk/pub/X11/
 Italy			http://mi.mirror.garr.it/mirrors/x.org/
@@ -21,8 +21,8 @@
 Japan			http://ftp.yz.yamagata-u.ac.jp/pub/X11/x.org/
 Japan			ftp://ftp.yz.yamagata-u.ac.jp/pub/X11/x.org/
 Korea			ftp://ftp.kreonet.re.kr/pub/X11/ftp.x.org/
-Netherlands	http://x-org.mirror.intouch.nl/
-Netherlands	ftp://xorg.mirror.intouch.nl/mirrors/xorg/
+Netherlands		http://x-org.mirror.intouch.nl/
+Netherlands		ftp://xorg.mirror.intouch.nl/mirrors/xorg/
 Poland			ftp://sunsite.icm.edu.pl/pub/X11/x.org/
 Poland			ftp://ftp.task.gda.pl/mirror/ftp.x.org/
 Poland			http://ftp.pl.debian.org/mirror/ftp.x.org/pub/
@@ -32,16 +32,16 @@
 Russia			ftp://ftp.chg.ru/pub/X11/x.org/
 Spain			ftp://ftp.cica.es/pub/X/
 Spain			ftp://ftp.sunet.se/pub/X11/
-South Afrika	ftp://ftp.is.co.za/pub/x.org/
-Switzerland	http://xorg.mirror.solnet.ch/
-Switzerland	ftp://ftp.solnet.ch/mirror/x.org/
-Switzerland	ftp://mirror.switch.ch/mirror/X11/
-Switzerland	http://mirror.switch.ch/ftp/mirror/X11/
+South Afrika		ftp://ftp.is.co.za/pub/x.org/
+Switzerland		http://xorg.mirror.solnet.ch/
+Switzerland		ftp://ftp.solnet.ch/mirror/x.org/
+Switzerland		ftp://mirror.switch.ch/mirror/X11/
+Switzerland		http://mirror.switch.ch/ftp/mirror/X11/
 Taiwan			http://x.cs.pu.edu.tw/
-United Kingdom	http://www.mirror.ac.uk/mirror/ftp.x.org/
-United Kingdom	http://www.mirrorservice.org/sites/ftp.x.org/
-United Kingdom	ftp://ftp.mirrorservice.org/sites/ftp.x.org/
-United States	ftp://mirror.sg.depaul.edu/pub/x.org/
-United States	http://mirror.sg.depaul.edu/pub/x.org/
-United States	http://x.paracoda.com/
-United States	http://x.hostingzero.com/
+United Kingdom		http://www.mirror.ac.uk/mirror/ftp.x.org/
+United Kingdom		http://www.mirrorservice.org/sites/ftp.x.org/
+United Kingdom		ftp://ftp.mirrorservice.org/sites/ftp.x.org/
+United States		ftp://mirror.sg.depaul.edu/pub/x.org/
+United States		http://mirror.sg.depaul.edu/pub/x.org/
+United States		http://x.paracoda.com/
+United States		http://x.hostingzero.com/

Modified: lunar/branches/stable/sbin/lin
===================================================================
--- lunar/branches/stable/sbin/lin	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/sbin/lin	2007-12-11 21:41:22 UTC (rev 27005)
@@ -114,32 +114,32 @@
       done
       (
           for M in $LIST $MODULES; do
-	      SAFE_M=$(echo $M | md5sum | awk '{print $1}')
+              SAFE_M=$(echo $M | md5sum | awk '{print $1}')
               eval THIS_TEMP=\$TEMP_DOWNLOAD_LOG_$SAFE_M
               lget $M > $THIS_TEMP 2>&1 &
               echo "$M:`jobs -p`:$THIS_TEMP" >> $TEMP_DOWNLOAD_PIDS
               wait
           done
-      ) &    
+      ) &
 
       # pass 3 : compile/install
       # no strange stuff should happen here anymore
       for MODULE in $MODULES ; do
         if ! module_installed $MODULE || [ ! -n "$PROBE" ] || ( [ -n "$PROBE" ] && [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ) ; then
-	  # 3 more conditions to stop processing this module:
+          # 3 more conditions to stop processing this module:
           if module_held $MODULE ; then
-	    error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for held module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
+            error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for held module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
             continue
-	  elif module_exiled $MODULE ; then
+          elif module_exiled $MODULE ; then
             error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for exiled module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
             continue
-	  elif ! module_license_accepted $MODULE ; then
-	    error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} The license of module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} is incompatible with the list of"
+          elif ! module_license_accepted $MODULE ; then
+            error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} The license of module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} is incompatible with the list of"
             error_message "allowed and/or rejected licenses. Please adjust the ACCEPTED_LICENSES or"
             error_message "REJECTED_LICENSES variables to include or not include the specific"
             error_message "license of this module.${DEFAULT_COLOR}"
             continue
-	  else
+          else
             # we're good now, start installing
             linING="/var/lock/installing.$MODULE"
             verbose_msg "starting lin \"$MODULE\""
@@ -147,7 +147,7 @@
               if [ -e "$TMP_LIN_FAIL" ] ; then
                 echo "$MODULE" >> $TMP_LIN_FAIL
               fi
-              lin_EXIT_STATUS=1;  
+              lin_EXIT_STATUS=1;
             else
               if [ -e "$TMP_LIN_SUCCESS" ] ; then
                 echo "$MODULE" >> $TMP_LIN_SUCCESS
@@ -175,22 +175,22 @@
     if [ -z "$DEPS_ONLY" ] ; then
       if ! module_held $MODULE ; then
         if [ -n "$PROBE" ] ; then
-	  # --probe install
+          # --probe install
           if ! module_installed $MODULE ; then
             if ! lin_module $MODULE ; then
               temp_destroy $TEMP_PREPAREDDEPS
               exit 1
             fi
-	  elif [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ; then
-	    # probe install where module is expired
-	    verbose_msg "module \"$MODULE\" needs to be updated"
-	    if ! SINGLE_MODULE= lin_module $MODULE ; then
-	      temp_destroy $TEMP_PREPAREDDEPS
-	      exit 1
-	    fi	    
+          elif [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ; then
+            # probe install where module is expired
+            verbose_msg "module \"$MODULE\" needs to be updated"
+            if ! SINGLE_MODULE= lin_module $MODULE ; then
+              temp_destroy $TEMP_PREPAREDDEPS
+              exit 1
+            fi
           fi
         else
-	  # normal install - not probed
+          # normal install - not probed
           if ! lin_module $MODULE ; then
             temp_destroy $TEMP_PREPAREDDEPS
             exit 1

Modified: lunar/branches/stable/sbin/lrm
===================================================================
--- lunar/branches/stable/sbin/lrm	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/sbin/lrm	2007-12-11 21:41:22 UTC (rev 27005)
@@ -197,12 +197,12 @@
     remove_depends $MODULE
     # remove alias if required
     if [ $MODULE != moonbase ] ; then
-    for ALIAS in `cut -d: -f1 $MOONBASE/aliases`; do
-      if [ "$(get_local_config `echo LUNAR_ALIAS_${ALIAS:1}`)" == "$MODULE" ]; then
-        verbose_msg "removing alias mapping from \"$ALIAS\" to \"$MODULE\""
-        unset_local_config `echo LUNAR_ALIAS_${ALIAS:1}`
-      fi
-    done
+      for ALIAS in `cut -d: -f1 $MOONBASE/aliases`; do
+        if [ "$(get_local_config `echo LUNAR_ALIAS_${ALIAS:1}`)" == "$MODULE" ]; then
+          verbose_msg "removing alias mapping from \"$ALIAS\" to \"$MODULE\""
+          unset_local_config `echo LUNAR_ALIAS_${ALIAS:1}`
+        fi
+      done
     fi
     # restart xinetd after xinetd.confs have been removed by lrm...
     if [ -n "$SERVICES" -a -n "$XINETD" ] ; then

Modified: lunar/branches/stable/sbin/lunar
===================================================================
--- lunar/branches/stable/sbin/lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/sbin/lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -71,12 +71,11 @@
         !  module_held       $MODULE  &&
         !  module_exiled     $MODULE
     then
-      SHORT="Short Description Unavailable"
       (
         run_details $MODULE
-        echo  $MODULE
-        echo  $VERSION
-        echo  $SHORT
+        echo  "$MODULE"
+        echo  "$VERSION"
+        echo  "${SHORT:-Short Description Unavailable}"
       )
     fi
   done
@@ -86,7 +85,7 @@
 show_sections()  {
   for SECTION in $(list_sections);  do
     [ -z "$(list_modules $SECTION)" ] || {
-      echo  $SECTION
+      echo  "$SECTION"
       echo  "section"
     }
   done
@@ -108,15 +107,15 @@
 add_pkgs()  { (
   while
     SECTION=`select_section`
-  do            
+  do
     while
-      MODULES=`show_modules $SECTION`  &&
-       MODULE=`$DIALOG  --title "Select module to install please"  \
+    show_modules $SECTION ; read
+      MODULE=`$DIALOG  --title "Select module to install please"  \
                        --item-help                               \
                        --menu                                    \
                        "$SECTION"                                \
                        0 60 10                                   \
-                       $MODULES`
+                       $(show_modules $SECTION)`
     do
       DESCRIPTION=`$MOONBASE/$SECTION/$MODULE/DETAILS`
 
@@ -219,21 +218,19 @@
 
 make_checklist()  {
   for  MODULE in `list_modules "$1"`;  do
-    SHORT="Short Description Unavailable"
     (
     run_details $MODULE
-    STATUS="OFF"
 
-    if    module_installed  $MODULE  ||
-          module_held       $MODULE
-    then  STATUS="on"
-    else  STATUS="off"
+    if module_installed $MODULE || module_held $MODULE; then
+      STATUS="on"
+    else
+      STATUS="off"
     fi
 
-    echo  $MODULE
-    echo  $VERSION
-    echo  $STATUS
-    echo  $SHORT
+    echo $MODULE
+    echo $VERSION
+    echo $STATUS
+    echo ${SHORT:-Short Description Unavailable}
     )
   done
 }
@@ -498,7 +495,6 @@
 feature_menu()  {
   A_HELP="Create convenient auto-install scripts for common executables?"
   C_HELP="Colorized messages on lin and lrm?"
-  D_HELP="Use tmpfs for module installs?"
   E_HELP="Remove files when lrm?"
   F_HELP="Check for and repair broken programs after updating lunar?"
   G_HELP="Install the garbage documentation? (extras like README, LICENSE etc)"
@@ -532,10 +528,6 @@
          GARBAGE=${GARBAGE:-on}
 	 VERBOSE=${VERBOSE:off}
 
-        if [ -z $TMPFS ]; then
-          TMPFS=on;
-        fi
-
   if  TOGGLES=`$DIALOG  --title "Feature Menu"  \
                         --no-cancel             \
                         --item-help             \
@@ -557,7 +549,6 @@
       "VIEW_REPORTS"     "Toggle"  "$VIEW_REPORTS"  "$R_HELP"   \
       "VOYEUR"           "Toggle"  "$VOYEUR"        "$V_HELP"   \
       "REAP"             "Toggle"  "$REAP"          "$E_HELP"   \
-      "TMPFS"            "Toggle"  "$TMPFS"         "$D_HELP"   \
       "VERBOSE"          "Toggle"  "$VERBOSE"       "$W_HELP"   \
       "ZLOCAL_OVERRIDES" "Toggle"  "$ZLOCAL_OVERRIDES" "$Z_HELP" \
       "PROBE_EXPIRED"    "Toggle"  "$PROBE_EXPIRED" "$X_HELP"`
@@ -578,7 +569,6 @@
           VOYEUR=off
             REAP=off
          GARBAGE=off
-           TMPFS=off
 	 VERBOSE=off
 ZLOCAL_OVERRIDES=off
    PROBE_EXPIRED=off
@@ -599,7 +589,6 @@
               VOYEUR)        VOYEUR=on  ;;
                 REAP)          REAP=on  ;;
              GARBAGE)       GARBAGE=on  ;;
-               TMPFS)         TMPFS=on  ;;
 	     VERBOSE)       VERBOSE=on  ;;
     ZLOCAL_OVERRIDES) ZLOCAL_OVERRIDES=on ;;
        PROBE_EXPIRED)  PROBE_EXPIRED=on ;;
@@ -619,7 +608,6 @@
     set_local_config "VOYEUR" "$VOYEUR"
     set_local_config "REAP" "$REAP"
     set_local_config "GARBAGE" "$GARBAGE"
-    set_local_config "TMPFS" "$TMPFS"
     set_local_config "VERBOSE" "$VERBOSE"
     set_local_config "ZLOCAL_OVERRIDES" "$ZLOCAL_OVERRIDES"
     set_local_config "PROBE_EXPIRED" "$PROBE_EXPIRED"

Modified: lunar/branches/stable/usr/share/doc/lunar/core-documentation/_etc_lunar_local_config.html
===================================================================
--- lunar/branches/stable/usr/share/doc/lunar/core-documentation/_etc_lunar_local_config.html	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/usr/share/doc/lunar/core-documentation/_etc_lunar_local_config.html	2007-12-11 21:41:22 UTC (rev 27005)
@@ -202,13 +202,6 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">TMPFS=off<br>
-      </td>
-      <td style="vertical-align: top;">Turns on (or off) the use of
-tmpfs for compiling. Used by the rm_source_dir() and mk_source_dir()
-functions in /var/lib/lunar/subroutines.</td>
-    </tr>
-    <tr>
       <td style="vertical-align: top;">VERBOSE=on<br>
       </td>
       <td style="vertical-align: top;">Toggles verbose mode for

Modified: lunar/branches/stable/usr/share/man/man8/lunar.8
===================================================================
--- lunar/branches/stable/usr/share/man/man8/lunar.8	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/usr/share/man/man8/lunar.8	2007-12-11 21:41:22 UTC (rev 27005)
@@ -18,7 +18,7 @@
 .SH "OPTIONS"
 .I lunar
 without options will start the menu\-driven package management utility.
-.PP 
+.PP
 .B "-d, --debug"
 enables debug messages, very useful when emailing a bug report
 .TP
@@ -29,24 +29,24 @@
 increases the level of message output
 .TP
 .I prune
-.IP 
+.IP
 Removes all old source code and old backups. Since the number of sources on the system grows steadily on a running system, you will need to clean some of the kept copies of sources and compile caches. The source code from previous versions are kept so that the packages can be rolled back to older versions. This does not delete sources that are up to date,
 but not installed.
 .PP
 .I renew
-.IP 
+.IP
 Update all packages without fetching a fresh moonbase first. Does not run prune or autofix.
-.PP 
+.PP
 .I update
-.IP 
+.IP
 Fetches a new moonbase, updates all packages and runs (optionally) a prune and autofix.
-.PP 
+.PP
 .I rebuild
-.IP 
+.IP
 automatically rebuilds all installed software packages. This option is non\-interactive and does not start up the menu\-driven interface. It is suitable for use in cron jobs and is useful for rebuilding distributed binaries from source.
 .PP
 .I optimize
-.IP 
+.IP
 jump straight into the compiler optimizations menu.
 .PP 
 .I fix

Modified: lunar/branches/stable/var/lib/lunar/functions/config.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/config.lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/functions/config.lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -20,31 +20,32 @@
 
 set_config()
 {
-	local LINE NEW
+	local LINE NEW FILE VAR
 	debug_msg "set_config ($@)"
 
 	LINE=$(grep -w "$2=.*" $1)
-	if [ "$1" == "$LOCAL_CONFIG" ] ; then
-		NEW=$(printf "%16s=%s" "$2" "$3")
+	FILE=$1
+	VAR=$2
+	shift 2
+	if [ "$FILE" == "$LOCAL_CONFIG" ] ; then
+		NEW="$(printf "%16s" "$VAR")=\"$@\""
 	else
-		NEW="$2=\"$3\""
+		NEW="$VAR=\"$@\""
 	fi
 
 	# on-demand creation
-	if [ ! -f $1 ] ; then
-		touch $1
+	if [ ! -f $FILE ] ; then
+		touch $FILE
 	fi
 
-	lock_file $1 &&
+	lock_file $FILE &&
 	if [ -n "$LINE" ] ; then
 		# make sure we escape those ':' characters:
 		LINE=$(echo $LINE | sed 's/:/\\:/g')
-		NEW=$(echo $NEW | sed 's/:/\\:/g')
-		sedit "s:$LINE:$NEW:" $1
-	else
-		echo "$NEW" >> $1
+		sedit "/[^ ]$VAR=/d" $FILE
 	fi
-	unlock_file $1
+	echo "$NEW" >> $FILE
+	unlock_file $FILE
 }
 
 
@@ -77,7 +78,10 @@
 set_local_config()
 {
 	debug_msg "set_local_config ($@)"
-	set_config "$LOCAL_CONFIG" "$1" "$2"
+	local VAR
+	VAR=$1
+	shift
+	set_config "$LOCAL_CONFIG" "$VAR" "$@"
 }
 
 

Modified: lunar/branches/stable/var/lib/lunar/functions/depends.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/depends.lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/functions/depends.lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -163,7 +163,7 @@
     if module_installed $DEP ; then
       add_depends "$MODULE" "$DEP" "on" "required" "$2" "$3"
       echo "$DEP" >> $TEMP_PREPAREDDEPS
-    elif ! module_installed $DEP && ! module_held $DEP ; then
+    elif ! is_depends $DEP ! module_installed $DEP && ! module_held $DEP ; then
       if module_exiled $DEP ; then
         message "${MODULE_COLOR}${MODULE}:${PROBLEM_COLOR} ! Error: required dependency ${MODULE_COLOR}$DEP${DEFAULT_COLOR}${PROBLEM_COLOR} is exiled and cannot be installed${DEFAULT_COLOR}"
         return 1
@@ -378,7 +378,9 @@
     }
 
     optional_depends() {
-      echo "$MODULE:$1:optional:$2:$3:$4"
+      # No quotes, this prevent us from parsing newlines
+      # if someone by accident add a newline in optional_depends
+      echo $MODULE:$1:optional:$2:$3:$4
     }
 
     # yeah, this sucks:

Modified: lunar/branches/stable/var/lib/lunar/functions/main.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/main.lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/functions/main.lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -138,7 +138,7 @@
   # the sed trick is advanced: a non-greedy pattern that returns all
   # directory names listed in the input
   for TARGET in $(cat $TMP_TARGETS | sed 's/\/[^\/]*$/\//g' ) ; do
-	if [ ! -d $TARGET ]; then
+    if [ ! -d $TARGET ]; then
       debug_msg "mkdir -p $TARGET"
       mkdir -p $TARGET
     fi
@@ -269,7 +269,7 @@
     fi
   fi
   check_blacklist             &&
-  
+
   # here we run CONFLICTS, DEPENDS and CONFIGURE stuff
   run_conflicts               &&
   satisfy_depends             &&

Modified: lunar/branches/stable/var/lib/lunar/functions/optimize.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/optimize.lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/functions/optimize.lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -24,10 +24,10 @@
 		unset LDFLAGS
 	else
 		for BAD_FLAG in "$@" ; do
-			CFLAGS=$(echo $CFLAGS | sed s/$BAD_FLAG//)
-			CXXFLAGS=$(echo $CXXFLAGS | sed s/$BAD_FLAG//)
-			CPPFLAGS=$(echo $CPPFLAGS | sed s/$BAD_FLAG//)
-			LDFLAGS=$(echo $LDFLAGS | sed s/$BAD_FLAG//)
+			CFLAGS=$(echo $CFLAGS | sed "s/$BAD_FLAG//")
+			CXXFLAGS=$(echo $CXXFLAGS | sed "s/$BAD_FLAG//")
+			CPPFLAGS=$(echo $CPPFLAGS | sed "s/$BAD_FLAG//")
+			LDFLAGS=$(echo $LDFLAGS | sed "s/$BAD_FLAG//")
 		done
 	fi
 }

Modified: lunar/branches/stable/var/lib/lunar/functions/sources.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/sources.lunar	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/functions/sources.lunar	2007-12-11 21:41:22 UTC (rev 27005)
@@ -173,12 +173,7 @@
   DEAD_DIR=${DEAD_DIR:-$SOURCE_DIRECTORY}
 
   verbose_msg "destroying building dir \"$DEAD_DIR\""
-  if [ "$TMPFS" != "off" ] ; then
-    umount $DEAD_DIR 2> /dev/null
-    rmdir $DEAD_DIR 2> /dev/null
-  else
-    rm -rf $DEAD_DIR 2> /dev/null
-  fi
+  rm -rf $DEAD_DIR 2> /dev/null
 }
 
 
@@ -196,21 +191,11 @@
   NEW_DIR=${NEW_DIR:-$SOURCE_DIRECTORY}
 
   verbose_msg "creating building dir \"$NEW_DIR\""
-  if [ "$TMPFS" != "off" ] ; then 
-    if [ -d "$NEW_DIR" ] ; then
-      verbose_msg "Removing old source directory first!"
-      umount $NEW_DIR 2>/dev/null
-      rmdir $NEW_DIR 2>/dev/null
-    fi
-    mkdir -p $NEW_DIR &&
-    mount -o size=1g,nr_inodes=1m -t tmpfs tmpfs $NEW_DIR
-  else
-    if [ -d $NEW_DIR ] ; then
-      verbose_msg "Removing old source directory first!"
-      rm -rf $NEW_DIR 2>/dev/null
-    fi
-    mkdir -p $NEW_DIR
+  if [ -d $NEW_DIR ] ; then
+    verbose_msg "Removing old source directory first!"
+    rm -rf $NEW_DIR 2>/dev/null
   fi
+  mkdir -p $NEW_DIR
 }
 
 

Added: lunar/branches/stable/var/lib/lunar/plugins/build-zpatches.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/build-zpatches.plugin	                        (rev 0)
+++ lunar/branches/stable/var/lib/lunar/plugins/build-zpatches.plugin	2007-12-11 21:41:22 UTC (rev 27005)
@@ -0,0 +1,80 @@
+#!/bin/bash
+#############################################################
+#                                                           #
+# build-zpatches.plugin -  build handling of custom         #
+#                          patches that need to be applied  #
+#                          to a module without editing      #
+#                          DETAILS/BUILD files              #
+#                                                           #
+#############################################################
+#                                                           #
+# Copyright 2007 by Stefan Wold under GPLv2                 #
+#                                                           #
+#############################################################
+
+
+plugin_zpatches_apply()
+{
+  local PATCHDIRS FPATCH PATCH TARCMD GZCMD TMPFILE1 TMPFILE2
+  if [ -d $MOONBASE/zlocal/_patches/$MODULE ]; then
+    cd $SOURCE_DIRECTORY
+    PATCHDIRS+=" $MOONBASE/zlocal/_patches/$MODULE"
+    # Check for version based patch dir
+    if [ -d $MOONBASE/zlocal/_patches/$MODULE/$VERSION ]; then
+      PATCHDIRS+=" $MOONBASE/zlocal/_patches/$MODULE/$VERSION"
+    fi
+    # Now find all patches and apply them
+    # We also sort them so it possible to apply patch order
+        # by prefixing a patch with 01, 02, 03 etc
+    find $PATCHDIRS -maxdepth 1 -type f | sed 's;[^/]*$;& &;' | sort -t ' ' -k 2 | while read FPATCH PATCH; do
+      verbose_msg "Applying custom patch for $MODULE ($PATCH)"
+
+      if [[ -n `echo $PATCH | grep '\.tar'` ]] ; then
+        TARCMD="tar x -O"
+      else
+        TARCMD="cat"
+      fi
+
+      if [[ -n `echo $PATCH | grep '\.bz2$'` ]] ; then
+        GZCMD="bzcat"
+      elif [[ -n `echo $PATCH | grep '\.gz$'` ]] ; then
+        GZCMD="zcat"
+      else
+        GZCMD="cat"
+      fi
+
+      TMPFILE1=$(temp_create "zpatch_1")
+      TMPFILE2=$(temp_create "zpatch_2")
+
+      if $GZCMD $FPATCH > $TMPFILE1 ; then
+        # uncompress OK
+        if cat $TMPFILE1 | $TARCMD > $TMPFILE2 ; then
+          # untar OK
+          # Trying -p1 first or else we try -p0
+          # An error will be visible if -p1 fail which is normal
+          # Only return error if both -p1 and -p0 fail
+          patch -p1 -t < $TMPFILE2 || patch -p0 -t < $TMPFILE2
+          if [ $? -ne 0 ]; then
+            message "${PROBLEM_COLOR}ERROR: Failed to apply ${PATCH} for ${MODULE}${DEFAULT_COLOR}"
+            temp_destroy $TMPFILE1
+            temp_destroy $TMPFILE2
+            return 1
+          else
+            temp_destroy $TMPFILE1
+            temp_destroy $TMPFILE2
+          fi
+        fi
+      fi
+    done
+    if [ $? != 0 ]; then
+      exit 1
+    else
+      return 2
+    fi
+  else
+    # No patchdir for that module found just continue
+    return 2
+  fi
+}
+
+plugin_register BUILD_BUILD plugin_zpatches_apply

Modified: lunar/branches/stable/var/lib/lunar/plugins/check-md5sum.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/check-md5sum.plugin	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/plugins/check-md5sum.plugin	2007-12-11 21:41:22 UTC (rev 27005)
@@ -26,20 +26,17 @@
 
   if [ -e "$MD5_LOG" ]; then
     IFS_OLD="$IFS"
-    export IFS="	
-"
+    export IFS=$'\t\n'
 
     cat $MD5_LOG | grep "/bin/\|/games/\|/include/\|/lib/\|/sbin/" |
             grep -v "/doc/\|/etc/\|/fonts/\|/man/\|/var/" |
             while read LINE ; do
       if ! echo $LINE | md5sum --check --status ; then
+        FILE=$(echo $LINE | awk '{ print $2 }')
         if [ -f "$FILE" ] && [ ! -h "$FILE" ] && file -b "$FILE" |
-		    egrep -q "executable|shared object|current ar archive" ; then
-          MD5SUM=$(md5sum "$FILE")
-          if ! grep -q "$LINE" $MD5SUM_LOGS/*; then
-            message "${FILE_COLOR}$FILE${DEFAULT_COLOR} of ${MODULE_COLOR}$MODULE${PROBLEM_COLOR} has wrong md5sum.${DEFAULT_COLOR}"
-            MD5SUM_STATUS=1
-          fi
+              egrep -q "executable|shared object|current ar archive|ASCII C?? program" ; then
+          message "${FILE_COLOR}$FILE${DEFAULT_COLOR} of ${MODULE_COLOR}$MODULE${PROBLEM_COLOR} has wrong md5sum.${DEFAULT_COLOR}"
+          MD5SUM_STATUS=1
         fi
       fi
     done

Modified: lunar/branches/stable/var/lib/lunar/unset.sh
===================================================================
--- lunar/branches/stable/var/lib/lunar/unset.sh	2007-12-11 07:39:45 UTC (rev 27004)
+++ lunar/branches/stable/var/lib/lunar/unset.sh	2007-12-11 21:41:22 UTC (rev 27005)
@@ -87,7 +87,6 @@
 unset SUSTAINED
 unset SYM_CHECK
 unset SYMLINK_COLOR
-unset TMPFS
 unset TRACKED
 unset UNIQID
 unset USE_CACHE



More information about the Lunar-commits mailing list