Revision
91432
Author
jmr@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

Diff

Modified: trunk/base/portmgr/dmg/Distribution (91431 => 91432)


--- 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 (91431 => 91432)


--- 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