NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/48215: pkg_add fails on recent NetBSD/evbearmv6hf-el current



On 09/16/13 06:55, Ryo ONODERA wrote:
The following reply was made to PR port-arm/48215; it has been noted by GNATS.

From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: port-arm/48215: pkg_add fails on recent NetBSD/evbearmv6hf-el
  current
Date: Mon, 16 Sep 2013 14:53:43 +0900 (JST)

  Hi,
From: Matt Thomas <matt%3am-software.com@localhost>, Date: Sun, 15 Sep 2013 22:45:41 -0700 > That seems to be a pkg tools program, not an arm problem. Thank you.
  I will investigate pkg_install deeper.

Something like the attached diff should fix this. I didn't even compile test it, though.

Nick
Index: pkgtools/pkg_install/files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.105
diff -u -p -u -r1.105 perform.c
--- pkgtools/pkg_install/files/add/perform.c    2 Sep 2013 10:28:44 -0000       
1.105
+++ pkgtools/pkg_install/files/add/perform.c    16 Sep 2013 08:05:25 -0000
@@ -908,8 +908,17 @@ check_platform(struct pkg_task *pkg)
 
        if (OverrideMachine != NULL)
                effective_arch = OverrideMachine;
-       else
-               effective_arch = MACHINE_ARCH;
+       else {
+               static char machine_arch_buf[sizeof(utsname.machine)];
+               const int mib[2] = { CTL_HW, HW_MACHINE_ARCH };
+               size_t len = sizeof(machine_arch_buf);
+
+               if (sysctl(mib, __arraycount(mib), machine_arch_buf,
+                   &len, NULL, 0) == 0)
+                       effective_arch = machine_arch_buf;
+               else
+                       effective_arch = MACHINE_ARCH;
+       }
 
        /* If either the OS or arch are different, bomb */
        if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) ||


Home | Main Index | Thread Index | Old Index