[55270] branches/images-and-archives/base

blb at macports.org blb at macports.org
Fri Aug 7 17:27:03 PDT 2009


Revision: 55270
          http://trac.macports.org/changeset/55270
Author:   blb at macports.org
Date:     2009-08-07 17:27:03 -0700 (Fri, 07 Aug 2009)
Log Message:
-----------
Merge from trunk

Modified Paths:
--------------
    branches/images-and-archives/base/doc/macports.conf.5
    branches/images-and-archives/base/portmgr/dmg/postflight
    branches/images-and-archives/base/src/macports1.0/macports.tcl
    branches/images-and-archives/base/src/port1.0/portconfigure.tcl
    branches/images-and-archives/base/src/port1.0/portfetch.tcl
    branches/images-and-archives/base/src/port1.0/portlint.tcl
    branches/images-and-archives/base/src/port1.0/portmain.tcl

Property Changed:
----------------
    branches/images-and-archives/base/


Property changes on: branches/images-and-archives/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-54977
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-55269
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/images-and-archives/base/doc/macports.conf.5
===================================================================
--- branches/images-and-archives/base/doc/macports.conf.5	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/doc/macports.conf.5	2009-08-08 00:27:03 UTC (rev 55270)
@@ -55,11 +55,6 @@
 .br
 .Ic Default:
 /opt/local
-.It Va x11prefix
-Path containing an X11 installation on your system.
-.br
-.Ic Default:
-/usr/X11R6
 .It Va portdbpath
 Directory where MacPorts keeps working data as downloaded sources, installed ports receipts
 and the main registry. Same path restrictions apply as for '${prefix}'.
@@ -171,7 +166,7 @@
 the paths for locating utilities such as rsync, tar, cvs and others.
 .br
 .Ic Default:
