Tue Oct 20 08:18:12 2015 UTC ()
OpenBSD and derivatives define MACHINE_ARCH in sys/param.h to "amd64" which
overrides our attempt to set it to "x86_64" and ensure consistency across
platforms.  Work around this by setting it using PKGSRC_MACHINE_ARCH.

Confirmed to fix the issue and not break a variety of other platforms by
Sevan, and approved under duress by Joerg.


(jperkin)
diff -r1.211 -r1.212 pkgsrc/pkgtools/pkg_install/Makefile
diff -r1.31 -r1.32 pkgsrc/pkgtools/pkg_install/files/add/Makefile.in
diff -r1.106 -r1.107 pkgsrc/pkgtools/pkg_install/files/add/perform.c

cvs diff -r1.211 -r1.212 pkgsrc/pkgtools/pkg_install/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/Makefile 2015/09/07 09:06:04 1.211
+++ pkgsrc/pkgtools/pkg_install/Makefile 2015/10/20 08:18:12 1.212
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.211 2015/09/07 09:06:04 jperkin Exp $ 1# $NetBSD: Makefile,v 1.212 2015/10/20 08:18:12 jperkin Exp $
2 2
3# Notes to package maintainers: 3# Notes to package maintainers:
4# 4#
5# Updating this package does not automatically necessitate bumping 5# Updating this package does not automatically necessitate bumping
6# PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical 6# PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical
7# change in the pkg_* tools that pkgsrc relies on for proper operation. 7# change in the pkg_* tools that pkgsrc relies on for proper operation.
8 8
9PKGNAME= pkg_install-${VERSION} 9PKGNAME= pkg_install-${VERSION}
10CATEGORIES= pkgtools 10CATEGORIES= pkgtools
11 11
12MAINTAINER= agc@NetBSD.org 12MAINTAINER= agc@NetBSD.org
13HOMEPAGE= http://www.pkgsrc.org/ 13HOMEPAGE= http://www.pkgsrc.org/
14COMMENT= Package management and administration tools for pkgsrc 14COMMENT= Package management and administration tools for pkgsrc
@@ -66,27 +66,27 @@ PKG_DELETE_CMD= ${WRKSRC}/delete/pkg_de @@ -66,27 +66,27 @@ PKG_DELETE_CMD= ${WRKSRC}/delete/pkg_de
66# Special case for dependency checking in 'non-bootstrap' builds: 66# Special case for dependency checking in 'non-bootstrap' builds:
67# don't redefine 'pkg_info' if it already exists. 67# don't redefine 'pkg_info' if it already exists.
68# 68#
69. if defined(PKG_INFO_CMD) && !exists(${PKG_INFO_CMD}) 69. if defined(PKG_INFO_CMD) && !exists(${PKG_INFO_CMD})
70PKG_INFO_CMD= ${WRKSRC}/info/pkg_info 70PKG_INFO_CMD= ${WRKSRC}/info/pkg_info
71. endif 71. endif
72.endif 72.endif
73 73
74CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES 74CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
75CPPFLAGS+= -D_FILE_OFFSET_BITS=64 75CPPFLAGS+= -D_FILE_OFFSET_BITS=64
76 76
77CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK} 77CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK}
78 78
79MAKE_ENV+= MACHINE_ARCH=${MACHINE_ARCH} 79MAKE_ENV+= PKGSRC_MACHINE_ARCH=${MACHINE_ARCH}
80MAKE_ENV+= OPSYS=${OPSYS} 80MAKE_ENV+= OPSYS=${OPSYS}
81MAKE_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q} 81MAKE_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q}
82MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} 82MAKE_ENV+= MANINSTALL=${MANINSTALL:Q}
83 83
84PKG_DBDIR?= /var/db/pkg 84PKG_DBDIR?= /var/db/pkg
85EGDIR= ${PREFIX}/share/examples/pkg_install 85EGDIR= ${PREFIX}/share/examples/pkg_install
86 86
87PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR} 87PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR}
88 88
89DEINSTALL_SRC= # empty 89DEINSTALL_SRC= # empty
90INSTALL_SRC= ${PKGDIR}/INSTALL 90INSTALL_SRC= ${PKGDIR}/INSTALL
91FILES_SUBST+= PKG_DBDIR=${PKG_DBDIR} \ 91FILES_SUBST+= PKG_DBDIR=${PKG_DBDIR} \
92 PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q} \ 92 PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q} \

