From 0f12d123687ea53539f35ea20177b5f35d02a6af Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Mon, 15 Sep 2014 14:01:47 +0300 Subject: [PATCH] Allow OBS build without explicit version tag MCE has version information recorded in several files. To keep these in sync, there is a script that will cause rpm builds to fail unless all of the places have the same version. While this is good for making sure releases do not end up using out of sync version numbers, it also makes it impossible to build mce in OBS without creating explicit version tag. Relax the version checking for spec file so that versions constructed from matching version + extra git hash identification are also accepted. --- verify_version | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/verify_version b/verify_version index f58b4624..33dea569 100755 --- a/verify_version +++ b/verify_version @@ -11,6 +11,15 @@ DEB_VERS=$(head -1 $DEB_PATH | sed -e 's/^.*(//' -e 's/).*$//') RPM_PATH=${RPM_SOURCE_DIR:-rpm}/${RPM_PACKAGE_NAME:-mce}.spec RPM_VERS=$(grep '^Version:' $RPM_PATH |sed -e 's/^.*:[[:space:]]*//') +# Remove initial part of rpm version that equals with version from Makefile +RPM_XTRA=${RPM_VERS#$MAK_VERS} +# From that remove initial part that equals with version from spec-file +RPM_XTRA=${RPM_XTRA#$RPM_VERS} +# If the result is non-empty string, then OBS is doing +# delta-after-matching-tag kind of build, which is ok. +# But empty string means that spec and Makefile are completely +# out of sync, which is bad. + RES=0 if [ "$DEB_VERS" != "$MAK_VERS" ]; then @@ -19,8 +28,12 @@ if [ "$DEB_VERS" != "$MAK_VERS" ]; then fi if [ "$RPM_VERS" != "$MAK_VERS" ]; then - echo >&2 "$MAK_PATH $MAK_VERS vs $RPM_PATH $RPM_VERS" - RES=1 + if [ -z "$RPM_XTRA" ]; then + echo >&2 "$MAK_PATH $MAK_VERS vs $RPM_PATH $RPM_VERS" + RES=1 + else + echo "(ignoring patch level in spec file: $RPM_XTRA)" + fi fi if [ $RES != 0 ]; then