-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.subr
36 lines (29 loc) · 1.14 KB
/
build.subr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# route args param for repo, mkbsdstore, csup, buildworld-related command
[ -n "${oarch}" ] && arch=${oarch}
[ -n "${over}" ] && ver=${over}
[ -n "${ostable}" ] && stable=${ostable}
[ -n "${otarget_arch}" ] && target_arch=${otarget_arch}
if [ -z "${arch}" -o "${arch}" = "native" ]; then
arch=$( ${UNAME_CMD} -m )
if [ "${emulator}" = "jail" ]; then
cbsdsqlrw local "UPDATE jails SET arch=\"${arch}\" WHERE jname=\"${jname}\""
fi
fi
[ -z "${target_arch}" ] && target_arch="${arch}"
if [ -z "${ver}" -o "${ver}" = "native" ]; then
# ver=$( ${SYSCTL_CMD} -n kern.osrelease| ${CUT_CMD} -d - -f 1 )
# we preffer uname as source, due to some environment have UNAME_r for overwrite version
tmpver=$( ${UNAME_CMD} -r )
ver=${tmpver%%-*}
unset tmpver
fi
[ "${stable}" = "1" -a -z "${over}" ] && ver=${ver%%.*}
[ -z "${rev}" ] && rev="head"
if [ "${ver}" = "head" ]; then
stable=1 # head always is stable
ver="${FREEBSD_VER_CURRENT}" # vars from global.conf
# todo: link with share/FreeBSD-git_branches.conf + srcup
# todo: link with tools/repo getbases for CURRENT
fi
[ -z "${maxjobs}" ] && maxjobs=$( ${SYSCTL_CMD} -n hw.ncpu )
[ -z "${clean}" ] && clean=0