[86079] branches/gsoc11-rev-upgrade/base

cal at macports.org cal at macports.org
Tue Oct 18 17:59:01 PDT 2011


Revision: 86079
          http://trac.macports.org/changeset/86079
Author:   cal at macports.org
Date:     2011-10-18 17:59:01 -0700 (Tue, 18 Oct 2011)
Log Message:
-----------
rev-upgrade: Merge from trunk

Modified Paths:
--------------
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portlint.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl

Property Changed:
----------------
    branches/gsoc11-rev-upgrade/base/


Property changes on: branches/gsoc11-rev-upgrade/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/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:78828-84751
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/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:78828-86078
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl	2011-10-19 00:54:37 UTC (rev 86078)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl	2011-10-19 00:59:01 UTC (rev 86079)
@@ -34,12 +34,13 @@
 # variants like CeCILL and the AGPL) and is not in the list of licenses known
 # to do so below.
 # 'Noncommercial' means a license that prohibits commercial use.
-set good_licenses {afl agpl apache apsl artistic autoconf boost bsd cecill \
-                   copyleft cpl curl epl fontconfig freebsd freetype gd gfdl \
-                   gpl gplconflict ibmpl ijg isc jasper lgpl libpng libtool \
-                   lppl mit mpl ncsa noncommercial openssl permissive php \
+set good_licenses {afl agpl apache apsl artistic autoconf bitstreamvera \
+                   boost bsd bsd-old cecill cecill-b cecill-c copyleft cpl \
+                   curl epl fpll fontconfig freebsd freetype gd gfdl gpl \
+                   gplconflict ibmpl ijg isc  jasper lgpl libtool lppl mit \
+                   mpl ncsa noncommercial openldap openssl permissive php \
                    psf public-domain qpl restrictive/distributable ruby \
-                   sleepycat ssleay tcl/tk w3c wtfpl x11 zlib zpl}
+                   sleepycat ssleay tcl/tk w3c wtfpl x11 zlib wxwidgets zpl}
 foreach lic $good_licenses {
     set license_good($lic) 1
 }
@@ -61,12 +62,13 @@
     apache-1 {agpl gpl}
     apache-1.1 {agpl gpl}
     apsl {cecill gpl}
+    bsd-old {cecill gpl}
     cpl {cecill gpl}
-    cecill {afl agpl apache apsl cpl epl gd gplconflict ibmpl lppl mpl noncommercial openssl php qpl restrictive/distributable ruby ssleay zpl-1}
+    cecill {afl agpl apache apsl bsd-old cpl epl gd gplconflict ibmpl lppl mpl noncommercial openssl php qpl restrictive/distributable ruby ssleay zpl-1}
     epl {cecill gpl}
     freetype {gpl-2}
     gd {cecill gpl}
-    gpl {afl agpl apache-1 apache-1.1 apsl cpl epl gd gplconflict ibmpl lppl mpl noncommercial openssl php qpl restrictive/distributable ruby ssleay zpl-1}
+    gpl {afl agpl apache-1 apache-1.1 apsl bsd-old cpl epl gd gplconflict ibmpl lppl mpl noncommercial openssl php qpl restrictive/distributable ruby ssleay zpl-1}
     gpl-1 {apache gpl-3 gpl-3+ lgpl-3 lgpl-3+}
     gpl-2 {apache freetype gpl-3 gpl-3+ lgpl-3 lgpl-3+}
     gpl-3 {gpl-1 gpl-2}

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl	2011-10-19 00:54:37 UTC (rev 86078)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl	2011-10-19 00:59:01 UTC (rev 86079)
@@ -1593,18 +1593,21 @@
     }
 }
 
-### _mportconflictsinstalled is private; may change without notice
+### _mporterrorifconflictsinstalled is private; may change without notice
 
-# Determine if the port, per the conflicts option, has any conflicts with
-# what is installed.
+# Determine if the port, per the conflicts option, has any conflicts
+# with what is installed. If it does, raises an error unless force
+# option is set.
 #
 # mport   the port to check for conflicts