-${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:${x11prefix}/bin
+${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin
 .It Va extra_env
 List of extra environment variables MacPorts should keep in the user's environment when sanitizing it.
 .El

Modified: branches/images-and-archives/base/portmgr/dmg/postflight
===================================================================
--- branches/images-and-archives/base/portmgr/dmg/postflight	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/portmgr/dmg/postflight	2009-08-08 00:27:03 UTC (rev 55270)
@@ -35,12 +35,13 @@
 #set -x
 
 # Script identification ('cause more often than not the svn Id is not expanded):
-VERSION=1.7.0
+VERSION=1.8.0
 
 # Abstraction variables:
 PREFIX=/opt/local
 BINPATH=${PREFIX}/bin
 SBINPATH=${PREFIX}/sbin
+CONFIGPATH=${PREFIX}/etc/macports
 MANPAGES=${PREFIX}/share/man
 TCLSH=/usr/bin/tclsh
 TCL_PACKAGE_DIR=/Library/Tcl
@@ -48,6 +49,14 @@
 BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
 OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
 
+# Create config files from defaults if not present
+function setup_configs {
+    for f in macports.conf sources.conf variants.conf ; do
+        if [ ! -f ${CONFIGPATH}/${f} ]; then
+            /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f}
+        fi
+    done
+}
 
 # Command to update the MacPorts installation through "selfupdate":
 function update_macports {
@@ -100,6 +109,9 @@
 
 echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
 
+# Set up config files
+setup_configs
+
 # Remove old stuff
 cleanup_man
 

Modified: branches/images-and-archives/base/src/macports1.0/macports.tcl
===================================================================
--- branches/images-and-archives/base/src/macports1.0/macports.tcl	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/src/macports1.0/macports.tcl	2009-08-08 00:27:03 UTC (rev 55270)
@@ -1481,8 +1481,9 @@
         set dep_portname [lindex [split $depspec :] end]
         if {![info exists depscache(port:$dep_portname)] && [registry::entry_exists_for_name $dep_portname]} {
             set status [macports::upgrade $dep_portname "port:$dep_portname" {} $variations $options depscache]
-            if {$status != 0 && ![macports::ui_isset ports_processall]} {
-                return -code error "upgrade $portname failed"
+            # status 2 means the port was not found in the index
+            if {$status != 0 && $status != 2 && ![macports::ui_isset ports_processall]} {
+                return -code error "upgrade $dep_portname failed"
             }
         }
     }
@@ -2231,6 +2232,7 @@
 }
 
 # upgrade procedure
+# return codes: 0 = success, 1 = general failure, 2 = port name not found in index
 proc macports::upgrade {portname dspec globalvarlist variationslist optionslist {depscachename ""}} {
     array set options $optionslist
 
@@ -2259,8 +2261,8 @@
     }
     # argh! port doesnt exist!
     if {$result == ""} {
-        ui_error "No port $portname found."
-        return 1
+        ui_warn "No port $portname found in the index."
+        return 2
     }
     # fill array with information
     array set portinfo [lindex $result 1]
@@ -2535,8 +2537,9 @@
     if {[info exists options(ports_upgrade_force)] || $epoch_override == 1
         || ![registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
         if {[catch {set result [mportexec $workername imagefile]} result] || $result != 0} {
-            global errorInfo
-            ui_debug "$errorInfo"
+            if {[info exists ::errorInfo]} {
+                ui_debug "$::errorInfo"
+            }
             ui_error "Unable to upgrade port: $result"
             catch {mportclose $workername}
             return 1

Modified: branches/images-and-archives/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portconfigure.tcl	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/src/port1.0/portconfigure.tcl	2009-08-08 00:27:03 UTC (rev 55270)
@@ -62,14 +62,56 @@
 option_proc use_autoconf    portconfigure::set_configure_type
 option_proc use_xmkmf       portconfigure::set_configure_type
 
+option_proc autoreconf.cmd  portconfigure::set_configure_type
+option_proc automake.cmd    portconfigure::set_configure_type
+option_proc autoconf.cmd    portconfigure::set_configure_type
+option_proc xmkmf.cmd       portconfigure::set_configure_type
+
+##
+# Local helper proc
+proc portconfigure::add_build_dep { type dep } {
+    global ${type}.cmd option_defaults
+
+    if {![info exists ${type}.cmd] || (
+        ([info exists option_defaults(${type}.cmd)] && [set ${type}.cmd] == $option_defaults(${type}.cmd)) ||
+        (![info exists option_defaults(${type}.cmd)] && [set ${type}.cmd] == "${type}")
+        )} {
+            eval depends_build-append $dep
+    }
+}
+
+##
+# Adds dependencies for the binaries which will be called, but only if it is
+# the default. If .cmd was overwritten the port has to care for deps itself.
 proc portconfigure::set_configure_type {option action args} {
-    if {[string equal ${action} "set"] && [tbool args]} {
+    global autoreconf.cmd automake.cmd autoconf.cmd xmkmf.cmd
+
+    array set configure_map {
+        autoconf    {port:autoconf port:automake port:libtool}
+        xmkmf       port:imake
+    }
+
+    if {[string equal ${action} "set"]} {
         switch $option {
+            autoreconf.cmd  -
+            automake.cmd    -
+            autoconf.cmd {
+                eval depends_build-delete $configure_map(autoconf)
+            }
+            xmkmf.cmd {
+                depends_build-delete $configure_map(xmkmf)
+            }
             use_xmkmf {
-                depends_build-append port:imake
+                if {[tbool args]} {
+                    depends_build-append $configure_map(xmkmf)
+                }
             }
             default {
-                depends_build-append port:autoconf port:automake port:libtool
+                # strip "use_"
+                set type [string range $option 4 end]
+                if {[tbool args]} {
+                    add_build_dep $type $configure_map(autoconf)
+                }
             }
         }
     }

Modified: branches/images-and-archives/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portfetch.tcl	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/src/port1.0/portfetch.tcl	2009-08-08 00:27:03 UTC (rev 55270)
@@ -649,8 +649,8 @@
 
                     # Special hack to check for sourceforge mirrors, which don't return a proper error code on failure
                     if {![string equal $effectiveURL $file_url] &&
-                        [string match "*sourceforge*" $file_url] &&
-                        [string match "*failedmirror*" $effectiveURL]} {
+                        [string match "http://*sourceforge.net/*" $file_url] &&
+                        [string match "http://*sourceforge.net/projects/*/files/" $effectiveURL]} {
 
                         # *SourceForge hackage in effect*
                         # The url seen by curl seems to have been a redirect to the sourceforge mirror page

Modified: branches/images-and-archives/base/src/port1.0/portlint.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-08-08 00:27:03 UTC (rev 55270)
@@ -447,6 +447,22 @@
         }
     }
 
+    # Check for multiple dependencies
+    foreach deptype {depends_extract depends_lib depends_build depends_run} {
+        if {[info exists $deptype]} {
+            array set depwarned {}
+            foreach depspec [set $deptype] {
+                if {![info exists depwarned($depspec)]
+                        && [llength [lsearch -exact -all [set $deptype] $depspec]] > 1} {
+                    ui_warn "Dependency $depspec specified multiple times in $deptype"
+                    incr warnings
+                    # Report each depspec only once
+                    set depwarned($depspec) yes
+                }
+            }
+        }
+    }
+
     if {[regexp "^(.+)nomaintainer(@macports.org)?(.+)$" $maintainers] } {
         ui_error "Using nomaintainer together with other maintainer"
         incr errors

Modified: branches/images-and-archives/base/src/port1.0/portmain.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portmain.tcl	2009-08-08 00:23:13 UTC (rev 55269)
+++ branches/images-and-archives/base/src/port1.0/portmain.tcl	2009-08-08 00:27:03 UTC (rev 55270)
@@ -126,7 +126,7 @@
 
 # if unable to write to workpath, implies running without either root privileges
 # or a shared directory owned by the group so use ~/.macports
-if { $euid != 0 && ([info exists workpath] && [file exists $workpath] && ![file writable $workpath]) || [info exists portdbpath] && ![file writable [file join $portdbpath build]] } {
+if { $euid != 0 && (([info exists workpath] && [file exists $workpath] && ![file writable $workpath]) || ([info exists portdbpath] && ![file writable [file join $portdbpath build]])) } {
 
     set username [uid_to_name [getuid]]
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090807/45cf27d6/attachment-0001.html>


More information about the macports-changes mailing list