[51780] trunk/base

jmr at macports.org jmr at macports.org
Tue Jun 2 23:29:13 PDT 2009


Revision: 51780
          http://trac.macports.org/changeset/51780
Author:   jmr at macports.org
Date:     2009-06-02 23:29:12 -0700 (Tue, 02 Jun 2009)
Log Message:
-----------
Add depends_fetch and depends_extract options (#15161)

Modified Paths:
--------------
    trunk/base/portmgr/jobs/PortIndex2MySQL.tcl
    trunk/base/portmgr/packaging/dpkgall.tcl
    trunk/base/portmgr/packaging/packageall.tcl
    trunk/base/portmgr/packaging/rpmall.tcl
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/package1.0/portarchive.tcl
    trunk/base/src/package1.0/portsrpm.tcl
    trunk/base/src/port/port-help.tcl
    trunk/base/src/port/port.tcl
    trunk/base/src/port/portindex.tcl
    trunk/base/src/port1.0/portdepends.tcl
    trunk/base/src/port1.0/portfetch.tcl
    trunk/base/src/port1.0/portlint.tcl
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/portmgr/jobs/PortIndex2MySQL.tcl
===================================================================
--- trunk/base/portmgr/jobs/PortIndex2MySQL.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/portmgr/jobs/PortIndex2MySQL.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -289,6 +289,16 @@
     } else {
         set variants ""
     }
+    if {[info exists portinfo(depends_fetch)]} {
+        set depends_fetch $portinfo(depends_fetch)
+    } else {
+        set depends_fetch ""
+    }
+    if {[info exists portinfo(depends_extract)]} {
+        set depends_extract $portinfo(depends_extract)
+    } else {
+        set depends_extract ""
+    }
     if {[info exists portinfo(depends_build)]} {
         set depends_build $portinfo(depends_build)
     } else {
@@ -326,6 +336,16 @@
         set primary 0
     }
 
+    foreach fetch_dep $depends_fetch {
+        set fetch_dep [sql_escape $fetch_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$fetch_dep');"
+    }
+    
+    foreach extract_dep $depends_extract {
+        set extract_dep [sql_escape $extract_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$extract_dep');"
+    }
+
     foreach build_dep $depends_build {
         set build_dep [sql_escape $build_dep]
         puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$build_dep');"

Modified: trunk/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- trunk/base/portmgr/packaging/dpkgall.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/portmgr/packaging/dpkgall.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -875,6 +875,12 @@
 		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies_recurse $dep $includeBuildDeps]

Modified: trunk/base/portmgr/packaging/packageall.tcl
===================================================================
--- trunk/base/portmgr/packaging/packageall.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/portmgr/packaging/packageall.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -149,6 +149,13 @@
 		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
+		
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies $dep $includeBuildDeps]

Modified: trunk/base/portmgr/packaging/rpmall.tcl
===================================================================
--- trunk/base/portmgr/packaging/rpmall.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/portmgr/packaging/rpmall.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -154,6 +154,12 @@
 		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies $dep $includeBuildDeps]

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/macports1.0/macports.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -1390,7 +1390,9 @@
     # Before we build the port, we must build its dependencies.
     # XXX: need a more general way of comparing against targets
     set dlist {}