-# Returns a list of which installed ports conflict, or an empty list if none
-proc _mportconflictsinstalled {mport conflictinfo} {
+proc _mporterrorifconflictsinstalled {mport} {
     set conflictlist {}
-    if {[llength $conflictinfo] > 0} {
+    array set portinfo [mportinfo $mport]
+
+    if {[info exists portinfo(conflicts)] &&
+        [llength $portinfo(conflicts)] > 0} {
         ui_debug "Checking for conflicts against [_mportkey $mport subport]"
-        foreach conflictport ${conflictinfo} {
+        foreach conflictport $portinfo(conflicts) {
             if {[_mportispresent $mport port:${conflictport}]} {
                 lappend conflictlist $conflictport
             }
@@ -1613,10 +1616,18 @@
         ui_debug "[_mportkey $mport subport] has no conflicts"
     }
 
-    return $conflictlist
+    if {[llength ${conflictlist}] != 0} {
+        if {[macports::global_option_isset ports_force]} {
+            ui_warn "Force option set; installing $portinfo(name) despite conflicts with: ${conflictlist}"
+        } else {
+            if {![macports::ui_isset ports_debug]} {
+                ui_msg ""
+            }
+            return -code error "Can't install $portinfo(name) because conflicting ports are installed: ${conflictlist}"
+        }
+    }
 }
 
-
 ### _mportexec is private; may change without notice
 
 proc _mportexec {target mport} {
@@ -1742,6 +1753,11 @@
         foreach ditem $dlist {
             mportclose $ditem
         }
+    } else {
+        # No dependencies, but we still need to check for conflicts.
+        if {$target == "" || $target == "install" || $target == "activate"} {
+            _mporterrorifconflictsinstalled $mport
+        }
     }
 
     set clean 0
@@ -2617,18 +2633,8 @@
         flush stdout
     }
     
-    if {[info exists portinfo(conflicts)] && ($target == "" || $target == "install" || $target == "activate")} {
-        set conflictports [_mportconflictsinstalled $mport $portinfo(conflicts)]
-        if {[llength ${conflictports}] != 0} {
-            if {[macports::global_option_isset ports_force]} {
-                ui_warn "Force option set; installing $portinfo(name) despite conflicts with: ${conflictports}"
-            } else {
-                if {![macports::ui_isset ports_debug]} {
-                    ui_msg ""
-                }
-                return -code error "Can't install $portinfo(name) because conflicting ports are installed: ${conflictports}"
-            }
-        }
+    if {$target == "" || $target == "install" || $target == "activate"} {
+        _mporterrorifconflictsinstalled $mport
     }
 
     set workername [ditem_key $mport workername]

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl	2011-10-19 00:54:37 UTC (rev 86078)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl	2011-10-19 00:59:01 UTC (rev 86079)
@@ -221,6 +221,9 @@
     # Set the list of checksums as the option checksums.
     set checksums_str [option checksums]
 
+    # store the calculated checksums to avoid repeated calculations
+    set sums ""
+
     # if everything is fine with the syntax, keep on and check the checksum of
     # the distfiles.
     if {[parse_checksums $checksums_str] == "yes"} {
@@ -250,6 +253,7 @@
                 # iterate on this list to check the actual values.
                 foreach {type sum} $portfile_checksums {
                     set calculated_sum [calc_$type $fullpath]
+                    lappend sums [format "%-8s%s" $type $calculated_sum]
                     if {[string equal $sum $calculated_sum]} {
                         ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
                     } else {
@@ -278,7 +282,6 @@
     if {[tbool fail]} {
 
         # Show the desired checksum line for easy cut-paste
-        set sums ""
         foreach distfile $all_dist_files {
             if {[llength $all_dist_files] > 1} {
                 lappend sums $distfile
@@ -293,11 +296,6 @@
                 foreach type $default_checksum_types {
                     lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
                 }
-            } else {
-                # output just the types that were already used
-                foreach {type sum} $checksums_array($distfile) {
-                    lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
-                }
             }
         }
         ui_info "The correct checksum line may be:"

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portlint.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portlint.tcl	2011-10-19 00:54:37 UTC (rev 86078)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portlint.tcl	2011-10-19 00:59:01 UTC (rev 86079)
@@ -501,9 +501,57 @@
         incr warnings
     }
 
-    if {[string match "unknown" $license]} {
-        ui_error "$license license"
-        incr errors
+    if {$license == "unknown"} {
+        ui_warn "no license set"
+        incr warnings
+    } else {
+
+        # If maintainer set license, it must follow correct format
+
+        set prev ''
+        foreach test [split [string map { \{ '' \} ''} $license] '\ '] {
+            ui_debug "Checking format of license '${test}'"
+
+            # space instead of hyphen
+            if {[string is double -strict $test]} {
+                ui_error "Invalid license '${prev} ${test}': missing hyphen between ${prev} ${test}"
+
+            # missing hyphen
+            } elseif {![string equal -nocase "X11" $test]} {
+                foreach subtest [split $test '-'] {
+                    ui_debug "testing ${subtest}"
+
+                    # license names start with letters: versions and empty strings need not apply
+                    if {[string is alpha -strict [string index $subtest 0]]} {
+
+                        # if the last character of license name is a number or plus sign
+                        # then a hyphen is missing
+                        set license_end [string index $subtest end]
+                        if {[string equal "+" $license_end] || [string is integer -strict $license_end]} {
+                            ui_error "invalid license '${test}': missing hyphen before version"
+                        }
+                    }
+                }
+            }
+
+            # BSD-2 => BSD
+            if {[string equal -nocase "BSD-2" $test]} {
+                ui_error "Invalid license '${test}': use BSD instead"
+            }
+    
+            # BSD-3 => BSD
+            if {[string equal -nocase "BSD-3" $test]} {
+                ui_error "Invalid license '${test}': use BSD instead"
+            }
+    
+            # BSD-4 => BSD-old
+            if {[string equal -nocase "BSD-4" $test]} {
+                ui_error "Invalid license '${test}': use BSD-old instead"
+            }
+    
+            set prev $test
+        }
+
     }
 
     # these checks are only valid for ports stored in the regular tree directories

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl	2011-10-19 00:54:37 UTC (rev 86078)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl	2011-10-19 00:59:01 UTC (rev 86079)
@@ -2753,6 +2753,9 @@
         }
         if {$xcodeversion == "none"} {
             ui_warn "Xcode does not appear to be installed; most ports will likely fail to build."
+            if {[file exists "/Applications/Install XCode.app"]} {
+                ui_warn "You downloaded Xcode from the Mac App Store but didn't install it. Run \"Install Xcode\" in the /Applications folder."
+            }
         } elseif {[vercmp $xcodeversion $min] < 0} {
             ui_error "The installed version of Xcode (${xcodeversion}) is too old to use on the installed OS version. Version $rec or later is recommended on Mac OS X ${macosx_version}."
             return 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111018/27779d56/attachment-0001.html>


More information about the macports-changes mailing list