Tue Jun 27 14:36:41 2023 UTC ()
bootstrap: Override NATIVE_PKG_*_CMD, not PKG_*_CMD, during build.

NATIVE_PKG_*_CMD is what gets executed at build-time, and must be the
bootstrapped pkg_install which lives in the working tree; PKG_*_CMD
may get baked into packages for use at run-time.


(riastradh)
diff -r1.318 -r1.319 pkgsrc/bootstrap/bootstrap

cvs diff -r1.318 -r1.319 pkgsrc/bootstrap/bootstrap (expand / switch to unified diff)

--- pkgsrc/bootstrap/bootstrap 2022/11/11 17:22:14 1.318
+++ pkgsrc/bootstrap/bootstrap 2023/06/27 14:36:41 1.319
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#! /bin/sh 1#! /bin/sh
2 2
3# $NetBSD: bootstrap,v 1.318 2022/11/11 17:22:14 jperkin Exp $ 3# $NetBSD: bootstrap,v 1.319 2023/06/27 14:36:41 riastradh Exp $
4# 4#
5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org> 5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
6# All rights reserved. 6# All rights reserved.
7# 7#
8# Redistribution and use in source and binary forms, with or without 8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions 9# modification, are permitted provided that the following conditions
10# are met: 10# are met:
11# 1. Redistributions of source code must retain the above copyright 11# 1. Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer. 12# notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright 13# 2. Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the 14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution. 15# documentation and/or other materials provided with the distribution.
16# 16#
@@ -1360,30 +1360,30 @@ run_cmd "(cd $wrkdir/pkg_install; env $B @@ -1360,30 +1360,30 @@ run_cmd "(cd $wrkdir/pkg_install; env $B
1360CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \ 1360CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \
1361LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \ 1361LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \
1362LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ 1362LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
1363--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ 1363--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
1364--with-pkgdbdir=$pkgdbdir --infodir=$infodir \ 1364--with-pkgdbdir=$pkgdbdir --infodir=$infodir \
1365--mandir=$mandir $pkg_install_args && \ 1365--mandir=$mandir $pkg_install_args && \
1366STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \ 1366STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \
1367STATIC_LIBARCHIVE_LDADD='`extra_libarchive_depends`' \ 1367STATIC_LIBARCHIVE_LDADD='`extra_libarchive_depends`' \
1368PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)" 1368PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)"
1369run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add" 1369run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add"
1370run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" 1370run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
1371run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" 1371run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
1372run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" 1372run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
1373echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF} 1373echo "NATIVE_PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF}
1374echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} 1374echo "NATIVE_PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
1375echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} 1375echo "NATIVE_PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
1376echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} 1376echo "NATIVE_PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
1377 1377
1378MAKECONF=$wrkdir/mk.conf 1378MAKECONF=$wrkdir/mk.conf
1379export MAKECONF 1379export MAKECONF
1380 1380
1381if [ "$bootstrap_sh_set" = "set" ]; then 1381if [ "$bootstrap_sh_set" = "set" ]; then
1382 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} 1382 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF}
1383 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} 1383 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF}
1384fi 1384fi
1385 1385
1386# preserve compiler and tool environment variables settings 1386# preserve compiler and tool environment variables settings
1387if test -n "$CP"; then 1387if test -n "$CP"; then
1388 echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} 1388 echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF}
1389 echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} 1389 echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF}