From de12eed9d1e77196521142d207160409e83f82a4 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Wed, 27 Jun 2018 16:01:27 -0400 Subject: [PATCH] Support PATCHES_BASE, GIT_BASE, STX_BASE in build_srpm.data Define PATCHES_BASE, GIT_BASE and STX_BASE within the build tools, so that the can be refereced within build_srpm.data files. STX_BASE: Synonym for i$CGCS_BASE. CGCS_BASE will be obsoleted in a future update. GIT_BASE: New, points to the root of the git that contains the package. This will facilitate inter-package references that are co-located in the same git. PATCHES_BASE: New, same as $PKG_BASE/$DISTRO/patches Change-Id: I0636bb38b347374fa5ffe03ea67fd9d3422e2eea Signed-off-by: Scott Little --- build-tools/build-srpms-parallel | 6 +++++- build-tools/build-srpms-serial | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build-tools/build-srpms-parallel b/build-tools/build-srpms-parallel index 20f08662..1b6f8c6a 100755 --- a/build-tools/build-srpms-parallel +++ b/build-tools/build-srpms-parallel @@ -19,6 +19,7 @@ DEFAULT_SRPM_SCRIPT="$DIR/default_$SRPM_SCRIPT" SCRIPT_PATH="$DISTRO" DATA_PATH="$DISTRO" FILES_PATH="$DISTRO/files" +PATCHES_PATH="$DISTRO/patches" ORIG_SPECS_PATH="$DISTRO" SRPM_LIST_PATH="$DISTRO/srpm_path" MIRROR_ROOT="$MY_REPO/cgcs-centos-repo" @@ -222,8 +223,10 @@ fi export CCACHE_DIR="$BUILD_ROOT/.ccache" export SRC_BASE="$SRC_ROOT" export CGCS_BASE="$SRC_BASE/addons/wr-cgcs/layers/cgcs" +export STX_BASE="$CGCS_BASE" export SPECS_BASE="$ORIG_SPECS_PATH" export FILES_BASE="$FILES_PATH" +export PATCHES_BASE="$PATCHES_PATH" export BUILD_BASE="$BUILD_ROOT" BUILD_INPUTS="$BUILD_BASE/inputs" @@ -1194,8 +1197,9 @@ if [ "x$LOG_DIR" == "x" ]; then echo "failed to create temporary directory" exit 1; fi -for g in $(find $SRC_BASE -type d -name .git | sort -V); do +for g in $(find "$SRC_BASE" -type d -name .git | sort -V); do GIT_ROOT=$(dirname $g) + export GIT_BASE="$GIT_ROOT" if [ $STOP_SCHEDULING -eq 1 ]; then break; fi diff --git a/build-tools/build-srpms-serial b/build-tools/build-srpms-serial index d86d0e4d..0876ba5c 100755 --- a/build-tools/build-srpms-serial +++ b/build-tools/build-srpms-serial @@ -18,7 +18,7 @@ DEFAULT_SRPM_SCRIPT="$DIR/default_$SRPM_SCRIPT" SCRIPT_PATH="$DISTRO" DATA_PATH="$DISTRO" FILES_PATH="$DISTRO/files" -# ORIG_SPECS_PATH="$DISTRO/rpmbuild/SPECS" +PATCHES_PATH="$DISTRO/patches" ORIG_SPECS_PATH="$DISTRO" SRPM_LIST_PATH="$DISTRO/srpm_path" MIRROR_ROOT="$MY_REPO/cgcs-centos-repo" @@ -209,8 +209,10 @@ fi export CCACHE_DIR="$BUILD_ROOT/.ccache" export SRC_BASE="$SRC_ROOT" export CGCS_BASE="$SRC_BASE/addons/wr-cgcs/layers/cgcs" +export STX_BASE="$CGCS_BASE" export SPECS_BASE="$ORIG_SPECS_PATH" export FILES_BASE="$FILES_PATH" +export PATCHES_BASE="$PATCHES_PATH" export BUILD_BASE="$BUILD_ROOT" BUILD_INPUTS="$BUILD_BASE/inputs" @@ -995,8 +997,9 @@ if [ $EDIT_FLAG -eq 0 ]; then fi fi -for g in `find $SRC_BASE -type d -name .git | sort -V`; do +for g in `find "$SRC_BASE" -type d -name .git | sort -V`; do GIT_ROOT=$(dirname $g) + export GIT_BASE="$GIT_ROOT" for p in $(cat $GIT_ROOT/$PKG_DIRS_FILE 2>> /dev/null); do src_dir="$GIT_ROOT/$p" if [ -d $src_dir ]; then