mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Refactor the client-side. It turns out that the evaluation of param.h
was being done before the src tree had been mounted. This was not a problem in the old codebase, since it simply got the wrong src tree to start with. This actually simplifies the code.
This commit is contained in:
parent
b0a015135a
commit
6f337f74cd
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=266405
1 changed files with 21 additions and 20 deletions
|
@ -62,6 +62,23 @@ resolve() {
|
||||||
echo ${buildid}
|
echo ${buildid}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# derive the source tree metadata and export it. common to both client and server.
|
||||||
|
export_src_metadata() {
|
||||||
|
src_base=$1
|
||||||
|
|
||||||
|
if [ -f ${src_base}/sys/sys/param.h ]; then
|
||||||
|
export OSVERSION=$(awk '/^#define __FreeBSD_version/ {print $3}' < ${src_base}/sys/sys/param.h)
|
||||||
|
else
|
||||||
|
echo "export_src_metadata: couldn't find ${src_base}/sys/sys/param.h!"
|
||||||
|
fi
|
||||||
|
if [ -f ${src_base}/sys/conf/newvers.sh ]; then
|
||||||
|
export OSREL=$(awk 'BEGIN {FS="\""}; /^REVISION/ {print $2}' < ${src_base}/sys/conf/newvers.sh)
|
||||||
|
export BRANCH=$(awk 'BEGIN {FS="\""}; /^BRANCH/ {print $2}' < ${src_base}/sys/conf/newvers.sh)
|
||||||
|
else
|
||||||
|
echo "export_src_metadata: couldn't find ${src_base}/sys/conf/newvers.sh!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# establish commonly-used environment variables (server-side)
|
# establish commonly-used environment variables (server-side)
|
||||||
#
|
#
|
||||||
|
@ -89,6 +106,7 @@ buildenv () {
|
||||||
else
|
else
|
||||||
export SRC_BASE=/nonexistent
|
export SRC_BASE=/nonexistent
|
||||||
fi
|
fi
|
||||||
|
export_src_metadata ${SRC_BASE}
|
||||||
|
|
||||||
# for archs that support COMPAT_IA32, set some flags for INDEX.
|
# for archs that support COMPAT_IA32, set some flags for INDEX.
|
||||||
# Client kernels should be built appropriately.
|
# Client kernels should be built appropriately.
|
||||||
|
@ -106,7 +124,7 @@ buildenv () {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
buildenv.common ${pb} ${arch} ${branch} ${builddir}
|
buildenv.common
|
||||||
|
|
||||||
# override things destined for bsd.port.mk
|
# override things destined for bsd.port.mk
|
||||||
export DISTDIR=${builddir}/distfiles
|
export DISTDIR=${builddir}/distfiles
|
||||||
|
@ -128,12 +146,8 @@ buildenv () {
|
||||||
# establish commonly-used environment variables (client-side)
|
# establish commonly-used environment variables (client-side)
|
||||||
#
|
#
|
||||||
buildenv.client() {
|
buildenv.client() {
|
||||||
pb=$1
|
# derive OSREL, OSVERSION, and BRANCH
|
||||||
arch=$2
|
export_src_metadata $1
|
||||||
branch=$3
|
|
||||||
builddir=$4
|
|
||||||
|
|
||||||
buildenv.common ${pb} ${arch} ${branch} ${builddir}
|
|
||||||
|
|
||||||
# manually override results of uname(1)
|
# manually override results of uname(1)
|
||||||
export UNAME_m=${ARCH}
|
export UNAME_m=${ARCH}
|
||||||
|
@ -148,19 +162,6 @@ buildenv.client() {
|
||||||
# establish commonly-used environment variables (common to clients and server)
|
# establish commonly-used environment variables (common to clients and server)
|
||||||
#
|
#
|
||||||
buildenv.common() {
|
buildenv.common() {
|
||||||
pb=$1
|
|
||||||
arch=$2
|
|
||||||
branch=$3
|
|
||||||
builddir=$4
|
|
||||||
|
|
||||||
if [ -f ${SRC_BASE}/sys/sys/param.h ]; then
|
|
||||||
export OSVERSION=$(awk '/^#define __FreeBSD_version/ {print $3}' < ${SRC_BASE}/sys/sys/param.h)
|
|
||||||
fi
|
|
||||||
if [ -f ${SRC_BASE}/sys/conf/newvers.sh ]; then
|
|
||||||
export OSREL=$(awk 'BEGIN {FS="\""}; /^REVISION/ {print $2}' < ${SRC_BASE}/sys/conf/newvers.sh)
|
|
||||||
export BRANCH=$(awk 'BEGIN {FS="\""}; /^BRANCH/ {print $2}' < ${SRC_BASE}/sys/conf/newvers.sh)
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ARCH=${arch}
|
export ARCH=${arch}
|
||||||
export MACHINE_ARCH=${arch}
|
export MACHINE_ARCH=${arch}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue