[26693] trunk/base/src

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 3 23:16:19 PDT 2007


Revision: 26693
          http://trac.macosforge.org/projects/macports/changeset/26693
Author:   eridius at macports.org
Date:     2007-07-03 23:16:19 -0700 (Tue, 03 Jul 2007)

Log Message:
-----------
Commit patch for #12224 - provide ${os.major} variable

Modified Paths:
--------------
    trunk/base/src/package1.0/portrpm.tcl
    trunk/base/src/package1.0/portsrpm.tcl
    trunk/base/src/port1.0/portmain.tcl
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/package1.0/portrpm.tcl
===================================================================
--- trunk/base/src/package1.0/portrpm.tcl	2007-07-04 04:38:42 UTC (rev 26692)
+++ trunk/base/src/package1.0/portrpm.tcl	2007-07-04 06:16:19 UTC (rev 26693)
@@ -52,7 +52,7 @@
 
 proc rpm_pkg {portname portversion portrevision} {
     global UI_PREFIX package.destpath portdbpath destpath workpath prefix portresourcepath categories maintainers description long_description homepage epoch portpath
-	global os.platform os.arch os.version
+	global os.platform os.arch os.version os.major
     
     set rpmdestpath ""
     if {![string equal ${package.destpath} ${workpath}] && ![string equal ${package.destpath} ""]} {
@@ -111,8 +111,7 @@
     }
 
 	# depend on system (virtual packages for apple stuff)
-	regexp {[0-9]+} ${os.version} major
-	lappend dependencies "org.macports.${os.platform}${major}"
+	lappend dependencies "org.macports.${os.platform}${os.major}"
     
     set listpath ${workpath}/${portname}.filelist
     system "rm -f '${workpath}/${portname}.filelist' && touch '${workpath}/${portname}.filelist'"

Modified: trunk/base/src/package1.0/portsrpm.tcl
===================================================================
--- trunk/base/src/package1.0/portsrpm.tcl	2007-07-04 04:38:42 UTC (rev 26692)
+++ trunk/base/src/package1.0/portsrpm.tcl	2007-07-04 06:16:19 UTC (rev 26693)
@@ -53,7 +53,7 @@
 
 proc srpm_pkg {portname portversion portrevision} {
     global UI_PREFIX package.destpath portdbpath destpath workpath distpath prefix portresourcepath categories maintainers description long_description homepage epoch portpath distfiles fetch_urls
-	global os.platform os.arch os.version
+	global os.platform os.arch os.version os.major
     
     set rpmdestpath ""
     if {![string equal ${package.destpath} ${workpath}] && ![string equal ${package.destpath} ""]} {

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2007-07-04 04:38:42 UTC (rev 26692)
+++ trunk/base/src/port1.0/portmain.tcl	2007-07-04 06:16:19 UTC (rev 26693)
@@ -42,7 +42,7 @@
 # define options
 options prefix name version revision epoch categories maintainers
 options long_description description homepage
-options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.arch os.endian platforms default_variants install.user install.group
+options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group
 
 # Export options via PortInfo
 options_export name version revision epoch categories maintainers platforms description long_description homepage
@@ -82,9 +82,11 @@
 # Platform Settings
 set os_arch $tcl_platform(machine)
 if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
+set os_major [lindex [split $tcl_platform(osVersion) .] 0]
 
 default os.platform {[string tolower $tcl_platform(os)]}
 default os.version {$tcl_platform(osVersion)}
+default os.major {$os_major}
 default os.arch {$os_arch}
 # Remove trailing "Endian"
 default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]}

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2007-07-04 04:38:42 UTC (rev 26692)
+++ trunk/base/src/port1.0/portutil.tcl	2007-07-04 06:16:19 UTC (rev 26693)
@@ -485,7 +485,7 @@
 # Basically, just wrap 'variant', so that Portfiles' platform declarations can
 # be more readable, and support arch and version specifics
 proc platform {args} {
-    global all_variants PortInfo os.platform os.arch os.version
+    global all_variants PortInfo os.platform os.arch os.version os.major
     
     set len [llength $args]
     set code [lindex $args end]
@@ -522,9 +522,8 @@
     set matches 1
     if {[info exists os.platform] && ${os.platform} == $os} { 
 	set sel_platform $os
-	if {[info exists os.version] && [info exists release]} {
-	    regexp {([0-9]*)[0-9\.]?} ${os.version} match major
-	    if {$major == $release } { 
+	if {[info exists os.major] && [info exists release]} {
+	    if {${os.major} == $release } { 
 	    	set sel_platform ${sel_platform}_${release} 
 	    } else {
 		    set matches 0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070703/483f7f37/attachment.html


More information about the macports-changes mailing list