mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-21 15:45:02 +00:00
Use MACHINE_ARCH instead of MACHINE as the directory to fetch packages
from. Packages are architecture dependent, not machine dependent.
This commit is contained in:
parent
08390ba4c9
commit
89513bce11
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212029
@ -22,7 +22,7 @@
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <err.h>
|
||||
#include <getopt.h>
|
||||
|
||||
@ -301,7 +301,9 @@ getpackagesite(void)
|
||||
{
|
||||
int reldate, i;
|
||||
static char sitepath[MAXPATHLEN];
|
||||
struct utsname u;
|
||||
int archmib[] = { CTL_HW, HW_MACHINE_ARCH };
|
||||
char arch[64];
|
||||
size_t archlen = sizeof(arch);
|
||||
|
||||
if (getenv("PACKAGESITE")) {
|
||||
if (strlcpy(sitepath, getenv("PACKAGESITE"), sizeof(sitepath))
|
||||
@ -324,8 +326,10 @@ getpackagesite(void)
|
||||
>= sizeof(sitepath))
|
||||
return NULL;
|
||||
|
||||
uname(&u);
|
||||
if (strlcat(sitepath, u.machine, sizeof(sitepath)) >= sizeof(sitepath))
|
||||
if (sysctl(archmib, 2, arch, &archlen, NULL, 0) == -1)
|
||||
return NULL;
|
||||
arch[archlen-1] = 0;
|
||||
if (strlcat(sitepath, arch, sizeof(sitepath)) >= sizeof(sitepath))
|
||||
return NULL;
|
||||
|
||||
reldate = getosreldate();
|
||||
|
Loading…
Reference in New Issue
Block a user