4 |
exit 1 |
exit 1 |
5 |
} |
} |
6 |
|
|
7 |
|
os-arch() |
8 |
|
{ |
9 |
|
local arch="$1" |
10 |
|
local os_arch |
11 |
|
|
12 |
|
case ${arch} in |
13 |
|
i*86|x86_64) os_arch="${arch}" ;; |
14 |
|
src|playground*) os_arch="$(source ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc; echo ${ARCH})";; |
15 |
|
esac |
16 |
|
|
17 |
|
echo "${os_arch}" |
18 |
|
} |
19 |
|
|
20 |
runarch-script() |
runarch-script() |
21 |
{ |
{ |
22 |
local arch="$1" |
local arch="$1" |
68 |
|
|
69 |
# create runrc |
# create runrc |
70 |
echo "${cmd}" > "${runrc}" |
echo "${cmd}" > "${runrc}" |
71 |
runarch-script "${arch}" .runrc || die "runarch script execition of '${runrc}' failed." |
runarch-script "${arch}" .runrc || die "runarch script execution of '${runrc}' failed." |
72 |
|
|
73 |
if [ -f "${runrc}" ] |
if [ -f "${runrc}" ] |
74 |
then |
then |
75 |
rm "${runrc}" |
rm "${runrc}" |
76 |
fi |
fi |
77 |
} |
} |
78 |
|
|
79 |
|
runarch-pkg-install() |
80 |
|
{ |
81 |
|
local arch="$1" |
82 |
|
local pkg="$2" |
83 |
|
|
84 |
|
if [ ! -f ${BUILDROOT}/.stamps/"${arch}"_"${pkg}"-ok ] |
85 |
|
then |
86 |
|
runarch "${arch}" mage install "${pkg}" || die "${arch} install 'python'" |
87 |
|
touch ${BUILDROOT}/.stamps/"${arch}"_"${pkg}"-ok |
88 |
|
else |
89 |
|
echo "Warning: '${pkg}' already installed for arch '${arch}'" |
90 |
|
fi |
91 |
|
|
92 |
|
# never fail |
93 |
|
return 0 |
94 |
|
} |
95 |
|
|
96 |
|
enum-build-arch-types() |
97 |
|
{ |
98 |
|
echo "${BUILD_ARCH[*]}" |
99 |
|
} |
100 |
|
|
101 |
|
enum-all-arch-types() |
102 |
|
{ |
103 |
|
local arch |
104 |
|
local build_arch_types |
105 |
|
|
106 |
|
for arch in src ${BUILD_ARCH[*]} |
107 |
|
do |
108 |
|
if [ ! -e ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc ] |
109 |
|
then |
110 |
|
echo "Warning: mage.rc of '${arch}' not found. Arch '${arch}' ignored." >&2 |
111 |
|
else |
112 |
|
build_arch_types+=( "${arch}" ) |
113 |
|
fi |
114 |
|
done |
115 |
|
|
116 |
|
if [[ ${BUILD_PLAYGROUND} -eq 1 ]] |
117 |
|
then |
118 |
|
for arch in ${BUILD_ARCH[*]} |
119 |
|
do |
120 |
|
if [ ! -e ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/playground-${arch}/mage.rc ] |
121 |
|
then |
122 |
|
echo "Warning: mage.rc of 'playground-${arch}' not found. Arch 'playground-${arch}' ignored." >&2 |
123 |
|
else |
124 |
|
build_arch_types+=( "playground-${arch}" ) |
125 |
|
fi |
126 |
|
done |
127 |
|
fi |
128 |
|
|
129 |
|
echo "${build_arch_types[*]}" |
130 |
|
} |