Index: src/port1.0/portmain.tcl
===================================================================
--- src/port1.0/portmain.tcl	(revision 26682)
+++ src/port1.0/portmain.tcl	(arbetskopia)
@@ -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" }
+regexp {([0-9]*)[0-9\.]?} $tcl_platform(osVersion) match os_major
 
 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]}
Index: src/port1.0/portutil.tcl
===================================================================
--- src/port1.0/portutil.tcl	(revision 26682)
+++ src/port1.0/portutil.tcl	(arbetskopia)
@@ -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
Index: src/package1.0/portrpm.tcl
===================================================================
--- src/package1.0/portrpm.tcl	(revision 26682)
+++ src/package1.0/portrpm.tcl	(arbetskopia)
@@ -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'"
Index: src/package1.0/portsrpm.tcl
===================================================================
--- src/package1.0/portsrpm.tcl	(revision 26682)
+++ src/package1.0/portsrpm.tcl	(arbetskopia)
@@ -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} ""]} {

