-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.subr
34 lines (28 loc) · 1.13 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
# route args param for repo, mkbsdstore, csup, buildworld-related command
[ -n "${oarch}" ] && arch=$oarch
[ -n "${over}" ] && ver=$over
[ -n "${ostable}" ] && stable=$ostable
if [ -z "${arch}" -o "${arch}" = "native" ]; then
arch=$( /usr/bin/uname -m )
target_arch="${arch}"
if [ "${emulator}" = "jail" ]; then
cbsdsql local "UPDATE jails SET arch=\"${arch}\" WHERE jname=\"${jname}\""
fi
fi
if [ -z "${ver}" -o "${ver}" = "native" ]; then
# ver=$( /sbin/sysctl -n kern.osrelease| /usr/bin/cut -d - -f 1 )
# we preffer uname as source, due to some environment have UNAME_r for overwrite version
tmpver=$( /usr/bin/uname -r )
ver=${tmpver%%-*}
unset tmpver
[ "${stable}" = "1" ] && ver=${ver%%.*}
if [ "${emulator}" = "jail" ]; then
cbsdsql local "UPDATE jails SET ver=\"${ver}\" WHERE jname=\"${jname}\""
fi
fi
[ "${stable}" = "1" -a -z "${over}" ] && ver=${ver%%.*}
[ -z "${rev}" ] && rev="head"
[ "${ver}" = "head" ] && ver="12.0" # todo: link with share/FreeBSD-git_branches.conf + srcup
# todo: link with tools/repo getbases for CURRENT
[ -z "${maxjobs}" ] && maxjobs=$( /sbin/sysctl -n hw.ncpu )
[ -z "${clean}" ] && clean=0