Ticket #12224: macports-major.patch

File macports-major.patch, 4.0 KB (added by afb@…, 17 years ago)

macports-major.patch

  • src/port1.0/portmain.tcl

     
    4242# define options
    4343options prefix name version revision epoch categories maintainers
    4444options long_description description homepage
    45 options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.arch os.endian platforms default_variants install.user install.group
     45options 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
    4646
    4747# Export options via PortInfo
    4848options_export name version revision epoch categories maintainers platforms description long_description homepage
     
    8282# Platform Settings
    8383set os_arch $tcl_platform(machine)
    8484if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
     85regexp {([0-9]*)[0-9\.]?} $tcl_platform(osVersion) match os_major
    8586
    8687default os.platform {[string tolower $tcl_platform(os)]}
    8788default os.version {$tcl_platform(osVersion)}
     89default os.major {$os_major}
    8890default os.arch {$os_arch}
    8991# Remove trailing "Endian"
    9092default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]}
  • src/port1.0/portutil.tcl

     
    485485# Basically, just wrap 'variant', so that Portfiles' platform declarations can
    486486# be more readable, and support arch and version specifics
    487487proc platform {args} {
    488     global all_variants PortInfo os.platform os.arch os.version
     488    global all_variants PortInfo os.platform os.arch os.version os.major
    489489   
    490490    set len [llength $args]
    491491    set code [lindex $args end]
     
    522522    set matches 1
    523523    if {[info exists os.platform] && ${os.platform} == $os} {
    524524        set sel_platform $os
    525         if {[info exists os.version] && [info exists release]} {
    526             regexp {([0-9]*)[0-9\.]?} ${os.version} match major
    527             if {$major == $release } {
     525        if {[info exists os.major] && [info exists release]} {
     526            if {${os.major} == $release } {
    528527                set sel_platform ${sel_platform}_${release}
    529528            } else {
    530529                    set matches 0
  • src/package1.0/portrpm.tcl

     
    5252
    5353proc rpm_pkg {portname portversion portrevision} {
    5454    global UI_PREFIX package.destpath portdbpath destpath workpath prefix portresourcepath categories maintainers description long_description homepage epoch portpath
    55         global os.platform os.arch os.version
     55        global os.platform os.arch os.version os.major
    5656   
    5757    set rpmdestpath ""
    5858    if {![string equal ${package.destpath} ${workpath}] && ![string equal ${package.destpath} ""]} {
     
    111111    }
    112112
    113113        # depend on system (virtual packages for apple stuff)
    114         regexp {[0-9]+} ${os.version} major
    115         lappend dependencies "org.macports.${os.platform}${major}"
     114        lappend dependencies "org.macports.${os.platform}${os.major}"
    116115   
    117116    set listpath ${workpath}/${portname}.filelist
    118117    system "rm -f '${workpath}/${portname}.filelist' && touch '${workpath}/${portname}.filelist'"
  • src/package1.0/portsrpm.tcl

     
    5353
    5454proc srpm_pkg {portname portversion portrevision} {
    5555    global UI_PREFIX package.destpath portdbpath destpath workpath distpath prefix portresourcepath categories maintainers description long_description homepage epoch portpath distfiles fetch_urls
    56         global os.platform os.arch os.version
     56        global os.platform os.arch os.version os.major
    5757   
    5858    set rpmdestpath ""
    5959    if {![string equal ${package.destpath} ${workpath}] && ![string equal ${package.destpath} ""]} {