[Lunar-commits] CVS: theedge/var/lib/lunar/functions build.lunar, 1.27, 1.28 check.lunar, 1.23, 1.24 depends.lunar, 1.48, 1.49 download.lunar, 1.54, 1.55 edit.lunar, 1.15, 1.16 logging.lunar, 1.3, 1.4 main.lunar, 1.24, 1.25 modules.lunar, 1.52, 1.53 plugins.lunar, 1.1, 1.2 sizes.lunar, 1.8, 1.9 sources.lunar, 1.28, 1.29 temp.lunar, 1.7, 1.8 tracking.lunar, 1.14, 1.15

Auke Kok sofar at lunar-linux.org
Thu Mar 24 16:39:02 UTC 2005


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory espresso.foo-projects.org:/home/sofar/active/theedge/var/lib/lunar/functions

Modified Files:
	build.lunar check.lunar depends.lunar download.lunar 
	edit.lunar logging.lunar main.lunar modules.lunar 
	plugins.lunar sizes.lunar sources.lunar temp.lunar 
	tracking.lunar 
Log Message:
Mega merge:

* source verification is now a plugin too
* rewrote gpg verification a bit
* removed versioned modules (only one remains: gcc/3.4.3)
* Implemented nested sections: moonbase/gnome/apps is now possible


Index: build.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/build.lunar,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- build.lunar	2 Feb 2005 12:12:00 -0000	1.27
+++ build.lunar	24 Mar 2005 16:38:59 -0000	1.28
@@ -307,11 +307,10 @@
 
 # run the CONFIGURE script
 run_configure() {
-  mod_v_safe_edit $MODULE
   debug_msg "run_configure ($@)"
   if [ -n "$RECONFIGURE" ];  then
-    verbose_msg "Reconfiguring \"$MOD_V_SNAME\""
-    rm -f $DEPENDS_CONFIG/$MOD_V_SNAME
+    verbose_msg "Reconfiguring \"$MODULE\""
+    rm -f $DEPENDS_CONFIG/$MODULE
     remove_depends $MODULE
   fi
 
@@ -386,9 +385,8 @@
     if [ ! -e /var/state/lunar/module_history ]; then
       mkdir /var/state/lunar/module_history
     fi
-    mod_v_safe_edit $MODULE                             &&
     SCRIPT_DATE=$(date -u +%Y%m%d)                      &&
-    MH_NAME=$MOD_V_SNAME-$VERSION-$SCRIPT_DATE.tar.bz2  &&
+    MH_NAME=$MODULE-$VERSION-$SCRIPT_DATE.tar.bz2  &&
     cd $MOONBASE/$SECTION                               &&
     tar -cjf /var/state/lunar/module_history/$MH_NAME $MODULE
   )

Index: check.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/check.lunar,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check.lunar	20 Mar 2005 16:53:02 -0000	1.23
+++ check.lunar	24 Mar 2005 16:38:59 -0000	1.24
@@ -259,14 +259,13 @@
                                                                                 
   # here starts the real work:
   MODULE=$1
-  mod_v_safe_edit $1
 
   # remove whatever depends was residing in the depends state file and
   # append the new output:
-  remove_depends $MOD_V_SNAME                              &&
+  remove_depends $MODULE                              &&
   lock_file $DEPENDS_STATUS                                &&
   lock_file $DEPENDS_STATUS_BACKUP                         &&
-  run_depends $MOD_V_SNAME >> $DEPENDS_STATUS              &&
+  run_depends $MODULE >> $DEPENDS_STATUS              &&
   cat $DEPENDS_STATUS > $DEPENDS_STATUS_BACKUP             &&
   unlock_file $DEPENDS_STATUS                              &&
   unlock_file $DEPENDS_STATUS_BACKUP

Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- depends.lunar	15 Mar 2005 10:36:57 -0000	1.48
+++ depends.lunar	24 Mar 2005 16:38:59 -0000	1.49
@@ -220,7 +220,6 @@
     fi
   }
                                                                                 
-  prepare_depends_status
   grep -q "^"$MODULE"\$" $TEMP_PREPAREDDEPS 2>/dev/null && return 0
   if [ -s "$SCRIPT_DIRECTORY/DEPENDS" ] ; then
     if [ -n "$SINGLE_MODULE" ] ; then