-    if {$target == "configure" || $target == "build"
+    if {   $target == "fetch" || $target == "checksum"
+        || $target == "extract" || $target == "patch"
+        || $target == "configure" || $target == "build"
         || $target == "test"
         || $target == "destroot" || $target == "install"
         || $target == "archive"
@@ -1997,8 +1999,12 @@
 
     # Determine deptypes to look for based on target
     switch $target {
+        fetch       -
+        checksum    { set deptypes "depends_fetch" }
+        extract     -
+        patch       { set deptypes "depends_fetch depends_extract" }
         configure   -
-        build       { set deptypes "depends_lib depends_build" }
+        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
 
         test        -
         destroot    -
@@ -2012,7 +2018,7 @@
         rpm         -
         srpm        -
         dpkg        -
-        ""          { set deptypes "depends_lib depends_build depends_run" }
+        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
     }
 
     # Gather the dependencies for deptypes
@@ -2618,7 +2624,7 @@
     unset -nocomplain options(ports_do_dependents)
 
     # each dep type is upgraded
-    foreach dtype {depends_build depends_lib depends_run} {
+    foreach dtype {depends_fetch depends_extract depends_build depends_lib depends_run} {
         if {[info exists portinfo($dtype)]} {
             foreach i $portinfo($dtype) {
                 set d [lindex [split $i :] end]

Modified: trunk/base/src/package1.0/portarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portarchive.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/package1.0/portarchive.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -433,6 +433,8 @@
             # Emit build, library, and runtime dependencies
             puts $sd "<requires>"
             foreach {key type} {
+                depends_fetch "fetch"
+                depends_extract "extract"
                 depends_build "build"
                 depends_lib "library"
                 depends_run "runtime"

Modified: trunk/base/src/package1.0/portsrpm.tcl
===================================================================
--- trunk/base/src/package1.0/portsrpm.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/package1.0/portsrpm.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -135,10 +135,13 @@
     foreach {name array} $res {
         array set portinfo $array
 	
-        if {[info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
-            # get the union of depends_build and depends_lib
+        if {[info exists portinfo(depends_fetch)] || [info exists portinfo(depends_extract)]
+            || [info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
+            # get the union of depends_fetch, depends_extract, depends_build and depends_lib
             # xxx: only examines the portfile component of the depspec
             set depends {}
+            if {[info exists portinfo(depends_fetch)]} { eval "lappend depends $portinfo(depends_fetch)" }
+            if {[info exists portinfo(depends_extract)]} { eval "lappend depends $portinfo(depends_extract)" }
             if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
             if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
 	    

Modified: trunk/base/src/port/port-help.tcl
===================================================================
--- trunk/base/src/port/port-help.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port/port-help.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -139,7 +139,7 @@
 to be included in the resulting report. Multiple fields may be specified, in
 which case all will be included.  If no fields are specified, a useful default
 set will be used.  The other options which do not correspond to fields are:
-   --depends   An abbreviation for all three depends_* fields
+   --depends   An abbreviation for all depends_* fields
    --index     Do not read the Portfile, instead rely solely on the index
                information. Note this option will prevent the information
                reported from reflecting the effects of any variants specified.

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port/port.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -94,9 +94,9 @@
 
 Additional pseudo-portnames start with...
 variants:, variant:, description:, depends:, depends_lib:, depends_run:,
-depends_build:, portdir:, homepage:, epoch:, platforms:, platform:, name:,
-long_description:, maintainers:, maintainer:, categories:, category:, version:,
-and revision:.
+depends_build:, depends_fetch:, depends_extract:, portdir:, homepage:, epoch:,
+platforms:, platform:, name:, long_description:, maintainers:, maintainer:,
+categories:, category:, version:, and revision:.
 These each select a set of ports based on a regex search of metadata
 about the ports. In all such cases, a standard regex pattern following
 the colon will be used to select the set of ports to which the
@@ -935,6 +935,8 @@
         ^depends_lib:       -
         ^depends_build:     -
         ^depends_run:       -
+        ^depends_extract:   -
+        ^depends_fetch:     -
         ^revision:          { # Handle special port selectors
             advance
 
@@ -948,7 +950,7 @@
             set el 1
         }
 
-        ^depends:           { # A port selector shorthand for depends_lib, depends_build or depends_run
+        ^depends:           { # A port selector shorthand for depends_{lib,build,run,fetch,extract}
             advance
 
             # Break up the token, because older Tcl switch doesn't support -matchvar
@@ -957,6 +959,8 @@
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_lib"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_build"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_run"]
+            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_extract"]
+            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_fetch"]
 
             set el 1
         }
@@ -1447,6 +1451,8 @@
         # allow us to, say, split off the prefix on libs)
         array set list_map "
             categories      1
+            depends_fetch   1
+            depends_extract 1
             depends_build   1
             depends_lib     1
             depends_run     1
@@ -1460,6 +1466,8 @@
         array set pretty_label {
             heading     ""
             variants    Variants
+            depends_fetch "Fetch Dependencies"
+            depends_extract "Extract Dependencies"
             depends_build "Build Dependencies"
             depends_run "Runtime Dependencies"
             depends_lib "Library Dependencies"
@@ -1477,6 +1485,8 @@
         array set pretty_wrap {
             heading 0
             variants 22
+            depends_fetch 22
+            depends_extract 22
             depends_build 22
             depends_run 22
             depends_lib 22
@@ -1492,6 +1502,8 @@
         # Interpret a convenient field abbreviation
         if {[info exists options(ports_info_depends)] && $options(ports_info_depends) == "yes"} {
             array unset options ports_info_depends
+            set options(ports_info_depends_fetch) yes
+            set options(ports_info_depends_extract) yes
             set options(ports_info_depends_build) yes
             set options(ports_info_depends_lib) yes
             set options(ports_info_depends_run) yes
@@ -1538,7 +1550,8 @@
             set opts_todo {ports_info_heading ports_info_variants 
                 ports_info_skip_line
                 ports_info_long_description ports_info_homepage 
-                ports_info_skip_line ports_info_depends_build
+                ports_info_skip_line ports_info_depends_fetch
+                ports_info_depends_extract ports_info_depends_build
                 ports_info_depends_lib ports_info_depends_run
                 ports_info_conflicts
                 ports_info_platforms ports_info_license
@@ -2457,6 +2470,8 @@
 
     if {[info exists options(ports_search_depends)] && $options(ports_search_depends) == "yes"} {
         array unset options ports_search_depends
+        set options(ports_search_depends_fetch) yes
+        set options(ports_search_depends_extract) yes
         set options(ports_search_depends_build) yes
         set options(ports_search_depends_lib) yes
         set options(ports_search_depends_run) yes
@@ -3082,12 +3097,14 @@
 array set cmd_opts_array {
     edit        {{editor 1}}
     ed          {{editor 1}}
-    info        {category categories depends_build depends_lib depends_run
+    info        {category categories depends_fetch depends_extract
+                 depends_build depends_lib depends_run
                  depends description epoch fullname heading homepage index license
                  line long_description
                  maintainer maintainers name platform platforms portdir pretty
                  revision variant variants version}
-    search      {case-sensitive category categories depends_build depends_lib depends_run
+    search      {case-sensitive category categories depends_fetch
+                 depends_extract depends_build depends_lib depends_run
                  depends description epoch exact glob homepage line
                  long_description maintainer maintainers name platform
                  platforms portdir regex revision variant variants version}

Modified: trunk/base/src/port/portindex.tcl
===================================================================
--- trunk/base/src/port/portindex.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port/portindex.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -68,7 +68,7 @@
             }
         }
 
-        set keepkeys {categories depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
+        set keepkeys {categories depends_fetch depends_extract depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
         foreach availkey [array names portinfo] {
             if {[lsearch -exact ${keepkeys} $availkey] == -1} {
                 unset portinfo($availkey)

Modified: trunk/base/src/port1.0/portdepends.tcl
===================================================================
--- trunk/base/src/port1.0/portdepends.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port1.0/portdepends.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -37,10 +37,12 @@
 }
 
 # define options
-options depends_build depends_run depends_lib depends
+options depends_fetch depends_extract depends_build depends_run depends_lib depends
 # Export options via PortInfo
-options_export depends_build depends_lib depends_run
+options_export depends_fetch depends_extract depends_build depends_lib depends_run
 
+option_proc depends_fetch portdepends::validate_depends_options
+option_proc depends_extract portdepends::validate_depends_options
 option_proc depends_build portdepends::validate_depends_options
 option_proc depends_run portdepends::validate_depends_options
 option_proc depends_lib portdepends::validate_depends_options

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port1.0/portfetch.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -128,7 +128,6 @@
 
 option_proc fetch.type portfetch::set_fetch_type
 
-# We should probably add something like a depends_fetch; see #15161
 proc portfetch::set_extract_type {option action args} {
     global extract.suffix
     if {[string equal ${action} "set"] && [tbool args]} {
@@ -138,15 +137,15 @@
             }
             use_lzma {
                 set extract.suffix .tar.lzma
-                depends_build-append bin:lzma:lzmautils
+                depends_extract-append bin:lzma:lzmautils
             }
             use_zip {
                 set extract.suffix .zip
-                depends_build-append bin:unzip:unzip
+                depends_extract-append bin:unzip:unzip
             }
             use_7z {
                 set extract.suffix .7z
-                depends_build-append bin:7za:p7zip
+                depends_extract-append bin:7za:p7zip
             }
             use_dmg {
                 set extract.suffix .dmg
@@ -159,16 +158,16 @@
     if {[string equal ${action} "set"]} {
         switch $args {
             cvs {
-                depends_build-append bin:cvs:cvs
+                depends_fetch-append bin:cvs:cvs
             }
             svn {
-                depends_build-append bin:svn:subversion
+                depends_fetch-append bin:svn:subversion
             }
             git {
-                depends_build-append bin:git:git-core
+                depends_fetch-append bin:git:git-core
             }
             hg {
-                depends_build-append bin:hg:mercurial
+                depends_fetch-append bin:hg:mercurial
             }
         }
     }

Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port1.0/portlint.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -266,7 +266,7 @@
     set portarch ${os.arch}
     global description long_description platforms categories all_variants
     global maintainers homepage master_sites checksums patchfiles
-    global depends_lib depends_build depends_run distfiles fetch.type
+    global depends_fetch depends_extract depends_lib depends_build depends_run distfiles fetch.type
     
     global lint_portsystem lint_platforms
     global lint_required lint_optional
@@ -412,6 +412,8 @@
     }
 
     set all_depends {}
+    if {[info exists depends_fetch]} { eval "lappend all_depends $depends_fetch" }
+    if {[info exists depends_extract]} { eval "lappend all_depends $depends_extract" }
     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" }

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2009-06-03 06:02:53 UTC (rev 51779)
+++ trunk/base/src/port1.0/portutil.tcl	2009-06-03 06:29:12 UTC (rev 51780)
@@ -1272,62 +1272,56 @@
                     }
 
                     # collect deps
+                    set depends {}
+                    set deptypes {}
 
-                    # Don't check dependencies for extract (they're not honored
-                    # anyway). This avoids warnings about bzip2.
-                    if {$target != "extract"} {
-                        set depends {}
-                        set deptypes {}
+                    # Determine deptypes to look for based on target
+                    switch $target {
+                        fetch       -
+                        checksum    { set deptypes "depends_fetch" }
+                        extract     -
+                        patch       { set deptypes "depends_fetch depends_extract" }
+                        configure   -
+                        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
 
-                        # Determine deptypes to look for based on target
-                        switch $target {
-                            configure   -
-                            build       { set deptypes "depends_lib depends_build" }
+                        test        -
+                        destroot    -
+                        install     -
+                        archive     -
+                        dmg         -
+                        pkg         -
+                        portpkg     -
+                        mpkg        -
+                        rpm         -
+                        srpm        -
+                        dpkg        -
+                        mdmg        -
+                        activate    -
+                        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
+                    }
 
-                            test        -
-                            destroot    -
-                            install     -
-                            archive     -
-                            dmg         -
-                            pkg         -
-                            portpkg     -
-                            mpkg        -
-                            rpm         -
-                            srpm        -
-                            dpkg        -
-                            mdmg        -
-                            activate    -
-                            ""          { set deptypes "depends_lib depends_build depends_run" }
+                    # Gather the dependencies for deptypes
+                    foreach deptype $deptypes {
+                        # Add to the list of dependencies if the option exists and isn't empty.
+                        if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
+                            set depends [concat $depends $PortInfo($deptype)]
                         }
+                    }
 
-                        # Gather the dependencies for deptypes
-                        foreach deptype $deptypes {
-                            # Add to the list of dependencies if the option exists and isn't empty.
-                            if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
-                                set depends [concat $depends $PortInfo($deptype)]
-                            }
-                        }
+                    # Dependencies are in the form verb:[param:]port
+                    set depsPorts {}
+                    foreach depspec $depends {
+                        # grab the portname portion of the depspec
+                        set dep_portname [lindex [split $depspec :] end]
+                        lappend depsPorts $dep_portname
+                    }
 
-                        # Dependencies are in the form verb:[param:]port
-                        set depsPorts {}
-                        foreach depspec $depends {
-                            # grab the portname portion of the depspec
-                            set dep_portname [lindex [split $depspec :] end]
-                            lappend depsPorts $dep_portname
-                        }
-
-                        # always allow gzip in destroot as it is used to compress man pages
-                        if {$target == "destroot"} {
-                            lappend depsPorts "gzip"
-                        }
-
-                        set portlist $depsPorts
-                        foreach depName $depsPorts {
-                            set portlist [recursive_collect_deps $depName $deptypes $portlist]
-                        }
-
-                        if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
+                    set portlist $depsPorts
+                    foreach depName $depsPorts {
+                        set portlist [recursive_collect_deps $depName $deptypes $portlist]
                     }
+
+                    if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
                 }
 
                 if {$result == 0} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090602/dc446753/attachment-0001.html>


More information about the macports-changes mailing list