Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

#!/bin/bash
BLD_PARALLEL="4"
WORKSPACE=/export/home/admin/du2
#STOP_ON_ERROR=1
STOP_ON_ERROR=0
#GCC_COMPILER="gcc-6"
GCC_COMPILER=""

# Build a component: $1 - component name, $2 - stop-on-error flag
function build_component {
  BLD_RESULT="/data/repo/du/$1"
  test -z "$1" && exit 1
  test -d ${BLD_RESULT} && rm -rf ${BLD_RESULT}
  DEB_BUILD_OPTIONS="nocheck notest parallel=${BLD_PARALLEL}"
  export DEB_BUILD_OPTIONS
  test -d ${WORKSPACE}/$1 && rm -rf ${WORKSPACE}/$1
  mkdir -p ${WORKSPACE}/$1
  cd ${WORKSPACE}/$1
  echo "====================== $1 ======================"  | tee berror.log
  if [[ $2 -eq 0 ]]; then
    apt-get build-dep -y $1 >> berror.log || return 0 2>&1
    apt-get source --compile $1 >> berror.log || return 0 2>&1
  else
    apt-get build-dep -y $1 >> berror.log || return 1 2>&1
    apt-get source --compile $1 >> berror.log || return 1 2>&1
  fi
  mkdir -p ${BLD_RESULT}
  cp -ax *.deb ${BLD_RESULT}/ || exit 1
  cp -ax *.changes ${BLD_RESULT}/ || exit 1
  cp -ax *.buildinfo ${BLD_RESULT}/ || exit 1

}

if [[ "$GCC_COMPILER" != "" ]]; then
  echo "====================== Building GCC ======================"
  build_component $GCC_COMPILER 1
  if [[ $? -eq 1 ]]; then
    exit 1
  fi
  dpkg -i $WORKSPACE/$GCC_COMPILER/*.deb
fi

while read COMP; do
  if [[ "" == "$COMP" ]] || [[ "$GCC_COMPILER" == "$COMP" ]]; then
    continue
  fi
  build_component $COMP $STOP_ON_ERROR
  if [[ $? -eq 1 ]]; then
    exit 1
  fi
done < /data/repo/pkg/list_component
  • No labels