@@ -304,7 +303,7 @@
       lrm $DEP
     else
       message "${PROBLEM_COLOR}ERROR: Cannot continue installing conflicting modules, exiting!${DEFAULT_COLOR}"
-      return 1
+      exit 1
     fi
   fi
 
@@ -318,14 +317,6 @@
 }
 
 
-# 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
-}
-
-
 build_module_depends() {
 (
   debug_msg "build_module_depends ($@)"
@@ -398,7 +389,7 @@
 
     # fast method for re-creating the depends.cache, might take long though
     for DEPFILE in $DEPFILES ; do
-      MODULE=$(echo $DEPFILE | sed -e "s:$MOONBASE/::g" -e "s:/DEPENDS::g" | cut -d/ -f2-) . $DEPFILE
+      MODULE=$(echo $DEPFILE | sed -e "s:$MOONBASE/::g" -e "s:/DEPENDS::g" -e 's/.*\/\([^\/]*\)$/\1/') . $DEPFILE
     done > $TMP_DEP_CACHE &&
     install -m644 $TMP_DEP_CACHE $DEPENDS_CACHE 
   

Index: download.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/download.lunar,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- download.lunar	23 Mar 2005 16:18:09 -0000	1.54
+++ download.lunar	24 Mar 2005 16:38:59 -0000	1.55
@@ -12,16 +12,14 @@
 
 lget_lock() {
 	debug_msg "lget_lock ($@)"
-	mod_v_safe_edit $1
-	echo $$ > /var/lock/lgetting.$MOD_V_SNAME
+	echo $$ > /var/lock/lgetting.$MODULE
 }
 
 
 lget_locked() {
 	debug_msg "lget_locked ($@)"
-	mod_v_safe_edit $1
-	if [ -f "/var/lock/lgetting.$MOD_V_SNAME" ] &&
-			ps `cat /var/lock/lgetting.$MOD_V_SNAME` | grep	-q	"lget" ; then
+	if [ -f "/var/lock/lgetting.$MODULE" ] &&
+			ps `cat /var/lock/lgetting.$MODULE` | grep	-q	"lget" ; then
 		true
 	else
 		false
@@ -31,20 +29,15 @@
 
 lget_unlock() {
 	debug_msg "lget_unlock ($@)"
-	mod_v_safe_edit $1
-	rm -f /var/lock/lgetting.$MOD_V_SNAME &> /dev/null
+	rm -f /var/lock/lgetting.$MODULE &> /dev/null
 }
 
 
 download_url() {
 	debug_msg "download_url($@)"
-	message	 "${MESSAGE_COLOR}Downloading source file" \
-			 "${FILE_COLOR}$2${DEFAULT_COLOR}" \
-			 "${MESSAGE_COLOR}for module" \
-			 "${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}"
 	verbose_msg "trying to download \"$URL\""
 	connect &&
-	plugin_call SOURCE_DOWNLOAD $1 $SOURCE_CACHE/$2
+	plugin_call SOURCE_DOWNLOAD $1 $2
 	RETVAL=$?
 	if [ $RETVAL == 2 ]; then
 		message "${MESSAGE_COLOR}Warning: I don't know how to download \"$1\""
@@ -92,25 +85,30 @@
 			fi
 			# check for cache?
 			if [ ! -f $SOURCE_CACHE/$SRC ] || plugin_call SOURCE_NEEDREFRESH $URL $SOURCE_CACHE/$SRC ; then
+				message "${MESSAGE_COLOR}Downloading source file" \
+					"${FILE_COLOR}$SRC${DEFAULT_COLOR}" \
+					"${MESSAGE_COLOR}for module" \
+					"${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}"
+
 				# ordinary URL's handled by call_wget
 				if [ -n "$BASE_URL" ] ; then
 					# base url set means we don't touch the other possibilities:
-					download_url $BASE_URL/$(basename $2) $SRC
+					download_url $BASE_URL/$(basename $2) $SOURCE_CACHE/$SRC
 				else
 					if [ -n "$FRESORT_URL" ] ; then
 						# try fresort first
-						if ! download_url $FRESORT_URL/$(basename $SRC) $SRC ; then
+						if ! download_url $FRESORT_URL/$(basename $SRC) $SOURCE_CACHE/$SRC ; then
 							# normal url second
-							if ! download_url $URL $SRC ; then
+							if ! download_url $URL $SOURCE_CACHE/$SRC ; then
 								# and failover
-								download_url $LRESORT_URL/$(basename $SRC) $SRC
+								download_url $LRESORT_URL/$(basename $SRC) $SOURCE_CACHE/$SRC
 							fi
 						fi
-					elif ! download_url $URL $SRC ; then
+					elif ! download_url $URL $SOURCE_CACHE/$SRC ; then
 						# just try the normal url
 						if [ -n "$LRESORT_URL" ] ; then
 							# and the failover url
-							download_url $LRESORT_URL/$(basename $SRC) $SRC
+							download_url $LRESORT_URL/$(basename $SRC) $SOURCE_CACHE/$SRC
 						fi
 					fi
 				fi

Index: edit.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/edit.lunar,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- edit.lunar	6 Jul 2004 20:21:11 -0000	1.15
+++ edit.lunar	24 Mar 2005 16:38:59 -0000	1.16
@@ -86,10 +86,3 @@
 }
 
 
-# function : mod_v_safe_edit
-# usage    : mod_v_safe_edit $VARIABLE
-# purpose  : creates a 'safe' value in variable "$MOD_V_SNAME"
-mod_v_safe_edit() {
-  MOD_V_SNAME=$(echo $1 | sed 's:/:.:g') 
-  return 0
-}

Index: logging.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/logging.lunar,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- logging.lunar	21 May 2004 10:27:13 -0000	1.3
+++ logging.lunar	24 Mar 2005 16:38:59 -0000	1.4
@@ -12,9 +12,8 @@
 
 start_logging () {
   debug_msg "start_logging  ($@)"
-  mod_v_safe_edit $MODULE 
-  export C_LOG=$(temp_create "${MOD_V_SNAME}.compile-log")
-  export C_FIFO=$(temp_create "${MOD_V_SNAME}.compile-fifo")
+  export C_LOG=$(temp_create "${MODULE}.compile-log")
+  export C_FIFO=$(temp_create "${MODULE}.compile-fifo")
 
   # just remaking this as FIFO
   rm -f $C_FIFO
@@ -26,13 +25,12 @@
 
 stop_logging() {
   debug_msg "stop_logging ($@)"
-  mod_v_safe_edit $MODULE 
   echo "++ Mark Compile stop   : \"$MODULE\" \"$VERSION\" \"$(date -u)\"" >> $C_LOG
   message  "${MESSAGE_COLOR}Creating"                        \
-           "${FILE_COLOR}$COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2"  \
+           "${FILE_COLOR}$COMPILE_LOGS/$MODULE-$VERSION.bz2"  \
            "${DEFAULT_COLOR}"
 
-  bzip2 -9f < $C_LOG > $COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2
+  bzip2 -9f < $C_LOG > $COMPILE_LOGS/$MODULE-$VERSION.bz2
   temp_destroy $C_LOG
   temp_destroy $C_FIFO
 }

Index: main.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/main.lunar,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- main.lunar	18 Mar 2005 11:01:31 -0000	1.24
+++ main.lunar	24 Mar 2005 16:38:59 -0000	1.25
@@ -249,8 +249,7 @@
   export INSTALLWATCHFILE=$(temp_create "$MODULE.installwatch")
 
   # lock the module for installation, check for moonbase call
-  mod_v_safe_edit $MODULE 
-  linING="/var/lock/installing.$MOD_V_SNAME"
+  linING="/var/lock/installing.$MODULE"
   if [ "$MODULE" == "moonbase" ] ; then
     if ! current_locked && ! solo_locked ; then
       echo $$ > $linING       &&
@@ -307,7 +306,7 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected during ${FILE_COLOR}$LIN_ERROR${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MODULE-$VERSION.bz2 "compile log" $MODULE $VERSION
       activity_log  "lin"  "$MODULE"  "$VERSION"  "failed" "Due to build errors during $LIN_ERROR"
       return 1
     fi  
@@ -328,13 +327,13 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected during ${FILE_COLOR}$LIN_ERROR${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MODULE-$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/$MOD_V_SNAME-$VERSION "install log" $MODULE $VERSION &&
+    report $INSTALL_LOGS/$MODULE-$VERSION "install log" $MODULE $VERSION &&
     rm -f $linING               &&
     sound SUCCESS               &&
     activity_log  "lin"  "$MODULE"  "$VERSION"  "success"
@@ -343,7 +342,7 @@
       sound FAILURE
       message "${PROBLEM_COLOR}! Problem detected${DEFAULT_COLOR}"
       rm -f $linING
-      report $COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2 "compile log" $MODULE $VERSION
+      report $COMPILE_LOGS/$MODULE-$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: modules.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/modules.lunar,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- modules.lunar	20 Mar 2005 16:53:02 -0000	1.52
+++ modules.lunar	24 Mar 2005 16:38:59 -0000	1.53
@@ -103,15 +103,19 @@
     # short way out:
     debug_msg "Quick generating \$MODULE_INDEX..."
     grep "/DETAILS$" $INSTALL_LOGS/moonbase-$(installed_version moonbase) | \
-        sed -e 's:/DETAILS$::' -e 's:/var/lib/lunar/moonbase/::' -e 's|/|:|' | \
-	awk -F: '{print $2":"$1}' > $TMP_INDEX
+        sed -e 's:/var/lib/lunar/moonbase/::' -e 's:/DETAILS::g' \
+        -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' > $TMP_INDEX
     # we search zlocal locally to make sure they get found:
-    find $MOONBASE/zlocal -type f -name DETAILS | sed "s:$MOONBASE/::g" | sed 's|/|:|' | sed 's:/DETAILS::g' | awk -F: '{print $2":"$1}' >> $TMP_INDEX
+    find $MOONBASE/zlocal -type f -name DETAILS | \
+        sed -e "s:$MOONBASE/::g" -e 's:/DETAILS::g' \
+        -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' >> $TMP_INDEX
   else
     # this *really* is the fastest way to do it, no guarantees, we
     # do have to make sure MOONBASE is coherent and tidy though
     debug_msg "Regenerating \$MODULE_INDEX manually..."
-    find $MOONBASE -type f -name DETAILS | sed "s:$MOONBASE/::g" | sed 's|/|:|' | sed 's:/DETAILS::g' | awk -F: '{print $2":"$1}' > $TMP_INDEX
+    find $MOONBASE -type f -name DETAILS | \
+        sed -e "s:$MOONBASE/::g" -e 's:/DETAILS::g' \
+        -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' > $TMP_INDEX
   fi
   
   # this should be safe enough:
@@ -221,8 +225,7 @@
       temp_destroy $TMP_DETAILS
     fi
     SOURCE_DIRECTORY=${SOURCE_DIRECTORY:-$BUILD_DIRECTORY/$1-$VERSION}
-    mod_v_safe_edit $1 
-    MODULE_CONFIG=${MODULE_CONFIG:-$DEPENDS_CONFIG/$MOD_V_SNAME}
+    MODULE_CONFIG=${MODULE_CONFIG:-$DEPENDS_CONFIG/$MODULE}
     MODULE_PREFIX=${MODULE_PREFIX:-$DEFAULT_PREFIX}
 
     return 0

Index: plugins.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/plugins.lunar,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- plugins.lunar	23 Mar 2005 16:18:09 -0000	1.1
+++ plugins.lunar	24 Mar 2005 16:38:59 -0000	1.2
@@ -25,6 +25,7 @@
 	# Defined plugin types:
 	# 1 - SOURCE_DOWNLOAD - download some source code
 	# 2 - SOURCE_NEEDREFRESH - source exists but needs refresh
+    # 3 - SOURCE_VERIFY - perform intergity verification on a file
 	LUNAR_PLUGINS=(${LUNAR_PLUGINS[@]} "$1:$2")
 	((LUNAR_PLUGIN_COUNT++))
 }

Index: sizes.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/sizes.lunar,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- sizes.lunar	21 May 2004 10:27:13 -0000	1.8
+++ sizes.lunar	24 Mar 2005 16:38:59 -0000	1.9
@@ -21,7 +21,6 @@
 # purpose : finds the installed size of module in KB
 find_module_size() {
    #this functions checks the modules file if there is already size entry
-   mod_v_safe_edit $1
    module_size()
    {
       unset SIZE
@@ -41,14 +40,14 @@
    module_size $1 $VERSION && return
 
    # no :( lets dig through logs
-   [ -e "$INSTALL_LOGS/$MOD_V_SNAME-$VERSION" ]  &&
+   [ -e "$INSTALL_LOGS/$MODULE-$VERSION" ]  &&
    while read LINE
    do
       [ -f "$LINE" ]            &&
       SIZE0=`du "$LINE"         | 
              cut -f 1-1`        &&
       SIZE=$((SIZE0+SIZE))
-   done <$INSTALL_LOGS/$MOD_V_SNAME-$VERSION     &&
+   done <$INSTALL_LOGS/$MODULE-$VERSION     &&
    echo ${SIZE}KB                      ||
    message  "${PROBLEM_COLOR}Install log for $1 is not found${DEFAULT_COLOR}"
 }

Index: sources.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/sources.lunar,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- sources.lunar	18 Mar 2005 11:01:31 -0000	1.28
+++ sources.lunar	24 Mar 2005 16:38:59 -0000	1.29
@@ -34,9 +34,8 @@
 
 
 # function : sources
-# usage    : sources <module_name> {MD5|VFY|
-# purpose  : displays the filenames and md5sums or VFY part of sources
-#            for a given module
+# usage    : sources <module_name>
+# purpose  : displays the sources needed for a given module
 sources() {
 (
   debug_msg "sources ($@)"
@@ -51,21 +50,11 @@
     TEMP=${TEMP/SOURCE0/SOURCE}
 
     eval SRC1=\$${TEMP}
-    if [ "$2" == "MD5" ] ; then
-      eval SRC_MD5=\$${TEMP}_MD5
-      if [ -z "$SRC_MD5" ] ; then
-        SRC_MD5=0
-      fi
-    fi
-
     eval SRC2=\$SOURCE$((CNT+1))
     eval SRC3=\$SOURCE$((CNT+2))
 
     if [ -n "$SRC1" ] ; then
       echo $SRC1
-      if [ "$2" == "MD5" ] ; then
-        echo $SRC_MD5
-      fi
     fi
 
     #if two consequtive empty sources, then break
@@ -77,34 +66,6 @@
 }
 
 
-# function : md5_verify_source
-# usage    : md5_verify_source filename md5
-# purpose  : md5 verifies a filename
-md5_verify_source() {
-  debug_msg "md5_verify_source ($@)"
-  TMP_MD5=$(md5sum $SOURCE_CACHE/$1 | cut -d " " -f 1-1)
-  if [ "$2" != "$TMP_MD5" ] ; then
-    verbose_msg "offending md5sum: $TMP_MD5"
-    verbose_msg "should be md5sum: $2"
-    return 1
-  fi
-}
-
-
-# function : sha1_verify_source
-# usage    : sha1_verify_source filename sha1
-# purpose  : sha1 verifies a filename
-sha1_verify_source() {
-  debug_msg "sha1_verify_source ($@)"
-  TMP_SHA1=$(sha1sum $SOURCE_CACHE/$1 | cut -d " " -f 1-1)
-  if [ "$2" != "$TMP_SHA1" ] ; then
-    verbose_msg "offending sha1sum: $TMP_SHA1"
-    verbose_msg "should be sha1sum: $2"
-    return 1
-  fi
-}
-
-
 erase()  {
   debug_msg "erase ($@)"
   if [ "$PARTIAL" == "off" ]; then
@@ -138,49 +99,6 @@
 }
 
 
-# usage : gpg_verify_src $SRC $GPG-SIG-URL $GPG-PUBLIC-KEYS-URL
-gpg_verify_source() {
-  debug_msg "gpg_verify_source($@)"
-  if [ ! -x /usr/bin/gpg ] ; then
-    message "${PROBLEM_COLOR}! Cannot verify sources without ${MODULE_COLOR}gpg${DEFAULT_COLOR}${PROBLEM_COLOR} installed${DEFAULT_COLOR}"
-    return 1
-  fi
-
-  # do we need to download a keyset?
-  if [ -n "$3" ] ; then
-    TMP_GPG_KEYS=$(temp_create "gpg-pubkeys")
-    verbose_msg "Downloading pub keys from \"$3\""
-    # TODO calling wget is a hack... we should accept file: urls too
-    if wget $3 -O $TMP_GPG_KEYS -q ; then
-      GNUPGHOME=/var/state/lunar/ gpg --import $TMP_GPG_KEYS
-    fi
-  fi
-  
-  # try to get the required key
-  TMP_GPG_SIG=$(temp_create "gpg-signature")
-  verbose_msg "Downloading signature \"$2\""
-  # TODO calling wget is a hack... we should accept file: urls too
-  if wget $2 -O $TMP_GPG_SIG -q ; then
-    verbose_msg "Verifying signature of \"$SOURCE_CACHE/$1\""
-    verbose_msg "GNUPGHOME=/var/state/lunar/ gpg --verify $TMP_GPG_SIG $SOURCE_CACHE/$1"
-    if ! GNUPGHOME=/var/state/lunar/ gpg --verify $TMP_GPG_SIG $SOURCE_CACHE/$1 ; then
-      verbose_msg "gpg exited with \"$?\""
-      temp_destroy $TMP_GPG_SIG
-      temp_destroy $TMP_GPG_KEYS
-      return 1
-    fi
-    temp_destroy $TMP_GPG_SIG
-    temp_destroy $TMP_GPG_KEYS
-  else
-    message "cannot download key!"
-    temp_destroy $TMP_GPG_SIG
-    temp_destroy $TMP_GPG_KEYS
-    return 1
-  fi
-
-}
-
-
 # usage: verify_all_sources $MODULE
 # check all sources regarding verification method
 verify_all_sources() {
@@ -206,7 +124,6 @@
     if ! verify_source $SRC1 ; then
       return 1
     fi
-
     eval VFYS=\${${TEMP}_VFY[@]}
 
     # cumulate result:
@@ -215,40 +132,28 @@
       # we need to check ALL args for validity... if one fails we should not
       # trust the source
       for VFY in $VFYS ; do
-        if [ "${VFY:0:4}" == "md5:" ] ; then
-	  if ! md5_verify_source $SRC1 $(echo $VFY | cut -d: -f2) ; then
-	    message "${PROBLEM_COLOR}! md5sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$SRC1${DEFAULT_COLOR}"
-	    RESULT=1
-	  fi
-	elif [ "${VFY:0:5}" == "sha1:" ] ; then
-	  if ! sha1_verify_source $SRC1 $(echo $VFY | cut -d: -f2) ; then
-	    message "${PROBLEM_COLOR}! sha1sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$SRC1${DEFAULT_COLOR}"
-	    RESULT=1
-	  fi
-	elif [ "${VFY:0:4}" == "gpg:" ] ; then
-	  if ! gpg_verify_source $SRC1 $(echo $VFY | cut -d: -f2- | cut -f1) $(echo $VFY | cut d: -f2- | cut -f2) $(echo $VFY | cut -d: -f2- | cut -f3) ; then
-	    message "${PROBLEM_COLOR}! gpg signature check failed for ${DEFAULT_COLOR}${FILE_COLOR}$SRC1${DEFAULT_COLOR}"
-	    RESULT=1
-	  fi
-        fi
+        plugin_call SOURCE_VERIFY $SRC1 $VFY
+		if [ $? == 1 ]; then
+		  RESULT=1
+		fi
+      done
       # so what if?
       if [ "$RESULT" == "1" ] ; then
         # remove?
-	MODULE=$1
-	message "${MESSAGE_COLOR}You should remove ${DEFAULT_COLOR}${FILE_COLOR}$SRC1${DEFAULT_COLOR}${MESSAGE_COLOR} !${DEFAULT_COLOR}"
+        MODULE=$1
+        message "${MESSAGE_COLOR}You should remove ${DEFAULT_COLOR}${FILE_COLOR}$SRC1${DEFAULT_COLOR}${MESSAGE_COLOR} !${DEFAULT_COLOR}"
 	
-	if query "Remove \"$SOURCE_CACHE/$SRC1\" ? " y ; then
+        if query "Remove \"$SOURCE_CACHE/$SRC1\" ? " y ; then
           rm -f $SOURCE_CACHE/$SRC1
-	fi
+        fi
       fi
-      done
     fi
 
     # our fallthrough as usual:
     eval SRC2=\$SOURCE$((C+1));
     eval SRC3=\$SOURCE$((C+2));
     [ -z "$SRC2" ] && [ -z "$SRC3" ] && break
-  done    
+  done
  
   # result?
   if [ -n "$RESULT" ] ; then

Index: temp.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/temp.lunar,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- temp.lunar	10 Dec 2004 10:46:34 -0000	1.7
+++ temp.lunar	24 Mar 2005 16:38:59 -0000	1.8
@@ -19,8 +19,7 @@
 
 temp_create() {
   debug_msg "temp_create ($@)"
-  mod_v_safe_edit $1
-  TMPFILE=$MOD_V_SNAME
+  TMPFILE=$MODULE
   if TMPFILE=$(mktemp -p "$TMPDIR" -t lunar.`basename $0`.$$.$TMPFILE.XXXXXXXXXX ) ; then
     echo $TMPFILE
   else

Index: tracking.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/tracking.lunar,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- tracking.lunar	14 Dec 2004 15:05:06 -0000	1.14
+++ tracking.lunar	24 Mar 2005 16:38:59 -0000	1.15
@@ -63,10 +63,9 @@
 create_install_log() {
 
   debug_msg "create_install_log ($@)"
-  mod_v_safe_edit $MODULE
 
   TMP_INST_LOG=$(temp_create "install-log")
-  INST_LOG="$INSTALL_LOGS/$MOD_V_SNAME-$VERSION"
+  INST_LOG="$INSTALL_LOGS/$MODULE-$VERSION"
   rm -f $INST_LOG &> /dev/null
 
   message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}${INST_LOG}${DEFAULT_COLOR}"
@@ -74,9 +73,9 @@
   export IFS="$TAB_ENTER_IFS"
 
   parse_iw | sort | uniq | filter  "$LOCAL_EXCLUDED" | exists > $TMP_INST_LOG
-  echo "$INSTALL_LOGS/$MOD_V_SNAME-$VERSION"                 >> $TMP_INST_LOG
-  echo "$COMPILE_LOGS/$MOD_V_SNAME-$VERSION.bz2"             >> $TMP_INST_LOG
-  echo "$MD5SUM_LOGS/$MOD_V_SNAME-$VERSION"                  >> $TMP_INST_LOG
+  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_INST_LOG
                       echo  -n  "/dev/null")
@@ -93,28 +92,26 @@
 
 create_md5sum_log()  {
   debug_msg "create_md5sum_log ($@)"
- mod_v_safe_edit $MODULE
 
-  rm -f $MD5SUM_LOGS/$MOD_V_SNAME-$VERSION &> /dev/null
+  rm -f $MD5SUM_LOGS/$MODULE-$VERSION &> /dev/null
   
-  message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$MD5SUM_LOGS/$MOD_V_SNAME-$VERSION${DEFAULT_COLOR}"
+  message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$MD5SUM_LOGS/$MODULE-$VERSION${DEFAULT_COLOR}"
 
-  files < $INSTALL_LOGS/$MOD_V_SNAME-$VERSION | while read FILE ; do
-    md5sum $FILE >> $MD5SUM_LOGS/$MOD_V_SNAME-$VERSION
+  files < $INSTALL_LOGS/$MODULE-$VERSION | while read FILE ; do
+    md5sum $FILE >> $MD5SUM_LOGS/$MODULE-$VERSION
   done
 
 }
 
 create_install_cache() {
   debug_msg "create_install_cache($@)"
- mod_v_safe_edit $MODULE 
 
   if [ "$ARCHIVE" == "off" ] ; then
     return
   fi
 
-  message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$INSTALL_CACHE/$MOD_V_SNAME-$VERSION-$BUILD.tar.bz2${DEFAULT_COLOR}"
-  tar cPjf "$INSTALL_CACHE/$MOD_V_SNAME-$VERSION-$BUILD.tar.bz2" --no-recursion -T $INSTALL_LOGS/$MOD_V_SNAME-$VERSION
+  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
 
 }
 



More information about the Lunar-commits mailing list