[MacPorts] #64863: base: (linux) invalid `os_arch` on debian-based distros
MacPorts
noreply at macports.org
Sun Mar 20 20:34:58 UTC 2022
#64863: base: (linux) invalid `os_arch` on debian-based distros
---------------------+--------------------
Reporter: harens | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: base | Version:
Resolution: | Keywords:
Port: |
---------------------+--------------------
Comment (by ryandesign):
MacPorts doesn't use `uname` directly. As you see it uses
`$tcl_platform(machine)` which
[https://www.tcl.tk/man/tcl/TclCmd/tclvars.html#M28 according to the
documentation] is the output of `uname -m`. But we want the equivalent of
`uname -p` for which I guess Tcl doesn't offer us a variable so we turn
certain known values from `uname -m` into their corresponding `uname
-p`-like values. As you see we have not programmed MacPorts base to know
how to transform "armv7l" into "arm" here but it could easily be extended
to do so. Might be a good time to change all those `if` statements into a
`switch`:
{{{
switch $os_arch {
arm64 -
armv7l {
set os_arch "arm"
}
i586 -
i686 -
x86_64 {
set os_arch "i386"
}
"Power Macintosh" {
set os_arch "powerpc"
}
}}
}}}
--
Ticket URL: <https://trac.macports.org/ticket/64863#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list