#!/bin/bash # # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # # Build first src.rpms, then rpms, from source, or from a downloaded tarball # or src.rpm plus our additional patches. # # This program is a wrapper around build-pkgs-parallel and build-pkgs-serial # BUILD_PKGS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )" usage () { echo "" echo "Usage: " echo " Create source and binary rpms:" echo " build-pkgs [--serial] [args]" } SERIAL_FLAG=0 RC=0 for arg in "$@"; do case "$1" in --serial) SERIAL_FLAG=1 ;; esac done which mock_tmpfs_umount >> /dev/null if [ $? -ne 0 ]; then SERIAL_FLAG=1 fi # Make sure we have a dependency cache DEP_CACHE="$MY_REPO/cgcs-tis-repo/dependancy-cache" if [ ! -d $DEP_CACHE ]; then echo "Dependency cache is missing. Creating it now." $BUILD_PKGS_DIR/create_dependancy_cache.py > $MY_WORKSPACE/create_dependancy_cache.log echo "Dependency cache created." echo "" fi if [ $SERIAL_FLAG -eq 1 ]; then echo "build-pkgs-serial $@" build-pkgs-serial "$@" RC=$? else echo "build-pkgs-parallel $@" build-pkgs-parallel "$@" RC=$? fi exit $RC