Do not compare the project name for prerelease projects. 43/82643/1 accepted/tizen/base/20160805.171156 submit/tizen_base/20160805.051525
authorJunghyun Kim <jh0822.kim@samsung.com>
Thu, 4 Aug 2016 22:44:20 +0000 (07:44 +0900)
committerJunghyun Kim <jh0822.kim@samsung.com>
Thu, 4 Aug 2016 22:44:20 +0000 (07:44 +0900)
If the project name includes "prerelease", do not compare DISTRIBUTION in rpmtags.

Change-Id: I77a344093aab89bddebf4a3041a59237205cf2f5
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
packaging/functions.sh

index a46c384..fbb8618 100644 (file)
@@ -109,7 +109,7 @@ function cmp_spec ()
     # don't look at RELEASE, it contains our build number
     QF="$QF %{VERSION} %{EPOCH}\\n"
     QF="$QF %{SUMMARY}\\n%{DESCRIPTION}\\n"
-    QF="$QF %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
+    QF="$QF %{VENDOR}\\n"
     QF="$QF %{LICENSE} %{LICENSE}\\n"
     QF="$QF %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
     QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
@@ -131,6 +131,23 @@ function cmp_spec ()
     
     check_header $oldrpm > $file1
     check_header $newrpm > $file2
+
+    if [ -n $newrpm ]; then
+      # 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
+        echo "This is a prerelease project. Do not compare the project name."
+        QF="%{DISTURL}\\n"
+        echo `check_header $oldrpm | sed -r 's/.*\/(.*\/.*)/\1/'` >> $file1
+        echo `check_header $newrpm | sed -r 's/.*\/(.*\/.*)/\1/'` >> $file2
+      else
+        QF="%{DISTURL} %{DISTRIBUTION}\\n"
+        echo "This is not a prerelease project. Compare the project name."
+        check_header $oldrpm >> $file1
+        check_header $newrpm >> $file2
+      fi
+    fi
     
     # the DISTURL tag can be used as checkin ID
     #echo "$QF"