[91432] trunk/base

jmr at macports.org jmr at macports.org
Sun Apr 1 13:48:56 PDT 2012


Revision: 91432
          https://trac.macports.org/changeset/91432
Author:   jmr at macports.org
Date:     2012-04-01 13:48:54 -0700 (Sun, 01 Apr 2012)
Log Message:
-----------
add an OS version check to base InstallationCheck JS, so we can correctly halt on systems too old to support the allowed-os-versions tag

Modified Paths:
--------------
    trunk/base/portmgr/dmg/Distribution
    trunk/base/src/package1.0/portpkg.tcl

Modified: trunk/base/portmgr/dmg/Distribution
===================================================================
--- trunk/base/portmgr/dmg/Distribution	2012-04-01 20:28:51 UTC (rev 91431)
+++ trunk/base/portmgr/dmg/Distribution	2012-04-01 20:48:54 UTC (rev 91432)
@@ -6,6 +6,12 @@
     <installation-check script="InstallationCheck();"/>
     <script><![CDATA[
 function InstallationCheck () {
+    if (system.compareVersions(system.version.ProductVersion, "__XVERS__") < 0
+        || system.compareVersions(system.version.ProductVersion, "__NEXT_XVERS__") >= 0) {
+        my.result.message = "This package is meant to be installed on Mac OS X __XVERS__.";
+        my.result.type = 'Fatal';
+        return false;
+    }
     if (system.files.fileExistsAtPath('__PREFIX__/etc/ports/dp_version')) {
         my.result.message = "Your existing MacPorts or DarwinPorts installation is too old to be upgraded by this installer. Please install MacPorts 1.7.1 first.";
         my.result.type = 'Fatal';

Modified: trunk/base/src/package1.0/portpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portpkg.tcl	2012-04-01 20:28:51 UTC (rev 91431)
+++ trunk/base/src/package1.0/portpkg.tcl	2012-04-01 20:48:54 UTC (rev 91432)
@@ -58,7 +58,7 @@
 proc portpkg::pkg_start {args} {
     global packagemaker_path portpkg::packagemaker \
            portpkg::language xcodeversion portpath porturl \
-           package.destpath package.resources package.scripts package.flat \
+           package.resources package.scripts package.flat \
            subport version description long_description homepage workpath os.major
 
     if {![info exists packagemaker_path]} {
@@ -109,10 +109,10 @@
 
 proc portpkg::package_pkg {portname portversion portrevision} {
     global UI_PREFIX portdbpath destpath workpath prefix description \
-    package.flat portpath os.version os.major \
+    package.flat package.destpath portpath os.version os.major \
     package.resources package.scripts portpkg::packagemaker portpkg::language
 
-    set pkgpath "${package.destpath}/${subport}-${version}.pkg"
+    set pkgpath "${package.destpath}/${portname}-${portversion}.pkg"
     if {[file readable $pkgpath] && ([file mtime ${pkgpath}] >= [file mtime ${portpath}/Portfile])} {
         ui_msg "$UI_PREFIX [format [msgcat::mc "Package for %s-%s is up-to-date"] ${portname} ${portversion}]"
         return 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120401/e048d651/attachment.html>


More information about the macports-changes mailing list