From 2c7031f15715af60e28766869a6551095afca72f Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Fri, 25 Nov 2016 16:35:42 +0900 Subject: [PATCH] Comparison code is added for TRBS. TRBS projects are similar to prerelease projects, so the same technique is applied to TRBS projects for unnecessary rebuilding. Change-Id: I6370473ce75caa20d2e4325c66a8c03aa643dba6 Signed-off-by: Junghyun Kim --- packaging/functions.sh | 12 +++++++++++- packaging/same-build-result.sh | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packaging/functions.sh b/packaging/functions.sh index fbb8618..89057a5 100644 --- a/packaging/functions.sh +++ b/packaging/functions.sh @@ -15,6 +15,16 @@ check_header() $RPM --qf "$QF" "$1" } +function is_prerelease_project() { + local proj_name=$1 + if [[ $proj_name =~ "prerelease" ]] || [[ $proj_name =~ "trbs" ]]; then + return 1 + fi + + return 0 +} + + # Trim version-release string: # - it is used as direntry below certain paths # - it is assigned to some variable in scripts, at the end of a line @@ -136,7 +146,7 @@ function cmp_spec () # if the rpm is from prerelease projects, do not compare project name. QF="%{DISTRIBUTION}" dist=$(check_header $newrpm | sed -r 's/(.*)\/.*/\1/') - if [[ $dist =~ "prerelease" ]]; then + if ! is_prerelease_project $dist; then echo "This is a prerelease project. Do not compare the project name." QF="%{DISTURL}\\n" echo `check_header $oldrpm | sed -r 's/.*\/(.*\/.*)/\1/'` >> $file1 diff --git a/packaging/same-build-result.sh b/packaging/same-build-result.sh index e46999f..2e879e4 100644 --- a/packaging/same-build-result.sh +++ b/packaging/same-build-result.sh @@ -33,7 +33,7 @@ fi first_rpm=$(find $NEWDIRS -name *.rpm | head -1) dist=$(rpm -qp --nodigest --nosignature --qf "%{DISTRIBUTION}" $first_rpm | sed -r 's/(.*)\/.*/\1/') prerelease=0 -if [[ $dist =~ "prerelease" ]]; then +if ! is_prerelease_project $dist; then echo "This is a prerelease project. Do not check the existence of source rpm files." prerelease=1 -- 2.7.4