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

blb at macports.org blb at macports.org
Fri May 29 23:23:02 PDT 2009


Revision: 51654
          http://trac.macports.org/changeset/51654
Author:   blb at macports.org
Date:     2009-05-29 23:23:02 -0700 (Fri, 29 May 2009)
Log Message:
-----------
Merge from trunk

Modified Paths:
--------------
    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/portlivecheck.tcl
    branches/images-and-archives/base/src/port1.0/portutil.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/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-51567
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-51653
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/images-and-archives/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portconfigure.tcl	2009-05-30 05:49:46 UTC (rev 51653)
+++ branches/images-and-archives/base/src/port1.0/portconfigure.tcl	2009-05-30 06:23:02 UTC (rev 51654)
@@ -314,8 +314,8 @@
         }
         clang {
             switch -exact ${type} {
-                cc   { set ret /usr/bin/clang }
-                objc { set ret /usr/bin/clang }
+                cc   { set ret /Developer/usr/bin/clang }
+                objc { set ret /Developer/usr/bin/clang }
             }
         }
         apple-gcc-3.3 {

Modified: branches/images-and-archives/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portfetch.tcl	2009-05-30 05:49:46 UTC (rev 51653)
+++ branches/images-and-archives/base/src/port1.0/portfetch.tcl	2009-05-30 06:23:02 UTC (rev 51654)
@@ -57,7 +57,7 @@
     fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
     master_sites.mirror_subdir patch_sites.mirror_subdir \
     cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
-    svn.url svn.tag svn.revision svn.method \
+    svn.url svn.revision svn.method \
     git.url git.branch \
     hg.url hg.tag
 
@@ -85,7 +85,6 @@
 default svn.cmd {$portutil::autoconf::svn_path}
 default svn.dir {${workpath}}
 default svn.method {export}
-default svn.tag ""
 default svn.revision ""
 default svn.env {}
 default svn.pre_args {"--non-interactive"}

Modified: branches/images-and-archives/base/src/port1.0/portlint.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-05-30 05:49:46 UTC (rev 51653)
+++ branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-05-30 06:23:02 UTC (rev 51654)
@@ -474,6 +474,23 @@
         }
     }
 
+    # Check for use of deprecated options
+    set deprecated_options_name [get_deprecated_options]
+    global $deprecated_options_name
+    foreach option [array names $deprecated_options_name] {
+        set newoption [lindex [set ${deprecated_options_name}($option)] 0]
+        set refcount  [lindex [set ${deprecated_options_name}($option)] 1]
+
+        if {$refcount > 0} {
+            if {$newoption != ""} {
+                ui_warn "Using deprecated option '$option', superseded by '$newoption'"
+            } else {
+                ui_warn "Using deprecated option '$option'"
+            }
+            incr warnings
+        }
+    }
+
     ### TODO: more checks to Tcl variables/sections
 
     ui_debug "Name: $name"

Modified: branches/images-and-archives/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portlivecheck.tcl	2009-05-30 05:49:46 UTC (rev 51653)
+++ branches/images-and-archives/base/src/port1.0/portlivecheck.tcl	2009-05-30 06:23:02 UTC (rev 51654)
@@ -46,19 +46,23 @@
 }
 
 # define options
-options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
 
 # defaults
 default livecheck.url {$homepage}
 default livecheck.check default
+default livecheck.type default
 default livecheck.md5 ""
 default livecheck.regex ""
 default livecheck.name default
 default livecheck.distname default
 default livecheck.version {$version}
 
