Magellan Linux

Diff of /trunk/mage-buildserver/helper/buildserver-build-install-prerequisites.sh

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

revision 2747 by niro, Wed Aug 13 14:02:51 2014 UTC revision 3113 by niro, Tue Mar 19 16:12:08 2019 UTC
# Line 2  Line 2 
2    
3  BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"  BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"
4  SMAGEFILE="$1"  SMAGEFILE="$1"
5    CLEANPACKAGES=0
6    
7  if [ -f /etc/rc.d/init.d/functions ]  if [ -f /etc/rc.d/init.d/functions ]
8  then  then
# Line 72  fi Line 73  fi
73    
74  if [ -f ${SMAGESCRIPTSDIR}/${SMAGEFILE} ]  if [ -f ${SMAGESCRIPTSDIR}/${SMAGEFILE} ]
75  then  then
76   SILENT=1 smagesource ${SMAGESCRIPTSDIR}/${SMAGEFILE}   # be silent
77     FVERBOSE=off \
78     SILENT=1 \
79     smagesource ${SMAGESCRIPTSDIR}/${SMAGEFILE}
80  else  else
81   die "smagefile '${SMAGESCRIPTSDIR}/${SMAGEFILE}' not found."   die "smagefile '${SMAGESCRIPTSDIR}/${SMAGEFILE}' not found."
82  fi  fi
83    
84    # don't want to run any exported post/preinstall or post/preremove
85    # functions of the smage here because they will be exported globally
86    # and honored by every package which does not override these function.
87    # the final package (the smage itself) will not be installed via this script,
88    # so these functions can be safely ignored.
89    for func in {pre,post}{install,remove}
90    do
91     if [[ $(typeset -f ${func}) ]]
92     then
93     unset "${func}"
94     fi
95    done
96    
97  # create build info dir  # create build info dir
98  install -d ${BUILDSERVER_CACHE_DIR}/build  install -d ${BUILDSERVER_CACHE_DIR}/build/${PNAME}
99    
100  if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS ]  if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS ]
101  then  then
102   die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS missing. run 'buildserver-build-depends first"   die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS missing. run 'buildserver-build-depends first"
103  fi  fi
104    
105  if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS ]  if [ ! -f ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS ]
106  then  then
107   die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS missing. run 'buildserver-build-depends first"   die "${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS missing. run 'buildserver-build-depends first"
108  fi  fi
109    
110  INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS)"  INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALL_DEPS)"
111  SRC_INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS)"  SRC_INSTALL_DEPS="$(< ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/SRC_INSTALL_DEPS)"
112    
113  if [[ -z ${SRC_INSTALL_DEPS} ]]  if [[ -z ${SRC_INSTALL_DEPS} ]]
114  then  then
# Line 119  SAVED_PKGDIR="${PKGDIR}" Line 136  SAVED_PKGDIR="${PKGDIR}"
136  PKGDIR="/var/cache/mage/tmp-packages"  PKGDIR="/var/cache/mage/tmp-packages"
137  install -d "${PKGDIR}"  install -d "${PKGDIR}"
138    
139    # clean all tmp-packages if requested
140    if [[ ${CLEAN_TMP_PACKAGES} = 1 ]]
141    then
142     echo "Cleaning tmp-packages as requested"
143     cleanpkg
144    fi
145    
146  # now install the packages (no srcinstall, when the user not explcitly want this)  # now install the packages (no srcinstall, when the user not explcitly want this)
147  fetch_packages ${INSTALL_DEPS} || die "fetching packages"  fetch_packages ${INSTALL_DEPS} || die "fetching packages"
148  md5sum_packages ${INSTALL_DEPS} || die "md5 sum packages"  md5sum_packages ${INSTALL_DEPS} || die "md5 sum packages"
 unpack_packages ${INSTALL_DEPS} || die "unpacking packages"  
149  install_packages ${INSTALL_DEPS} || die "installing packages"  install_packages ${INSTALL_DEPS} || die "installing packages"
150  cleanpkg  if [[ ${CLEANPACKAGES} = 1 ]]
151    then
152     cleanpkg
153    fi
154  # restore packages path  # restore packages path
155  PKGDIR="${SAVED_PKGDIR}"  PKGDIR="${SAVED_PKGDIR}"
156    
# Line 133  echo "running etc-update" Line 159  echo "running etc-update"
159  echo "-5" | etc-update  echo "-5" | etc-update
160    
161  # mark prerequisites as installed  # mark prerequisites as installed
162  touch ${BUILDSERVER_CACHE_DIR}/build/${PNAME}-${PVER}-${PBUILD}/INSTALLED_PREREQUISITES  touch ${BUILDSERVER_CACHE_DIR}/build/${PNAME}/${PNAME}-${PVER}-${PBUILD}/INSTALLED_PREREQUISITES

Legend:
Removed from v.2747  
changed lines
  Added in v.3113