diff options
author | linimon <linimon@FreeBSD.org> | 2010-12-16 15:38:18 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2010-12-16 15:38:18 +0800 |
commit | a242ac598f2495c7caff746822d4a044a4eea0b6 (patch) | |
tree | b7049f9f3007c37d0d2e5648383271b6158286c3 /Tools | |
parent | 6e75c0c8f403b37f531d34da1691c9125de6906e (diff) | |
download | freebsd-ports-graphics-a242ac598f2495c7caff746822d4a044a4eea0b6.tar.gz freebsd-ports-graphics-a242ac598f2495c7caff746822d4a044a4eea0b6.tar.zst freebsd-ports-graphics-a242ac598f2495c7caff746822d4a044a4eea0b6.zip |
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.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/portbuild/scripts/buildenv | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Tools/portbuild/scripts/buildenv b/Tools/portbuild/scripts/buildenv index b49ef5c3884..ef436670d4f 100644 --- a/Tools/portbuild/scripts/buildenv +++ b/Tools/portbuild/scripts/buildenv @@ -62,6 +62,23 @@ resolve() { 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) # @@ -89,6 +106,7 @@ buildenv () { else export SRC_BASE=/nonexistent fi + export_src_metadata ${SRC_BASE} # for archs that support COMPAT_IA32, set some flags for INDEX. # Client kernels should be built appropriately. @@ -106,7 +124,7 @@ buildenv () { fi done - buildenv.common ${pb} ${arch} ${branch} ${builddir} + buildenv.common # override things destined for bsd.port.mk export DISTDIR=${builddir}/distfiles @@ -128,12 +146,8 @@ buildenv () { # establish commonly-used environment variables (client-side) # buildenv.client() { - pb=$1 - arch=$2 - branch=$3 - builddir=$4 - - buildenv.common ${pb} ${arch} ${branch} ${builddir} + # derive OSREL, OSVERSION, and BRANCH + export_src_metadata $1 # manually override results of uname(1) export UNAME_m=${ARCH} @@ -148,19 +162,6 @@ buildenv.client() { # establish commonly-used environment variables (common to clients and server) # 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 MACHINE_ARCH=${arch} |