Comparison code is added for TRBS. 66/100166/1 accepted/tizen/base/20161209.100139 submit/tizen_base/20161202.051806
authorJunghyun Kim <jh0822.kim@samsung.com>
Fri, 25 Nov 2016 07:35:42 +0000 (16:35 +0900)
committerJunghyun Kim <jh0822.kim@samsung.com>
Fri, 25 Nov 2016 07:35:42 +0000 (16:35 +0900)
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 <jh0822.kim@samsung.com>
packaging/functions.sh
packaging/same-build-result.sh

index fbb8618..89057a5 100644 (file)
@@ -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
index e46999f..2e879e4 100644 (file)
@@ -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