Magellan Linux

Diff of /trunk/mage-buildserver/buildserver-prepare.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2730 by niro, Sun Aug 10 19:35:40 2014 UTC revision 2749 by niro, Wed Aug 13 14:28:18 2014 UTC
# Line 2  Line 2 
2    
3  # get configuration  # get configuration
4  BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"  BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"
5    BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"
6  source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf  source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf
7    
8  source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh  source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh
# Line 21  fi Line 22  fi
22  # create buildroot layout  # create buildroot layout
23  install -d ${BUILDROOT}/.stamps  install -d ${BUILDROOT}/.stamps
24  install -d ${BUILDROOT}/tmp/mage-tree  install -d ${BUILDROOT}/tmp/mage-tree
25    install -d ${BUILDROOT}/ssh
26  for arch in ${BUILD_ARCH[*]} src  for arch in ${BUILD_ARCH[*]} src
27  do  do
28   install -d ${BUILDROOT}/${arch}   install -d ${BUILDROOT}/${arch}
29   install -d ${BUILDROOT}/packages/${arch}   install -d ${BUILDROOT}/packages/${arch}
30   install -d ${BUILDROOT}/meta/${arch}   install -d ${BUILDROOT}/meta/${arch}
31     install -d ${BUILDROOT}/build-info/${arch}
32  done  done
33    
34  #  #
# Line 64  do Line 67  do
67   [[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy   [[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy
68   runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup"   runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup"
69    
70     # always enable bootstrap mode to supress the startups of any services
71     :> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver
72     echo "MAGE_BOOTSTRAP=\"true\"" >> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver
73    
74   # install subversion   # install subversion
75   if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ]   if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ]
76   then   then
# Line 114  do Line 121  do
121   runarch "${arch}" update-ca-certificates # no die here, cmd may missing   runarch "${arch}" update-ca-certificates # no die here, cmd may missing
122    
123   # create list of protected packages   # create list of protected packages
124   echo "BUILDSERVER_CONFIG_DIR=\"${BUILDSERVER_CONFIG_DIR}\"" > ${BUILDROOT}/${arch}/.runrc   echo "BUILDSERVER_CACHE_DIR=\"${BUILDSERVER_CACHE_DIR}\"" > ${BUILDROOT}/${arch}/.runrc
  install -d ${BUILDSERVER_CONFIG_DIR}/protected  
125   cat >> ${BUILDROOT}/${arch}/.runrc << "EOF"   cat >> ${BUILDROOT}/${arch}/.runrc << "EOF"
 env-rebuild  
 source /etc/profile  
   
126  if [ -f /etc/rc.d/init.d/functions ]  if [ -f /etc/rc.d/init.d/functions ]
127  then  then
128   source /etc/rc.d/init.d/functions   source /etc/rc.d/init.d/functions
# Line 139  else Line 142  else
142   die "/etc/mage.rc not found"   die "/etc/mage.rc not found"
143  fi  fi
144    
145    env-rebuild
146    source /etc/profile
147    
148    echo "generate protected packages info data"
149    install -d ${BUILDSERVER_CACHE_DIR}/protected
150    
151  for mage in $(find ${INSTALLDB} -name \*.${MAGESUFFIX})  for mage in $(find ${INSTALLDB} -name \*.${MAGESUFFIX})
152  do  do
153   pkgname=$(basename ${i} .${MAGESUFFIX})   pkgname=$(basename ${mage} .${MAGESUFFIX})
154   pkgname="${pkgname%-*-*}"   pkgname="${pkgname%-*-*}"
155   echo "${pkgname}" > ${BUILDSERVER_CONFIG_DIR}/protected/"${pkgname}"   echo "${pkgname}" > ${BUILDSERVER_CACHE_DIR}/protected/"${pkgname}"
156  done  done
157  EOF  EOF
158     runarch-script ${arch} .runrc  || die "${arch} protect-gen failed"
159     if [ -f ${BUILDROOT}/${arch}/.runrc ]
160     then
161     rm ${BUILDROOT}/${arch}/.runrc
162     fi
163    
164   # cleanup   # cleanup
165   runarch "${arch}" mage clean || die "${arch} mage clean"   runarch "${arch}" mage clean || die "${arch} mage clean"

Legend:
Removed from v.2730  
changed lines
  Added in v.2749