New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #12302 (closed enhancement: fixed)

Opened 6 years ago

Last modified 5 years ago

RFE: "platform" info target

Reported by: afb@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: Cc: jmpp@…
Port:

Description

Similar to "port version", a "port platform" target to tell the current platform.

$ port platform
Platform: darwin 8 i386

Good for knowing what to put into Portfile platform variants, or for bug reports ?

Change History

comment:1 Changed 6 years ago by afb@…

Not sure about the actual implementation, my Tcl skills failed me so I just hacked it:

proc action_platform { action portlist opts } {
#	global os.platform os.major os.arch 
#	puts "Platform: ${os.platform} ${os.major} ${os.arch}"
#	return 0

	global tcl_platform
	set os $tcl_platform(os)
	set platform [string tolower $os]
	set version $tcl_platform(osVersion)
	regexp {([0-9]*)[0-9\.]?} $version match major
	set arch $tcl_platform(machine)
	if {$arch == "Power Macintosh"} {
		set arch "powerpc"
	}
	if {$arch == "i686" || $arch == "x86"} {
		set arch "i386"
	}
	puts "Platform: $platform $major $arch"
	return 0
}

comment:2 Changed 6 years ago by jmpp@…

  • Milestone changed from Needs developer review to MacPorts base bugs

Milestone Needs developer review deleted

comment:3 Changed 6 years ago by nox@…

  • Priority changed from Expected to Normal
  • Milestone changed from MacPorts base bugs to MacPorts base enhancements
  • Summary changed from "platform" info target to RFE: "platform" info target

comment:4 Changed 6 years ago by afb@…

  • Version 1.5.0 deleted

comment:5 Changed 6 years ago by afb@…

  • Cc jmpp@… added

Did you have any feedback on this ? (especially changing i686 to i386)

comment:6 Changed 6 years ago by afb@…

Added i386 normalization in r28635...

comment:7 Changed 6 years ago by afb@…

  • Version set to 1.6.0

Cleaned up version:

proc action_platform { action portlist opts } {
#	global os.platform os.major os.arch 
	global tcl_platform
	set os_platform [string tolower $tcl_platform(os)]
	set os_version $tcl_platform(osVersion)
	set os_arch $tcl_platform(machine)
	if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
	if {$os_arch == "i586" || $os_arch == "i686"} { set os_arch "i386" }
	set os_major [lindex [split $tcl_platform(osVersion) .] 0]
#	puts "Platform: ${os.platform} ${os.major} ${os.arch}"
	puts "Platform: ${os_platform} ${os_major} ${os_arch}"
	return 0
}

comment:8 Changed 5 years ago by afb@…

  • Status changed from new to closed
  • Resolution set to fixed

Added, r32724.

comment:9 Changed 5 years ago by blb@…

  • Milestone changed from MacPorts base enhancements to MacPorts 1.7.0
Note: See TracTickets for help on using tickets.