Annotation of /trunk/mage-buildserver/helper/buildserver-install.sh
Parent Directory | Revision Log
Revision 3113 -
(hide annotations)
(download)
(as text)
Tue Mar 19 16:12:08 2019 UTC (5 years, 6 months ago) by niro
File MIME type: application/x-sh
File size: 3307 byte(s)
Tue Mar 19 16:12:08 2019 UTC (5 years, 6 months ago) by niro
File MIME type: application/x-sh
File size: 3307 byte(s)
-place build infos in a subdir named '${PNAME}'
1 | niro | 2769 | #!/bin/bash |
2 | |||
3 | BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" | ||
4 | SMAGEFILE="$1" | ||
5 | CLEANPACKAGES=1 | ||
6 | |||
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 | # be silent | ||
77 | FVERBOSE=off \ | ||
78 | SILENT=1 \ | ||
79 | smagesource ${SMAGESCRIPTSDIR}/${SMAGEFILE} | ||
80 | else | ||
81 | die "smagefile '${SMAGESCRIPTSDIR}/${SMAGEFILE}' not found." | ||
82 | fi | ||
83 | |||
84 | niro | 3113 | if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS ] |
85 | niro | 2769 | then |
86 | niro | 3113 | die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS missing. run 'buildserver-build-depends first" |
87 | niro | 2769 | fi |
88 | |||
89 | niro | 3113 | SRC_INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS)" |
90 | niro | 2769 | |
91 | if [[ -z ${SRC_INSTALL_DEPS} ]] | ||
92 | then | ||
93 | die "buildserver-build: SRC_INSTALL_DEPS are empty, aborting." | ||
94 | fi | ||
95 | |||
96 | niro | 3113 | if [ -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_OK ] |
97 | niro | 2769 | then |
98 | echo -en "Package " | ||
99 | echo -en "${COLRED}${PCAT}/${PNAME}-${PVER}-${PBUILD}${COLDEFAULT}" | ||
100 | echo -e " already installed successfully. try a revup." | ||
101 | exit 3 | ||
102 | fi | ||
103 | |||
104 | niro | 3113 | if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALLED_PREREQUISITES ] |
105 | niro | 2769 | then |
106 | niro | 3113 | die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALLED_PREREQUISITES missing. run 'buildserver-build-prerequisites first" |
107 | niro | 2769 | fi |
108 | |||
109 | #regen_mage_tree | ||
110 | # save STATE, gets deleted by regen_mage_tree | ||
111 | BUILDSERVER_SAVED_STATE="${STATE}" | ||
112 | regen_mage_tree | ||
113 | # restore STATE | ||
114 | STATE="${BUILDSERVER_SAVED_STATE}" | ||
115 | |||
116 | # now install the packages (no srcinstall, when the user not explcitly want this) | ||
117 | fetch_packages ${SRC_INSTALL_DEPS} || die "fetching packages" | ||
118 | md5sum_packages ${SRC_INSTALL_DEPS} || die "md5 sum packages" | ||
119 | if install_packages ${SRC_INSTALL_DEPS} || die "installing packages" | ||
120 | then | ||
121 | install_retval=0 | ||
122 | niro | 3113 | echo 0 > ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_OK |
123 | niro | 2769 | echo "Install successfull!" |
124 | else | ||
125 | install_retval=1 | ||
126 | niro | 3113 | echo 1 > ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_FAILED |
127 | niro | 2769 | echo "Installation *not* successfull!" |
128 | fi | ||
129 | if [[ ${CLEANPACKAGES} = 1 ]] | ||
130 | then | ||
131 | cleanpkg | ||
132 | fi | ||
133 | |||
134 | ## always run auto etc-update | ||
135 | echo "running etc-update" | ||
136 | echo "-5" | etc-update | ||
137 | |||
138 | exit ${install_retval} |
Properties
Name | Value |
---|---|
svn:executable | * |