Magellan Linux

Contents of /trunk/mage-buildserver/buildserver-playground-install-smage.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2813 - (show annotations) (download) (as text)
Mon Sep 8 14:55:07 2014 UTC (9 years, 7 months ago) by niro
File MIME type: application/x-sh
File size: 2102 byte(s)
-added buildserver-playground-install-smage script
1 #!/bin/bash
2
3 # get configuration
4 BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"
5 BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"
6 source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf
7
8 source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh
9
10 SMAGEFILE="$1"
11
12 if [[ -z ${SMAGEFILE} ]]
13 then
14 die "no smage file given. call '$(basename $0) with/relative/path/from/buildroot/svn/smage/to/smagefile'"
15 fi
16
17 if [[ ! -f ${BUILDROOT}/svn/smage/${SMAGEFILE} ]]
18 then
19 die "given smage file does not exist"
20 fi
21
22 if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ]
23 then
24 die "svn checkout of mage required. run buildserver-svn first."
25 fi
26 if [ ! -f ${BUILDROOT}/.stamps/smage_svn-checkout-ok ]
27 then
28 die "svn checkout of smage required. run buildserver-svn first."
29 fi
30 for arch in $(enum-playground-arch-types)
31 do
32 if [ ! -f ${BUILDROOT}/.stamps/${arch}_bootstrap-ok ]
33 then
34 die "bootstrap of buildsystem required for arch '${arch}'. run buildserver-prepare first."
35 fi
36 if [ ! -f ${BUILDROOT}/.stamps/${arch}_initial-mage-tree-ok ]
37 then
38 die "initial regen of mage-tree required for '${arch}'. run buildserver-setup-mage-tree first."
39 fi
40 done
41 for arch in $(enum-playground-arch-types)
42 do
43 if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ]
44 then
45 die "common-devutils package for '${arch}' not installed. run buildserver-prepare first."
46 fi
47 done
48
49 for arch in $(enum-playground-arch-types)
50 do
51 echo "SMAGEFILE=\"${SMAGEFILE}\"" > ${BUILDROOT}/${arch}/.runrc
52 echo "BUILDSERVER_LIB_DIR=\"${BUILDSERVER_LIB_DIR}\"" >> ${BUILDROOT}/${arch}/.runrc
53 cat >> ${BUILDROOT}/${arch}/.runrc << 'EOF'
54 install_retval=0
55 ${BUILDSERVER_LIB_DIR}/buildserver-build-depends.sh ${SMAGEFILE} || exit 1
56 ${BUILDSERVER_LIB_DIR}/buildserver-build-install-prerequisites.sh ${SMAGEFILE}
57 ${BUILDSERVER_LIB_DIR}/buildserver-install.sh ${SMAGEFILE} || install_retval=1
58
59 exit ${install_retval}
60 EOF
61 runarch-script ${arch} .runrc || die "${arch} package build failed"
62 if [ -f ${BUILDROOT}/${arch}/.runrc ]
63 then
64 rm ${BUILDROOT}/${arch}/.runrc
65 fi
66 done
67
68 echo
69 echo "smage '${SMAGEFILE}' sucessfully installed on playground arches."

Properties

Name Value
svn:executable *