Magellan Linux

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

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

revision 2774 by niro, Thu Aug 28 09:08:32 2014 UTC revision 2816 by niro, Mon Sep 8 14:59:12 2014 UTC
# Line 4  die() Line 4  die()
4   exit 1   exit 1
5  }  }
6    
7    os-arch()
8    {
9     local arch="$1"
10     local os_arch
11    
12     case ${arch} in
13     i*86|x86_64) os_arch="${arch}" ;;
14     src|playground*) os_arch="$(source ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc; echo ${ARCH})";;
15     esac
16    
17     echo "${os_arch}"
18    }
19    
20  runarch-script()  runarch-script()
21  {  {
22   local arch="$1"   local arch="$1"
# Line 13  runarch-script() Line 26  runarch-script()
26    
27   # only allow the right arches   # only allow the right arches
28   case ${arch} in   case ${arch} in
29   i*86|x86_64) buildroot="${BUILDROOT}/${arch}"; os_arch="${arch}" ;;   i*86|x86_64|src|playground*) buildroot="${BUILDROOT}/${arch}"; os_arch="$(os-arch ${arch})" ;;
  src) os_arch="$(source ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/src/mage.rc; echo ${ARCH})"; buildroot="${BUILDROOT}/src" ;;  
30   *) die "unknown architecture '${arch}'" ;;   *) die "unknown architecture '${arch}'" ;;
31   esac   esac
32    
# Line 22  runarch-script() Line 34  runarch-script()
34    
35   setarch "${os_arch}" systemd-nspawn \   setarch "${os_arch}" systemd-nspawn \
36   --directory="${buildroot}" \   --directory="${buildroot}" \
37   --bind=${BUILDROOT}/tmp/mage-tree:/usr/mage \   --bind=${BUILDROOT}/mage-tree/${arch}:/usr/mage \
38   --bind=${BUILDROOT}/svn/mage/include:/usr/mage/include \   --bind=${BUILDROOT}/svn/mage/include:/usr/mage/include \
39   --bind=${BUILDROOT}/svn/mage/profiles:/usr/mage/profiles \   --bind=${BUILDROOT}/svn/mage/profiles:/usr/mage/profiles \
40   --bind=${BUILDROOT}/svn/smage:/var/cache/mage/smage \   --bind=${BUILDROOT}/svn/smage:/var/cache/mage/smage \
# Line 32  runarch-script() Line 44  runarch-script()
44   --bind=/usr/lib/mage-buildserver/helper:/usr/lib/mage-buildserver \   --bind=/usr/lib/mage-buildserver/helper:/usr/lib/mage-buildserver \
45   --bind=${BUILDROOT}/build-info/${arch}:/var/cache/mage-buildserver \   --bind=${BUILDROOT}/build-info/${arch}:/var/cache/mage-buildserver \
46   --bind=${BUILDROOT}/ssh:/root/.ssh \   --bind=${BUILDROOT}/ssh:/root/.ssh \
47     --bind=${BUILDROOT}/log/smage/${arch}:/var/log/smage \
48   bash --login "${script}" \   bash --login "${script}" \
49   || die "runarch-script '${script}' for '${arch}' failed."   || die "runarch-script '${script}' for '${arch}' failed."
50    
# Line 49  runarch() Line 62  runarch()
62    
63   # only allow the right arches   # only allow the right arches
64   case ${arch} in   case ${arch} in
65   i*86|x86_64|src) buildroot="${BUILDROOT}/${arch}"; runrc="${buildroot}/.runrc" ;;   i*86|x86_64|src|playground*) buildroot="${BUILDROOT}/${arch}"; runrc="${buildroot}/.runrc" ;;
66   *) die "unknown architecture '${arch}'" ;;   *) die "unknown architecture '${arch}'" ;;
67   esac   esac
68    
69   # create runrc   # create runrc
70   echo "${cmd}" > "${runrc}"   echo "${cmd}" > "${runrc}"
71   runarch-script "${arch}" .runrc || die "runarch script execition of '${runrc}' failed."   runarch-script "${arch}" .runrc || die "runarch script execution of '${runrc}' failed."
72    
73   if [ -f "${runrc}" ]   if [ -f "${runrc}" ]
74   then   then
# Line 79  runarch-pkg-install() Line 92  runarch-pkg-install()
92   # never fail   # never fail
93   return 0   return 0
94  }  }
95    
96    enum-build-arch-types()
97    {
98     echo "${BUILD_ARCH[*]}"
99    }
100    
101    enum-all-arch-types()
102    {
103     local arch
104     local build_arch_types
105    
106     for arch in src ${BUILD_ARCH[*]}
107     do
108     if [ ! -e ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc ]
109     then
110     echo "Warning: mage.rc of '${arch}' not found. Arch '${arch}' ignored." >&2
111     else
112     build_arch_types+=( "${arch}" )
113     fi
114     done
115    
116     if [[ ${BUILD_PLAYGROUND} -eq 1 ]]
117     then
118     for arch in ${BUILD_ARCH[*]}
119     do
120     if [ ! -e ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/playground-${arch}/mage.rc ]
121     then
122     echo "Warning: mage.rc of 'playground-${arch}' not found. Arch 'playground-${arch}' ignored." >&2
123     else
124     build_arch_types+=( "playground-${arch}" )
125     fi
126     done
127     fi
128    
129     echo "${build_arch_types[*]}"
130    }

Legend:
Removed from v.2774  
changed lines
  Added in v.2816