[34872] branches/variant-descs-14482/base

raimue at macports.org raimue at macports.org
Sun Mar 9 15:42:43 PDT 2008


Revision: 34872
          http://trac.macosforge.org/projects/macports/changeset/34872
Author:   raimue at macports.org
Date:     2008-03-09 15:42:41 -0700 (Sun, 09 Mar 2008)

Log Message:
-----------
Merged revisions 34465-34871 via svnmerge from 
https://svn.macports.org/repository/macports/trunk/base

........
  r34467 | raimue at macports.org | 2008-02-26 06:03:08 +0100 (Tue, 26 Feb 2008) | 2 lines
  
  Add Doxyfile to svn:ignore as it is always generated from Doxyfile.in
........
  r34468 | raimue at macports.org | 2008-02-26 06:16:32 +0100 (Tue, 26 Feb 2008) | 3 lines
  
  port/port-help.tcl:
  Correct svn properties
........
  r34512 | afb at macports.org | 2008-02-27 10:36:56 +0100 (Wed, 27 Feb 2008) | 1 line
  
  lint: check that all dependencies actually exist (#14380)
........
  r34513 | afb at macports.org | 2008-02-27 11:00:57 +0100 (Wed, 27 Feb 2008) | 1 line
  
  add target_state variable patch from raimue, for targets that don't need state (#13458)
........
  r34514 | afb at macports.org | 2008-02-27 11:13:27 +0100 (Wed, 27 Feb 2008) | 1 line
  
  avoid double free, thanks to Raim
........
  r34515 | raimue at macports.org | 2008-02-27 11:20:19 +0100 (Wed, 27 Feb 2008) | 3 lines
  
  port1.0/portlivecheck.tcl:
  Use a path in /tmp to avoid issues when ${workpath} does not exist after r34513. See #13458.
........
  r34516 | afb at macports.org | 2008-02-27 11:43:25 +0100 (Wed, 27 Feb 2008) | 1 line
  
  actually get all dependencies, and not just the last one
........
  r34518 | afb at macports.org | 2008-02-27 12:00:08 +0100 (Wed, 27 Feb 2008) | 1 line
  
  add default description for global variants like +universal
........
  r34519 | afb at macports.org | 2008-02-27 12:17:45 +0100 (Wed, 27 Feb 2008) | 1 line
  
  update changelog, #13458 #14380
........
  r34525 | mww at macports.org | 2008-02-27 18:27:19 +0100 (Wed, 27 Feb 2008) | 2 lines
  
  add 'macports-gcc-4.4' as compiler option
........
  r34538 | afb at macports.org | 2008-02-27 22:51:41 +0100 (Wed, 27 Feb 2008) | 1 line
  
  calculate Mac OS X version from Darwin version
........
  r34541 | afb at macports.org | 2008-02-27 23:05:35 +0100 (Wed, 27 Feb 2008) | 4 lines
  
  use current Mac OS X major version for MACOSX_DEPLOYMENT_TARGET
  - let's glibtool in on what is happening, but might break stuff
    (it'll now use two-level namespace, instead of flat namespace)
........
  r34546 | raimue at macports.org | 2008-02-28 04:09:17 +0100 (Thu, 28 Feb 2008) | 5 lines
  
  port/port.tcl:
  Make a difference between:
   * No port specified on command line (fallback to current pseudo-port)
   * Ports specified as pseudo-ports (e.g. maintainer:foobar), but expanded to no ports. Presents an error in this case.
........
  r34552 | afb at macports.org | 2008-02-28 08:06:23 +0100 (Thu, 28 Feb 2008) | 1 line
  
  replace value of MDT environment value instead of appending to it, to avoid doubling up...
........
  r34561 | afb at macports.org | 2008-02-28 10:40:48 +0100 (Thu, 28 Feb 2008) | 1 line
  
  lint: issue error when using nomaintainer together with other or openmaintainer without any other (#14506)
........
  r34667 | raimue at macports.org | 2008-03-02 00:54:44 +0100 (Sun, 02 Mar 2008) | 8 lines
  
  port1.0/portutil.tcl:
   * Add a new function quotemeta, which can be used to escape strings for safe use inside regular expressions
  
  port1.0/portlivecheck.tcl:
   * Escape any variable used inside ${livecheck.regex} using this new function
  
  Closes #14067
........
  r34668 | raimue at macports.org | 2008-03-02 00:59:49 +0100 (Sun, 02 Mar 2008) | 3 lines
  
  port1.0/portlivecheck.tcl:
  Don't use >foo< in debug output as it is hard to read with HTML tags which are widely used in ${livecheck.regex}, use "foo" instead.
........
  r34674 | raimue at macports.org | 2008-03-02 09:43:22 +0100 (Sun, 02 Mar 2008) | 5 lines
  
  port1.0/portlivecheck.tcl:
  Additional fix for r34667, don't use join as it de-escapes the regex
  
  Reverted in r34693.
........
  r34693 | raimue at macports.org | 2008-03-03 00:42:44 +0100 (Mon, 03 Mar 2008) | 4 lines
  
  port1.0/portlivecheck.tcl:
  Revert r34674, it broke other regexes.
  Use lists for ${livecheck.regex} instead of strings, so join always operates on a list.
........
  r34695 | raimue at macports.org | 2008-03-03 02:14:52 +0100 (Mon, 03 Mar 2008) | 3 lines
  
  port1.0/portutil.tcl:
  Refactored the option[-append|-delete] stuff. Less eval'd procs, use interp alias instead.
........
  r34717 | raimue at macports.org | 2008-03-03 20:32:55 +0100 (Mon, 03 Mar 2008) | 3 lines
  
  port1.0/portlivecheck.tcl:
  Fix a bug introduced in r34331, which printed a wrong error message. Closes #14532.
........
  r34761 | reiffert at macports.org | 2008-03-04 19:38:25 +0100 (Tue, 04 Mar 2008) | 1 line
  
  Adjust prefix representing the py30 Framework install.
........
  r34816 | raimue at macports.org | 2008-03-06 23:37:44 +0100 (Thu, 06 Mar 2008) | 3 lines
  
  port1.0/portlivecheck.tcl:
  Fix livecheck for gnu
........
  r34844 | afb at macports.org | 2008-03-08 21:57:44 +0100 (Sat, 08 Mar 2008) | 1 line
  
  block size guess comes up short, use -srcfolder option instead (#13968)
........

Modified Paths:
--------------
    branches/variant-descs-14482/base/ChangeLog
    branches/variant-descs-14482/base/src/package1.0/portmdmg.tcl
    branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c
    branches/variant-descs-14482/base/src/port/port.tcl
    branches/variant-descs-14482/base/src/port1.0/portconfigure.tcl
    branches/variant-descs-14482/base/src/port1.0/portlint.tcl
    branches/variant-descs-14482/base/src/port1.0/portlivecheck.tcl
    branches/variant-descs-14482/base/src/port1.0/portmain.tcl
    branches/variant-descs-14482/base/src/port1.0/portutil.tcl
    branches/variant-descs-14482/base/src/port1.0/resources/group/python30-1.0.tcl

Property Changed:
----------------
    branches/variant-descs-14482/base/
    branches/variant-descs-14482/base/src/port/port-help.tcl


Property changes on: branches/variant-descs-14482/base
___________________________________________________________________
Name: svn:ignore
   - autom4te.cache
config.log
config.status
Makefile

   + autom4te.cache
config.log
config.status
Makefile
Doxyfile

Name: svnmerge-integrated
   - /trunk/base:1-34464
   + /trunk/base:1-34871

Modified: branches/variant-descs-14482/base/ChangeLog
===================================================================
--- branches/variant-descs-14482/base/ChangeLog	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/ChangeLog	2008-03-09 22:42:41 UTC (rev 34872)
@@ -5,6 +5,10 @@
 
 
 Unreleased:
+    - port lint now checks all dependencies so that the ports actually exist (#14380)
+
+    - added target_state to avoid the need for privileges for lint/livecheck (#13458)
+
     - Overhauled output for port info/deps/dependents/search (raimue in
 	r34354, r34371, r34391, r34395, r34402, r34420)
 

Modified: branches/variant-descs-14482/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/variant-descs-14482/base/src/package1.0/portmdmg.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/package1.0/portmdmg.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -73,7 +73,7 @@
 	# there is a minimum of 8292 512 blocks in a dmg
         set blocks 8292
     } else {
-	# this should later be replaced with hdiutil create -srcfolder
+	# this is now replaced with hdiutil create -srcfolder
         set blocks [expr ($size/512) + ((($size/512)*3)/100)]
     }
     
@@ -86,6 +86,7 @@
         set subdev 2
     }
     
+  if {false} {
     if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
@@ -96,6 +97,11 @@
     regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
     system "ditto -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
     system "hdiutil detach ${devicename} -quiet"
+  } else {
+    if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
+        return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
+    }
+  }
     if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
         return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
     }

Modified: branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c	2008-03-09 22:42:41 UTC (rev 34872)
@@ -806,7 +806,6 @@
 
 	tcl_result = Tcl_NewStringObj(sp, -1);
 	Tcl_SetObjResult(interp, tcl_result);
-	free(sp);
 	free(template);
 	return TCL_OK;
 }


Property changes on: branches/variant-descs-14482/base/src/port/port-help.tcl
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: branches/variant-descs-14482/base/src/port/port.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port/port.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port/port.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -306,11 +306,19 @@
 
 # Supply a default porturl/portname if the portlist is empty
 proc require_portlist { nameportlist } {
+    global private_options
     upvar $nameportlist portlist
 
+    if {[llength $portlist] == 0 && (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == "no")} {
+        ui_error "No ports found"
+        return 1
+    }
+
     if {[llength $portlist] == 0} {
         set portlist [get_current_port]
     }
+
+    return 0
 }
 
 
@@ -1209,7 +1217,9 @@
 
 proc action_info { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
 
     set separator ""
     foreachport $portlist {
@@ -1414,7 +1424,9 @@
 
 proc action_location { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         if { [catch {set ilist [registry_installed $portname [composite_version $portversion [array get variations]]]} result] } {
             global errorInfo
@@ -1472,7 +1484,9 @@
 
 proc action_activate { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         if { [catch {portimage::activate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
             global errorInfo
@@ -1487,7 +1501,9 @@
 
 proc action_deactivate { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
             global errorInfo
@@ -1514,7 +1530,9 @@
 
 proc action_upgrade { action portlist opts } {
     global global_variations
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         # Merge global variations into the variations specified for this port
         foreach { variation value } [array get global_variations] {
@@ -1553,7 +1571,9 @@
 
 proc action_compact { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         if { [catch {portimage::compact $portname [composite_version $portversion [array get variations]]} result] } {
             global errorInfo
@@ -1568,7 +1588,9 @@
 
 proc action_uncompact { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         if { [catch {portimage::uncompact $portname [composite_version $portversion [array get variations]]} result] } {
             global errorInfo
@@ -1582,7 +1604,9 @@
 
 
 proc action_dependents { action portlist opts } {
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     set ilist {}
 
     foreachport $portlist {
@@ -1623,7 +1647,9 @@
         set portlist [opUnion $portlist [get_inactive_ports]]
     } else {
         # Otherwise the user hopefully supplied a portlist, or we'll default to the existing directory
-        require_portlist portlist
+        if {[require_portlist portlist]} {
+            return 1
+        }
     }
 
     foreachport $portlist {
@@ -1644,7 +1670,7 @@
     set restrictedList 0
     set ilist {}
     
-    if { [llength $portlist] || ![info exists private_options(ports_no_args)] } {
+    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == "no")} {
         set restrictedList 1
         foreachport $portlist {
             set composite_version [composite_version $portversion [array get variations]]
@@ -1699,7 +1725,7 @@
     # If port names were supplied, limit ourselves to those ports, else check all installed ports
     set ilist {}
     set restrictedList 0
-    if { [llength $portlist] || ![info exists private_options(ports_no_args)] } {
+    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == "no")} {
         set restrictedList 1
         foreach portspec $portlist {
             array set port $portspec
@@ -1817,7 +1843,9 @@
 
 proc action_contents { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         set files [registry::port_registered $portname]
         if { $files != 0 } {
@@ -1840,7 +1868,9 @@
 
 proc action_deps { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         # Get info about the port
         if {[catch {mportsearch $portname no exact} result]} {
@@ -1887,7 +1917,9 @@
 
 proc action_variants { action portlist opts } {
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         # search for port
         if {[catch {mportsearch $portname no exact} result]} {
@@ -1955,7 +1987,7 @@
 proc action_search { action portlist opts } {
     global private_options
     set status 0
-    if {![llength $portlist] && [info exists private_options(ports_no_args)]} {
+    if {![llength $portlist] && [info exists private_options(ports_no_args)] && $private_options(ports_no_args) == "yes"} {
         ui_error "You must specify a search pattern"
         return 1
     }
@@ -2023,7 +2055,7 @@
     set status 0
     
     # Default to list all ports if no portnames are supplied
-    if { ![llength $portlist] && [info exists private_options(ports_no_args)] } {
+    if { ![llength $portlist] && [info exists private_options(ports_no_args)] && $private_options(ports_no_args) == "yes"} {
         add_to_portlist portlist [list name "-all-"]
     }
     
@@ -2082,7 +2114,9 @@
     global current_portdir
     
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         # If we have a url, use that, since it's most specific, otherwise try to map the portname to a url
         if {$porturl == ""} {
@@ -2222,7 +2256,9 @@
 proc action_target { action portlist opts } {
     global global_variations
     set status 0
-    require_portlist portlist
+    if {[require_portlist portlist]} {
+        return 1
+    }
     foreachport $portlist {
         set target $action
 

Modified: branches/variant-descs-14482/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portconfigure.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/portconfigure.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -363,6 +363,15 @@
                 fc  ${prefix}/bin/gfortran-mp-4.3 \
                 f77 ${prefix}/bin/gfortran-mp-4.3 \
                 f90 ${prefix}/bin/gfortran-mp-4.3 }
+        macports-gcc-4.4 {
+            select_compiler "MacPorts gcc 4.4" \
+                cc  ${prefix}/bin/gcc-mp-4.4 \
+                objc ${prefix}/bin/gcc-mp-4.4 \
+                cxx ${prefix}/bin/g++-mp-4.4 \
+                cpp ${prefix}/bin/cpp-mp-4.4 \
+                fc  ${prefix}/bin/gfortran-mp-4.4 \
+                f77 ${prefix}/bin/gfortran-mp-4.4 \
+                f90 ${prefix}/bin/gfortran-mp-4.4 }
         default {
             ui_debug "No compiler collection selected explicitly" }
     }

Modified: branches/variant-descs-14482/base/src/port1.0/portlint.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portlint.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/portlint.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -7,6 +7,7 @@
 
 set org.macports.lint [target_new org.macports.lint lint_main]
 target_runtype ${org.macports.lint} always
+target_state ${org.macports.lint} no
 target_provides ${org.macports.lint} lint
 target_requires ${org.macports.lint} main
 target_prerun ${org.macports.lint} lint_start
@@ -283,7 +284,7 @@
     set portarch ${os.arch}
     global description long_description platforms categories all_variants
     global maintainers homepage master_sites checksums patchfiles
-    global fetch.type
+    global depends_lib depends_build depends_run fetch.type
     
     global lint_portsystem lint_platforms lint_categories 
     global lint_required lint_optional lint_variants
@@ -402,6 +403,8 @@
                     ui_warn "Variant $variantname does not have a description"
                     incr warnings
                     set desc_ok false
+                } elseif {$variantdesc == ""} {
+                    set variantdesc "(pre-defined variant)"
                 }
             }
 
@@ -416,6 +419,35 @@
         incr variantnumber
     }
 
+    set all_depends {}
+    if {[info exists depends_lib]} { eval "lappend all_depends $depends_lib" }
+    if {[info exists depends_build]} { eval "lappend all_depends $depends_build" }
+    if {[info exists depends_run]} { eval "lappend all_depends $depends_run" }
+    foreach depspec $all_depends {
+        set dep [lindex [split $depspec :] end]
+        if {[catch {set res [mport_search "^$dep\$"]} error]} {
+            global errorInfo
+            ui_debug "$errorInfo"
+            continue
+        }
+        if {$res == ""} {
+            ui_error "Unknown dependency: $dep"
+            incr errors
+        } else {
+            ui_info "OK: Found dependency: $dep"
+        }
+    }
+
+    if {[regexp "^(.+)nomaintainer(@macports.org)?(.+)$" $maintainers] } {
+        ui_error "Using nomaintainer together with other maintainer"
+        incr errors
+    }
+
+    if {[regexp "^openmaintainer(@macports.org)?$" $maintainers] } {
+        ui_error "Using openmaintainer without any other maintainer"
+        incr errors
+    }
+
     if {[string match "*darwinports at opendarwin.org*" $maintainers]} {
         ui_warn "Using legacy email address for no/open maintainer"
         incr warnings

Modified: branches/variant-descs-14482/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portlivecheck.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/portlivecheck.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -64,7 +64,7 @@
     set has_master_sites [info exists master_sites]
     set has_homepage [info exists homepage]
 
-    set tempfile ${workpath}/livecheck.TMP
+    set tempfile [mktemp "/tmp/mports.livecheck.XXXXXXXX"]
     set port_moddate [file mtime ${portpath}/Portfile]
 
     ui_debug "Portfile modification date is [clock format $port_moddate]"
@@ -112,7 +112,7 @@
                 set livecheck.url "http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml"
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex "<latest_release_version>(.*)</latest_release_version>"
+                set livecheck.regex [list "<latest_release_version>(.*)</latest_release_version>"]
             }
             set livecheck.check "regex"
         }
@@ -124,7 +124,7 @@
                 set livecheck.distname ${livecheck.name}
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex "<title>${livecheck.distname} (.*) released.*</title>"
+                set livecheck.regex [list "<title>[quotemeta ${livecheck.distname}] (.*) released.*</title>"]
             }
             set livecheck.check "regex"
         }
@@ -136,7 +136,7 @@
                 set livecheck.distname [regsub ***=${livecheck.version} [file tail [lindex ${distfiles} 0]] (.*)]
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex {<a href="http://${livecheck.name}.googlecode.com/files/${livecheck.distname}"}
+                set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/[quotemeta ${livecheck.distname}]\""]
             }
             set livecheck.check "regex"
         }
@@ -148,7 +148,7 @@
                 set livecheck.distname ${livecheck.name}
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex {${livecheck.distname}-(\\d+(?:\\.\\d+)*)}
+                set livecheck.regex [list "[quotemeta ${livecheck.distname}]-(\\d+(?:\\.\\d+)*)"]
             }
             set livecheck.check "regex"
         }
@@ -169,8 +169,8 @@
                 # let's extract the version from the file.
                 set chan [open $tempfile "r"]
                 set updated -1
-                set the_re [subst -nocommands -nobackslashes [join ${livecheck.regex}]]
-                ui_debug "The regex is >$the_re<"
+                set the_re [join ${livecheck.regex}]
+                ui_debug "The regex is \"$the_re\""
                 if {${livecheck.check} == "regexm"} {
                     set data [read $chan]
                     if {[regexp $the_re $data matched updated_version]} {
@@ -179,25 +179,28 @@
                         } else {
                             set updated 0
                         }
-                        ui_debug "The regex matched >$matched<"
+                        ui_debug "The regex matched \"$matched\", extracted \"$updated_version\""
                     }
                 } else {
                     set updated_version 0
-                    while {1} {
-                        if {[gets $chan line] < 0} {
-                            break
-                        }
+                    set foundmatch 0
+                    while {[gets $chan line] >= 0} {
                         if {[regexp $the_re $line matched upver]} {
+                            set foundmatch 1
                             if {[rpm-vercomp $upver $updated_version] > 0} {
                                 set updated_version $upver
                             }
-                            ui_debug "The regex matched >$matched<"
+                            ui_debug "The regex matched \"$matched\", extracted \"$upver\""
                         }
                     }
-                    if {$updated_version != ${livecheck.version}} {
-                        set updated 1
-                    } else {
-                        set updated 0
+                    if {$foundmatch == 1} {
+                        if {$updated_version == 0} {
+                            set updated -1
+                        } elseif {$updated_version != ${livecheck.version}} {
+                            set updated 1
+                        } else {
+                            set updated 0
+                        }
                     }
                 }
                 close $chan

Modified: branches/variant-descs-14482/base/src/port1.0/portmain.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portmain.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/portmain.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -38,6 +38,7 @@
 
 set org.macports.main [target_new org.macports.main main]
 target_provides ${org.macports.main} main
+target_state ${org.macports.main} no
 
 # define options
 options prefix name version revision epoch categories maintainers
@@ -73,8 +74,6 @@
 default install.user {${portutil::autoconf::install_user}}
 default install.group {${portutil::autoconf::install_group}}
 
-default macosx_deployment_target {}
-
 # Compatibility namespace
 default portname {$name}
 default portversion {$version}
@@ -85,15 +84,25 @@
 set os_arch $tcl_platform(machine)
 if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
 if {$os_arch == "i586" || $os_arch == "i686"} { set os_arch "i386" }
-set os_major [lindex [split $tcl_platform(osVersion) .] 0]
+set os_version $tcl_platform(osVersion)
+set os_major [lindex [split $os_version .] 0]
+set os_platform [string tolower $tcl_platform(os)]
 
-default os.platform {[string tolower $tcl_platform(os)]}
-default os.version {$tcl_platform(osVersion)}
+default os.platform {$os_platform}
+default os.version {$os_version}
 default os.major {$os_major}
 default os.arch {$os_arch}
 # Remove trailing "Endian"
 default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]}
 
+set macosx_version {}
+if {$os_platform == "darwin"} {
+    # This will probably break when Apple changes versioning
+    set macosx_version [expr 10.0 + ($os_major - 4) / 10.0]
+}
+
+default macosx_deployment_target {$macosx_version}
+
 # Select implicit variants
 if {[info exists os.platform] && ![info exists variations(${os.platform})]} { variant_set ${os.platform}}
 if {[info exists os.arch] && ![info exists variations(${os.arch})]} { variant_set ${os.arch} }

Modified: branches/variant-descs-14482/base/src/port1.0/portutil.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portutil.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/portutil.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -82,6 +82,57 @@
     return [info exists $name]
 }
 
+##
+# Handle an option
+#
+# @param option name of the option
+# @param args arguments
+proc handle_option {option args} {
+    global $option user_options option_procs
+
+    if {![info exists user_options($option)]} {
+        set $option $args
+    }
+}
+
+##
+# Handle option-append
+#
+# @param option name of the option
+# @param args arguments
+proc handle_option-append {option args} {
+    global $option user_options option_procs
+
+    if {![info exists user_options($option)]} {
+        if {[info exists $option]} {
+            set $option [concat [set $option] $args]
+        } else {
+            set $option $args
+        }
+    }
+}
+
+##
+# Handle option-delete
+#
+# @param option name of the option
+# @param args arguments
+proc handle_option-delete {option args} {
+    global $option user_options option_procs
+
+    if {![info exists user_options($option)] && [info exists $option]} {
+        set temp [set $option]
+        foreach val $args {
+            set temp [ldelete $temp $val]
+        }
+        if {$temp eq ""} {
+            unset $option
+        } else {
+            set $option $temp
+        }
+    }
+}
+
 # options
 # Exports options in an array as externally callable procedures
 # Thus, "options name date" would create procedures named "name"
@@ -91,80 +142,83 @@
 # Arguments: <list of options>
 proc options {args} {
     foreach option $args {
-        proc $option {args} [subst -nocommands {
-            global $option user_options option_procs
-            if {![info exists user_options($option)]} {
-                set $option \$args
-            }
-        }]
-        proc ${option}-delete {args} [subst -nocommands {
-            global $option user_options option_procs
-            if {![info exists user_options($option)] && [info exists $option]} {
-                set temp [set $option]
-                foreach val \$args {
-                   set temp [ldelete \$temp \$val]
-                }
-                if {\$temp eq ""} {
-                    unset $option
-                } else {
-                    set $option \$temp
-                }
-            }
-        }]
-        proc ${option}-append {args} [subst -nocommands {
-            global $option user_options option_procs
-            if {![info exists user_options($option)]} {
-                if {[info exists $option]} {
-                    set $option [concat \${$option} \$args]
-                } else {
-                    set $option \$args
-                }
-            }
-        }]
+        interp alias {} $option {} handle_option $option
+        interp alias {} $option-append {} handle_option-append $option
+        interp alias {} $option-delete {} handle_option-delete $option
     }
 }
 
+##
+# Export options into PortInfo
+#
+# @param option the name of the option
+# @param action set or delete
+# @param value the value to be set, defaults to an empty string
+proc options::export {option action {value ""}} {
+    global $option PortInfo
+    switch $action {
+        set {
+            set PortInfo($option) $value
+        }
+        delete {
+            unset PortInfo($option)
+        }
+    }
+}
+
+##
+# Export multiple options
+#
+# @param args list of ports to be exported
 proc options_export {args} {
     foreach option $args {
-        proc options::export-${option} {option action {value ""}} [subst -nocommands {
-            global $option PortInfo
-            switch \$action {
-                set {
-                    set PortInfo($option) \$value
-                }
-                delete {
-                    unset PortInfo($option)
-                }
-            }
-        }]
-        option_proc $option options::export-$option
+        option_proc $option options::export
     }
 }
 
-# option_deprecate
+##
+# Print a warning for deprecated ports
+#
+# @param args list of ports to be exported
+proc warn_deprecated_option {option action args} {
+    global portname $option $newoption
+
+    ui_warn "Port $portname using deprecated option \"$option\"."
+}
+
+proc warn_superseded_option {option newport action args} {
+    global portname $option $newoption
+
+    if {$action != "read"} {
+        $newoption [set $option]
+    } else {
+        ui_warn "Port $portname using deprecated option \"$option\"."
+        $option [set $newoption]
+    }
+}
+
+
+##
 # Causes a warning to be printed when an option is set or accessed
+#
+# @param option name of the option
+# @param newoption name of a superseding option
 proc option_deprecate {option {newoption ""} } {
     # If a new option is specified, default the option to {${newoption}}
     # Display a warning
     if {$newoption != ""} {
-        proc warn_deprecated_${option} {option action args} [subst -nocommands {
-            global portname $option $newoption
-            if {\$action != "read"} {
-                $newoption \$$option
-            } else {
-                ui_warn "Port \$portname using deprecated option \\\"$option\\\"."
-                $option \[set $newoption\]
-            }
-        }]
+        option_proc $option warn_deprecated_option $option
     } else {
-        proc warn_deprecated_$option {option action args} [subst -nocommands {
-            global portname $option $newoption
-            ui_warn "Port \$portname using deprecated option \\\"$option\\\"."
-        }]
+        option_proc $option warn_superseded_option $option $newoption
     }
-    option_proc $option warn_deprecated_$option
+
 }
 
+##
+# Registers a proc to be called when an option is changed
+#
+# @param option the name of the option
+# @param args name of proc (and additional arguments)
 proc option_proc {option args} {
     global option_procs $option
     if {[info exists option_procs($option)]} {
@@ -275,7 +329,7 @@
         parse_environment ${command}
     }
     if {[option macosx_deployment_target] ne ""} {
-        append_list_to_environment_value ${command} "MACOSX_DEPLOYMENT_TARGET" [option macosx_deployment_target]
+        set ${command}.env_array("MACOSX_DEPLOYMENT_TARGET") [option macosx_deployment_target]
     }
     
     # Debug that.
@@ -1038,6 +1092,11 @@
     set result 0
     set skipped 0
     set procedure [ditem_key $ditem procedure]
+            
+    if {[ditem_key $ditem state] != "no"} {
+        set target_state_fd [open_statefile]
+    }
+        
     if {$procedure != ""} {
         set name [ditem_key $ditem name]
     
@@ -1048,7 +1107,8 @@
         if {$result == 0} {
             # Skip the step if required and explain why through ui_debug.
             # 1st case: the step was already done (as mentioned in the state file)
-            if {[check_statefile target $name $target_state_fd]} {
+            if {[ditem_key $ditem state] != "no"
+                    && [check_statefile target $name $target_state_fd]} {
                 ui_debug "Skipping completed $name ($portname)"
                 set skipped 1
             # 2nd case: the step is not to always be performed
@@ -1233,6 +1293,10 @@
         set result 1
     }
     
+    if {[ditem_key $ditem state] != "no"} {
+        close $target_state_fd
+    }
+
     return $result
 }
 
@@ -1285,9 +1349,6 @@
         }
     }
     
-    # Restore the state from a previous run.
-    set target_state_fd [open_statefile]
-    
     set dlist [dlist_eval $dlist "" target_run]
     
     if {[llength $dlist] > 0} {
@@ -1302,7 +1363,6 @@
         set result 0
     }
     
-    close $target_state_fd
     return $result
 }
 
@@ -1564,8 +1624,10 @@
     # - Skip this test if the statefile is empty.
     # - Skip this test if performing a clean or submit.
     # - Skip this test if ports_force was specified.
-    
-    if { [lsearch "clean submit" $target] < 0 && 
+   
+    # TODO: Don't hardcode this list of targets here,
+    #       check for [ditem_key $mport state] == "no" somewhere else instead
+    if { [lsearch "clean submit lint livecheck" $target] < 0 &&
         !([info exists ports_force] && $ports_force == "yes")} {
         
         set state_fd [open_statefile]
@@ -2041,3 +2103,13 @@
     }
 }
 
+##
+# Escape a string for safe use in regular expressions
+#
+# @param str the string to be quoted
+# @return the escaped string
+proc quotemeta {str} {
+    regsub -all {(\W)} $str {\\\1} str
+    return $str
+}
+

Modified: branches/variant-descs-14482/base/src/port1.0/resources/group/python30-1.0.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/resources/group/python30-1.0.tcl	2008-03-09 21:35:43 UTC (rev 34871)
+++ branches/variant-descs-14482/base/src/port1.0/resources/group/python30-1.0.tcl	2008-03-09 22:42:41 UTC (rev 34872)
@@ -32,6 +32,8 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+set prefix ${prefix}/Library/Frameworks/Python.framework/Versions/3.0
+
 set python.bin	${prefix}/bin/python3.0
 set python.lib	${prefix}/lib/libpython3.0.dylib
 set python.pkgd	${prefix}/lib/python3.0/site-packages

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080309/d9caed3f/attachment-0001.html 


More information about the macports-changes mailing list