Skip to content

Commit

Permalink
Merge pull request #44 from yast/rpm_version_fix
Browse files Browse the repository at this point in the history
Rpm version fix - revert using `rpm` for parsing
  • Loading branch information
lslezak committed Dec 11, 2013
2 parents b80210a + 25c25c4 commit 7d8e8ac
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build-tools/Makefile.am.toplevel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Y2TOOL = $(Y2DEVTOOLS_PREFIX)/bin/y2tool

RPMNAME = $(shell cat $(srcdir)/RPMNAME)
VERSION = $(shell rpm --specfile --qf "%{VERSION}" $(srcdir)/package/$(RPMNAME).spec)
VERSION = $(shell grep '^[[:space:]]*Version:' $(srcdir)/package/$(RPMNAME).spec | sed -e 's/Version:[[:space:]]*\([[:print:]]\+\)/\1/')
SUBDIRS_FILE = $(shell test -e $(srcdir)/SUBDIRS && echo SUBDIRS)
ACINCLUDE_FILE = $(shell test -e $(srcdir)/acinclude.m4 && echo acinclude.m4)

Expand Down
3 changes: 2 additions & 1 deletion build-tools/cmake/modules/YastCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ ENDIF (NOT DEFINED RPMNAME)

MESSAGE(STATUS "package name set to '${RPMNAME}'")
file (GLOB spec_files "package/*.spec")
execute_process(COMMAND "rpm" "--specfile" "--qf" "%{VERSION}" ${spec_files}
execute_process(COMMAND "grep" "^[[:space:]]*Version:" ${spec_files}
COMMAND "sed" "-e" "s/Version:[[:space:]]*\\([[:print:]]\\+\\)/\\1/"
OUTPUT_VARIABLE VERSION)
message(STATUS "Version: ${VERSION}")

Expand Down
3 changes: 1 addition & 2 deletions build-tools/scripts/y2autoconf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ if ($#ARGV >= 0 && ($ARGV[0] eq "-h" || $ARGV[0] eq "--help"))
$RPMNAME = `cat RPMNAME`;
chomp $RPMNAME;

# the query is different from other places, need to escape %
$VERSION = `rpm --specfile --qf "\%{VERSION}" package/$RPMNAME.spec`;
$VERSION = `grep '^[[:space:]]*Version:' package/$RPMNAME.spec | sed -e 's/Version:[[:space:]]*\([[:print:]]\+\)/\1/'`;
chomp $VERSION;

$MAINTAINER = `cat MAINTAINER`;
Expand Down
8 changes: 8 additions & 0 deletions package/yast2-devtools.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Dec 11 14:32:06 UTC 2013 - lslezak@suse.cz

- use grep/sed instead of rpm for parsing spec files (rpm prints
the version for each subpackage, moreover it does some dependecy
resolving which might fail)
- 3.1.11

-------------------------------------------------------------------
Mon Dec 9 12:58:21 UTC 2013 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-devtools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-devtools
Version: 3.1.10
Version: 3.1.11
Release: 0
Url: http://github.com/yast/yast-devtools

Expand Down
2 changes: 1 addition & 1 deletion ytools/y2tool/tagversion
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ while true; do
done

p=`cat RPMNAME`
v=`rpm --specfile --qf "%{VERSION}" package/$p.spec | tr "." "_"`
v=`grep '^[[:space:]]*Version:' package/$p.spec | sed -e 's/Version:[[:space:]]*\([[:print:]]\+\)/\1/' | tr "." "_"`
if [ -z "$p" -o -z "$v" ]; then
echo "Cannot find RPMNAME or Version value in package/$p.spec in `pwd`"
exit 1
Expand Down

0 comments on commit 7d8e8ac

Please sign in to comment.