Tweaked version extraction from tags.

master
Dominik Deák 4 years ago
parent ff8dd0ecb9
commit 2a52340a9d
  1. 6
      Scripts/Detail/Config.py

@ -151,15 +151,17 @@ class Configuration():
lastTag = utility.captureCommandOutput( "git describe --tags --abbrev=0" ) lastTag = utility.captureCommandOutput( "git describe --tags --abbrev=0" )
matches = re.search( "v?(\d+(?:\.\d+)+)-(\w+)", lastTag ) utility.printItem( "lastTag: ", lastTag )
matches = re.search( "v?(\d+(?:\.\d+)+)(?:-(\w+))?", lastTag )
if not matches: if not matches:
utility.printError( "Unable to extract version information from Git tags." ) utility.printError( "Unable to extract version information from Git tags." )
raise SystemExit( 1 ) raise SystemExit( 1 )
self.productVersion = matches.group( 1 ) self.productVersion = matches.group( 1 )
self.productStage = matches.group( 2 )
self.productRevision = utility.captureCommandOutput( "git rev-parse --short=8 HEAD" ) self.productRevision = utility.captureCommandOutput( "git rev-parse --short=8 HEAD" )
self.productStage = matches.group( 2 ) if matches.group( 2 ) else self.productRevision
self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower() self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower()
utility.printItem( "productVersion: ", self.productVersion ) utility.printItem( "productVersion: ", self.productVersion )

Loading…
Cancel
Save