Annotation of /trunk/mage-buildserver/helper/buildserver-build-install-prerequisites.sh
Parent Directory | Revision Log
Revision 2818 -
(hide annotations)
(download)
(as text)
Mon Sep 8 15:01:37 2014 UTC (10 years ago) by niro
File MIME type: application/x-sh
File size: 3191 byte(s)
Mon Sep 8 15:01:37 2014 UTC (10 years ago) by niro
File MIME type: application/x-sh
File size: 3191 byte(s)
-install_packages() unpacks the packages already, no need to do this twice
1 | niro | 2747 | #!/bin/bash |
2 | |||
3 | BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" | ||
4 | SMAGEFILE="$1" | ||
5 | niro | 2763 | CLEANPACKAGES=0 |
6 | niro | 2747 | |
7 | if [ -f /etc/rc.d/init.d/functions ] | ||
8 | then | ||
9 | source /etc/rc.d/init.d/functions | ||
10 | else | ||
11 | die "/etc/rc.d/init.d/functions not found" | ||
12 | fi | ||
13 | if [ -f /etc/mage.rc.global ] | ||
14 | then | ||
15 | source /etc/mage.rc.global | ||
16 | else | ||
17 | die "/etc/mage.rc.global not found" | ||
18 | fi | ||
19 | if [ -f /etc/mage.rc ] | ||
20 | then | ||
21 | source /etc/mage.rc | ||
22 | else | ||
23 | die "/etc/mage.rc not found" | ||
24 | fi | ||
25 | if [ -f ${MLIBDIR}/mage4.functions.sh ] | ||
26 | then | ||
27 | source ${MLIBDIR}/mage4.functions.sh | ||
28 | else | ||
29 | die "${MLIBDIR}/mage4.functions.sh not found" | ||
30 | fi | ||
31 | if [ -f ${MLIBDIR}/smage2.functions.sh ] | ||
32 | then | ||
33 | source ${MLIBDIR}/smage2.functions.sh | ||
34 | else | ||
35 | die "${MLIBDIR}/smage2.functions.sh not found" | ||
36 | fi | ||
37 | |||
38 | # do this at least of all includes to prevent path overwrites | ||
39 | env-rebuild | ||
40 | source /etc/profile | ||
41 | |||
42 | # export default path | ||
43 | export PATH="${PATH}:${MLIBDIR}" | ||
44 | |||
45 | die() | ||
46 | { | ||
47 | echo "ERROR: $@" | ||
48 | exit 1 | ||
49 | } | ||
50 | |||
51 | is_split_target_magefile() | ||
52 | { | ||
53 | local mage="$1" | ||
54 | |||
55 | for target_mage in ${MY_SPLIT_TARGET_MAGEFILES} | ||
56 | do | ||
57 | if [[ ${mage} = ${target_mage} ]] | ||
58 | then | ||
59 | return 0 | ||
60 | fi | ||
61 | done | ||
62 | |||
63 | return 1 | ||
64 | } | ||
65 | |||
66 | load_mage_features | ||
67 | mage_setup | ||
68 | |||
69 | if [[ -z ${SMAGEFILE} ]] | ||
70 | then | ||
71 | die "no smage file given. call '$(basename $0) with/relative/path/from/buildroot/svn/smage/to/smagefile'" | ||
72 | fi | ||
73 | |||
74 | if [ -f ${SMAGESCRIPTSDIR}/${SMAGEFILE} ] | ||
75 | then | ||
76 | niro | 2763 | # be silent |
77 | FVERBOSE=off \ | ||
78 | SILENT=1 \ | ||
79 | smagesource ${SMAGESCRIPTSDIR}/${SMAGEFILE} | ||
80 | niro | 2747 | else |
81 | die "smagefile '${SMAGESCRIPTSDIR}/${SMAGEFILE}' not found." | ||
82 | fi | ||
83 | |||
84 | # create build info dir | ||
85 | install -d ${BUILDSERVER_CACHE_DIR}/build | ||
86 | |||
87 | if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS ] | ||
88 | then | ||
89 | die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS missing. run 'buildserver-build-depends first" | ||
90 | fi | ||
91 | |||
92 | if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS ] | ||
93 | then | ||
94 | die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS missing. run 'buildserver-build-depends first" | ||
95 | fi | ||
96 | |||
97 | INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS)" | ||
98 | SRC_INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS)" | ||
99 | |||
100 | if [[ -z ${SRC_INSTALL_DEPS} ]] | ||
101 | then | ||
102 | die "buildserver-build-uninstall-prerequisites: SRC_INSTALL_DEPS are empty, aborting." | ||
103 | fi | ||
104 | |||
105 | echo | ||
106 | echo "---- dependencies ----" | ||
107 | echo "INSTALL_DEPS:" | ||
108 | for i in ${INSTALL_DEPS} | ||
109 | do | ||
110 | echo " * ${i}" | ||
111 | done | ||
112 | echo "SRC_INSTALL_DEPS:" | ||
113 | for i in ${SRC_INSTALL_DEPS} | ||
114 | do | ||
115 | echo " * ${i}" | ||
116 | done | ||
117 | echo "----------------------" | ||
118 | |||
119 | #echo "DEBUG: paused"; read | ||
120 | |||
121 | # override packages path | ||
122 | SAVED_PKGDIR="${PKGDIR}" | ||
123 | PKGDIR="/var/cache/mage/tmp-packages" | ||
124 | install -d "${PKGDIR}" | ||
125 | |||
126 | # now install the packages (no srcinstall, when the user not explcitly want this) | ||
127 | fetch_packages ${INSTALL_DEPS} || die "fetching packages" | ||
128 | md5sum_packages ${INSTALL_DEPS} || die "md5 sum packages" | ||
129 | install_packages ${INSTALL_DEPS} || die "installing packages" | ||
130 | niro | 2763 | if [[ ${CLEANPACKAGES} = 1 ]] |
131 | then | ||
132 | cleanpkg | ||
133 | fi | ||
134 | niro | 2747 | # restore packages path |
135 | PKGDIR="${SAVED_PKGDIR}" | ||
136 | |||
137 | ## always run auto etc-update | ||
138 | echo "running etc-update" | ||
139 | echo "-5" | etc-update | ||
140 | |||
141 | # mark prerequisites as installed | ||
142 | touch ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALLED_PREREQUISITES |
Properties
Name | Value |
---|---|
svn:executable | * |