X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fauxiliar%2Ffixcc.py;h=0ecbf8cd6a698c2e9aed2c43099730f1d156715a;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=4449a45b47fb07e1dac29afba3b916f14c5798c2;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/scripts/auxiliar/fixcc.py b/scripts/auxiliar/fixcc.py index 4449a45b47..0ecbf8cd6a 100755 --- a/scripts/auxiliar/fixcc.py +++ b/scripts/auxiliar/fixcc.py @@ -31,6 +31,7 @@ import re import string import sys import time +import subprocess COMMENT = 'COMMENT' STRING = 'STRING' @@ -38,6 +39,8 @@ GLOBAL_CXX = 'GC++' CXX = 'C++' verbose_p = 0 indent_p = 1 +REQUIRED_ASTYLE_VERSION = "Artistic Style Version 2.02" + rules = { GLOBAL_CXX: @@ -392,6 +395,14 @@ def do_options (): sys.exit (2) return files +def check_astyle_version(): + cmd = "astyle --version" + process = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + stdout, stderr = process.communicate() + if REQUIRED_ASTYLE_VERSION in stderr: + return True + return False + outdir = 0 format = CXX @@ -399,6 +410,10 @@ socketdir = '/tmp/fixcc' socketname = 'fixcc%d' % os.getpid () def main (): + if not check_astyle_version(): + print "Error: we require %s" % REQUIRED_ASTYLE_VERSION + print "Sorry, no higher (or lower) versions allowed" + sys.exit(1) files = do_options () if outdir and not os.path.isdir (outdir): os.makedirs (outdir) @@ -435,7 +450,7 @@ typedef struct _t_ligature typedef std::map < AFM_Ligature const *, int > Bar; /** - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys */ /* || @@ -474,7 +489,7 @@ i while (foe); squiggle. extent; - 1 && * unsmob_moment (lf); + 1 && * Moment::unsmob (lf); line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->*self_scm (): SCM_EOL); case foo: k;