Revision: 1168 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1168&view=re... Author: frlan Date: 2010-03-15 14:20:29 +0000 (Mon, 15 Mar 2010)
Log Message: ----------- GeanyLaTeX: Backport a change from geany-plugins to better detect git/svn on waf
Modified Paths: -------------- trunk/geanylatex/wscript
Modified: trunk/geanylatex/wscript =================================================================== --- trunk/geanylatex/wscript 2010-03-15 14:08:47 UTC (rev 1167) +++ trunk/geanylatex/wscript 2010-03-15 14:20:29 UTC (rev 1168) @@ -88,17 +88,25 @@ 'src/bibtex.c','src/geanylatex.c','src/latexstructure.c', 'src/bibtexlabels.c','src/latexencodings.c','src/latexutils.c', 'src/formatpatterns.c','src/latexenvironments.c','src/letters.c', - 'src/formatutils.c','src/latexkeybindings.c','src/reftex.c', + 'src/formatutils.c','src/latexkeybindings.c','src/reftex.c', 'src/templates.c']
def configure(conf): + def in_git(): + cmd = 'git ls-files >/dev/null 2>&1' + return (Utils.exec_command(cmd) == 0) + + def in_svn(): + return os.path.exists('.svn') + def conf_get_svn_rev(): # try GIT - if os.path.exists('.git'): + if in_git(): cmds = [ 'git svn find-rev HEAD 2>/dev/null', 'git svn find-rev origin/trunk 2>/dev/null', 'git svn find-rev trunk 2>/dev/null', - 'git svn find-rev master 2>/dev/null' ] + 'git svn find-rev master 2>/dev/null' + ] for c in cmds: try: stdout = Utils.cmd_output(c) @@ -106,12 +114,12 @@ return stdout.strip() except: pass - # try SVN - elif os.path.exists('.svn'): + # check for svn + elif in_svn(): try: _env = None if is_win32 else {'LANG' : 'C'} stdout = Utils.cmd_output(cmd='svn info --non-interactive', - silent=True, env=_env) + silent=True, env=_env) lines = stdout.splitlines(True) for line in lines: if line.startswith('Last Changed Rev'):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.