+# Deprecation
+option_deprecate livecheck.check livecheck.type
+
 proc portlivecheck::livecheck_main {args} {
-    global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
     global homepage portpath workpath
     global master_sites name distfiles
@@ -98,7 +102,7 @@
     # "freshmeat|gnu|...").
     set available_types [regsub -all {\.tcl} [join $available_types |] {}]
 
-    if {${livecheck.check} eq "default"} {
+    if {${livecheck.type} eq "default"} {
         # Determine the default type from the mirror.
         if {$has_master_sites} {
             foreach {master_site} ${master_sites} {
@@ -106,7 +110,7 @@
                     if {${subdir} ne "" && ${livecheck.name} eq "default"} {
                         set livecheck.name ${subdir}
                     }
-                    set livecheck.check ${site}
+                    set livecheck.type ${site}
 
                     break
                 }
@@ -114,17 +118,17 @@
         }
         # If the default type cannot be determined from the mirror, use the
         # fallback.
-        if {${livecheck.check} eq "default"} {
-            set livecheck.check "fallback"
+        if {${livecheck.type} eq "default"} {
+            set livecheck.type "fallback"
         }
         # If livecheck.name is still "default", set it to $name.
         if {${livecheck.name} eq "default"} {
             set livecheck.name $name
         }
     }
-    if {[lsearch -exact [split $available_types "|"] ${livecheck.check}] != -1} {
-        # Load the defaults from _resources/port1.0/livecheck/${livecheck.check}.tcl.
-        set defaults_file "$types_dir/${livecheck.check}.tcl"
+    if {[lsearch -exact [split $available_types "|"] ${livecheck.type}] != -1} {
+        # Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
+        set defaults_file "$types_dir/${livecheck.type}.tcl"
         ui_debug "Loading the defaults from '$defaults_file'"
         if {[catch {source $defaults_file} result]} {
             return -code 1 "The defaults could not be loaded from '$defaults_file'."
@@ -134,7 +138,7 @@
     # de-escape livecheck.url
     set livecheck.url [join ${livecheck.url}]
 
-    switch ${livecheck.check} {
+    switch ${livecheck.type} {
         "regex" -
         "regexm" {
             # single and multiline regex
@@ -148,7 +152,7 @@
                 set updated -1
                 set the_re [join ${livecheck.regex}]
                 ui_debug "The regex is \"$the_re\""
-                if {${livecheck.check} == "regexm"} {
+                if {${livecheck.type} == "regexm"} {
                     set data [read $chan]
                     if {[regexp $the_re $data matched updated_version]} {
                         if {$updated_version != ${livecheck.version}} {
@@ -214,13 +218,13 @@
         "none" {
         }
         default {
-            ui_error "unknown livecheck.check ${livecheck.check}"
+            ui_error "unknown livecheck.type ${livecheck.type}"
         }
     }
 
     file delete -force $tempfile
 
-    if {${livecheck.check} != "none"} {
+    if {${livecheck.type} != "none"} {
         if {$updated > 0} {
             ui_msg "$name seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
         } elseif {$updated == 0} {

Modified: branches/images-and-archives/base/src/port1.0/portutil.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portutil.tcl	2009-05-30 05:49:46 UTC (rev 51653)
+++ branches/images-and-archives/base/src/port1.0/portutil.tcl	2009-05-30 06:23:02 UTC (rev 51654)
@@ -199,7 +199,8 @@
 # @param value ignored
 proc handle_deprecated_option {option action {value ""}} {
     global name $option deprecated_options
-    set newoption $deprecated_options($option)
+    set newoption [lindex $deprecated_options($option) 0]
+    set refcount  [lindex $deprecated_options($option) 1]
     global $newoption
 
     if {$newoption == ""} {
@@ -207,7 +208,9 @@
         return
     }
 
-    ui_warn "Port $name using deprecated option \"$option\", superseded by \"$newoption\"."
+    # Increment reference counter
+    lset deprecated_options($option) 1 [expr $refcount + 1]
+
     if {$action != "read"} {
         $newoption [set $option]
     } else {
@@ -216,15 +219,25 @@
 }
 
 ##
-# Causes a warning to be printed when an option is set or accessed
+# Get the name of the array containing the deprecated options
+# Thin layer avoiding to share global variables without notice
+proc get_deprecated_options {} {
+    return "deprecated_options"
+}
+
+##
+# Mark an option as deprecate
+# If it is set or accessed, it will be mapped it to the new option
 #
 # @param option name of the option
 # @param newoption name of a superseding option
 proc option_deprecate {option {newoption ""} } {
     global deprecated_options
     # If a new option is specified, default the option to $newoption
-    set deprecated_options($option) $newoption
-    # Register a proc for printing a warning
+    set deprecated_options($option) [list $newoption 0]
+    # Create a normal option for compatibility
+    options $option
+    # Register a proc for handling the deprecation
     option_proc $option handle_deprecated_option
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090529/9c2b2648/attachment.html>


More information about the macports-changes mailing list