summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-10-22 08:59:56 +0200
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-10-22 09:01:23 +0200
commit474f5268038b59df59fd916559d94da3597cd070 (patch)
tree94786844fbff6307ecafa361586fcdbdbe98da94
parent5b97b9e056d077ca38bf32ef3db2799a04926955 (diff)
downloadtizen-474f5268038b59df59fd916559d94da3597cd070.tar.gz
tizen-474f5268038b59df59fd916559d94da3597cd070.tar.bz2
tizen-474f5268038b59df59fd916559d94da3597cd070.zip
Add package version in recipes
Bug-Tizen: BTY-55 Change-Id: Ied4a9f672012907c68fb0b1d06a74f774ce84652 Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
-rwxr-xr-xtools/spec2yocto.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/spec2yocto.py b/tools/spec2yocto.py
index 16497fa4a..62f70ab6f 100755
--- a/tools/spec2yocto.py
+++ b/tools/spec2yocto.py
@@ -502,6 +502,7 @@ class RePattern:
patternUrl = r'^Url:\s*(.*)'
patternGroup = r'^Group:\s*(.*)'
patternLicense = r'^License:\s*(.*)'
+ patternVersion = r'^Version:\s*(.*)'
patternFiles = r'^%files\s*(.*)'
@@ -1118,6 +1119,17 @@ Group: devel
return res_license
return ""
+
+ def get_version(self):
+ '''
+ Return the version of the package.
+ '''
+ for line in self.__spect_dico[self.__introduction_section] :
+ description = re.findall(RePattern.patternVersion, line)
+ if len( description ) > 0:
+ return description[0]
+ return ""
+
def get_section_key(self, __flag):
'''
Return the list of "__flag" sections of the spec file.
@@ -1510,6 +1522,7 @@ class MetaSpec:
_section = self.__spec_parser.get_section()
_priority = "10"
_license = self.__spec_parser.get_license()
+ _version = self.__spec_parser.get_version()
file_d.write( "DESCRIPTION = \"%s\"\n" % _description )
if len( _homepage ) < 2:
@@ -1518,6 +1531,7 @@ class MetaSpec:
file_d.write( "SECTION = \"%s\"\n" % _section )
file_d.write( "LICENSE = \"%s\"\n" % _license )
+ file_d.write( "PV = \"%s\"\n" % _version )
file_d.write( "\n" )
file_d.write( "SRC_URI = \"\"\n" )
file_d.write( "\n" )