
Problem: In the absence of a dependency cache, build-pkgs has not information on which packages should be built first. All it can do is try to build each package in a arbitrary order. If the build fails, it is set aside and will be retired on the next iteration. Builds fail when a BuildRequired package can't be found, because it hasn't been built yet. This was not an issue when cgcs-tis-repo, the home of the cache, was stored in a git. Solution: Have build-pkgs invoke create_dependancy_cache.py if the cache is not present. Note: We only run this automatically once. If the user is adding packages, or modifying the BuildRequires or Requires of an existing package, they should re-run create_dependancy_cache.py manually. Change-Id: Id63e42903d9c0884470a990fb62fe1bafacd1849 Story: 2002835 Task: 24519 Signed-off-by: Scott Little <scott.little@windriver.com>
52 lines
1.0 KiB
Bash
Executable File
52 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Copyright (c) 2018 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
#
|
|
# 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
|
|
|
|
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 "$@"
|
|
else
|
|
echo "build-pkgs-parallel $@"
|
|
build-pkgs-parallel "$@"
|
|
fi
|
|
|