diff options
author | jstebbins <[email protected]> | 2014-01-27 23:14:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-01-27 23:14:59 +0000 |
commit | bb11d6a3e708a6208b09cdd79bf34e43b4c6d6ea (patch) | |
tree | 2927a75d2cee7d3aef0f9085822b95247c0fa825 /make | |
parent | 3a5019a7ed8cc7eb68be713aabf1ad676d080fbf (diff) |
build: add parsing of version info from version.txt file
This makes it possible to have proper version numbers in the build
when the source tree does not come from svn (e.g. a tarball).
Also, automatically adds version.txt to our source tar that is
created with "make pkg.create".
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6005 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make')
-rw-r--r-- | make/configure.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/make/configure.py b/make/configure.py index 7cf99ca2e..22bdce59f 100644 --- a/make/configure.py +++ b/make/configure.py @@ -247,6 +247,7 @@ class Action( object ): self._dumpSession( cfg.infof ) cfg.errln( 'unable to continue' ) self._dumpSession( cfg.verbosef ) + self._failSession() else: cfg.infof( '(%s) %s\n', self.msg_pass, self.msg_end ) self._dumpSession( cfg.verbosef ) @@ -261,6 +262,9 @@ class Action( object ): def _parseSession( self ): pass + def _failSession( self ): + pass + def run( self ): if self.run_done: return @@ -743,6 +747,30 @@ class RepoProbe( ShellProbe ): self.msg_end = self.url + def _failSession( self ): + # Look for svn info in version file. + # + # Version file would be created manually by source packager. + # e.g. + # $ svn info HandBrake > HandBrake/version.txt + # $ tar -czf handbrake-source.tgz --exclude .svn HandBrake + cfg.infof( 'probe: version.txt...' ) + try: + hvp = os.path.join( cfg.src_dir, 'version.txt' ) + if os.path.isfile( hvp ) and os.path.getsize( hvp ) > 0: + file = open( hvp, 'r' ) + self.session = file.readlines() + file.close() + if self.session: + self._parseSession() + if self.rev != 0: + cfg.infof( '(pass)\n' ) + else: + cfg.infof( '(fail)\n' ) + + except: + cfg.infof( '(fail)\n' ) + ############################################################################### ## ## project object. |