cvs diff -r1.31 -r1.32 pkgsrc/pkgtools/pkg_install/files/add/Makefile.in (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/Makefile.in 2015/09/07 09:06:04 1.31
+++ pkgsrc/pkgtools/pkg_install/files/add/Makefile.in 2015/10/20 08:18:12 1.32
@@ -1,30 +1,30 @@ @@ -1,30 +1,30 @@
1# $NetBSD: Makefile.in,v 1.31 2015/09/07 09:06:04 jperkin Exp $ 1# $NetBSD: Makefile.in,v 1.32 2015/10/20 08:18:12 jperkin Exp $
2 2
3srcdir= @srcdir@ 3srcdir= @srcdir@
4 4
5prefix= @prefix@ 5prefix= @prefix@
6exec_prefix= @exec_prefix@ 6exec_prefix= @exec_prefix@
7sbindir= @sbindir@ 7sbindir= @sbindir@
8mandir= @mandir@ 8mandir= @mandir@
9datarootdir= @datarootdir@ 9datarootdir= @datarootdir@
10 10
11man1dir= $(mandir)/man1 11man1dir= $(mandir)/man1
12cat1dir= $(mandir)/cat1 12cat1dir= $(mandir)/cat1
13 13
14CC= @CC@ 14CC= @CC@
15CCLD= $(CC) 15CCLD= $(CC)
16CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib 16CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib
17DEFS= @DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DMACHINE_ARCH=\"$(MACHINE_ARCH)\" -DBINDIR=\"$(sbindir)\" 17DEFS= @DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DPKGSRC_MACHINE_ARCH=\"$(PKGSRC_MACHINE_ARCH)\" -DBINDIR=\"$(sbindir)\"
18CFLAGS= @CFLAGS@ 18CFLAGS= @CFLAGS@
19LDFLAGS= @LDFLAGS@ -L../lib 19LDFLAGS= @LDFLAGS@ -L../lib
20 20
21SSL_SUPPORT= @ssl_support@ 21SSL_SUPPORT= @ssl_support@
22 22
23LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch 23LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch
24.if !empty(SSL_SUPPORT) 24.if !empty(SSL_SUPPORT)
25LIBS+= -lssl -lcrypto 25LIBS+= -lssl -lcrypto
26.endif 26.endif
27LIBS+= @LIBS@ 27LIBS+= @LIBS@
28 28
29INSTALL= @INSTALL@ 29INSTALL= @INSTALL@
30 30

cvs diff -r1.106 -r1.107 pkgsrc/pkgtools/pkg_install/files/add/perform.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/perform.c 2014/12/30 15:13:20 1.106
+++ pkgsrc/pkgtools/pkg_install/files/add/perform.c 2015/10/20 08:18:12 1.107
@@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
1/* $NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $ */ 1/* $NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $ */
2#if HAVE_CONFIG_H 2#if HAVE_CONFIG_H
3#include "config.h" 3#include "config.h"
4#endif 4#endif
5#include <nbcompat.h> 5#include <nbcompat.h>
6#if HAVE_SYS_CDEFS_H 6#if HAVE_SYS_CDEFS_H
7#include <sys/cdefs.h> 7#include <sys/cdefs.h>
8#endif 8#endif
9__RCSID("$NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $"); 9__RCSID("$NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $");
10 10
11/*- 11/*-
12 * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> 12 * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
13 * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> 13 * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org>
14 * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> 14 * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org>
15 * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> 15 * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org>
16 * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org> 16 * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org>
17 * All rights reserved. 17 * All rights reserved.
18 * 18 *
19 * Redistribution and use in source and binary forms, with or without 19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions 20 * modification, are permitted provided that the following conditions
21 * are met: 21 * are met:
22 * 22 *
@@ -897,27 +897,27 @@ check_platform(struct pkg_task *pkg) @@ -897,27 +897,27 @@ check_platform(struct pkg_task *pkg)
897 warnx("uname() failed, continuing."); 897 warnx("uname() failed, continuing.");
898 return 0; 898 return 0;
899 } else { 899 } else {
900 warnx("uname() failed, aborting."); 900 warnx("uname() failed, aborting.");
901 return -1; 901 return -1;
902 } 902 }
903 } 903 }
904 904
905 normalise_platform(&host_uname); 905 normalise_platform(&host_uname);
906 906
907 if (OverrideMachine != NULL) 907 if (OverrideMachine != NULL)
908 effective_arch = OverrideMachine; 908 effective_arch = OverrideMachine;
909 else 909 else
910 effective_arch = MACHINE_ARCH; 910 effective_arch = PKGSRC_MACHINE_ARCH;
911 911
912 /* If either the OS or arch are different, bomb */ 912 /* If either the OS or arch are different, bomb */
913 if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) || 913 if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) ||
914 strcmp(effective_arch, pkg->buildinfo[BI_MACHINE_ARCH]) != 0) 914 strcmp(effective_arch, pkg->buildinfo[BI_MACHINE_ARCH]) != 0)
915 fatal = 1; 915 fatal = 1;
916 else 916 else
917 fatal = 0; 917 fatal = 0;
918 918
919 if (fatal || 919 if (fatal ||
920 compatible_platform(OPSYS_NAME, host_uname.release, 920 compatible_platform(OPSYS_NAME, host_uname.release,
921 pkg->buildinfo[BI_OS_VERSION]) != 1) { 921 pkg->buildinfo[BI_OS_VERSION]) != 1) {
922 warnx("Warning: package `%s' was built for a platform:", 922 warnx("Warning: package `%s' was built for a platform:",
923 pkg->pkgname); 923 pkg->pkgname);