+
+def lilypond_version (binary):
+ p = read_pipe ('%s --version ' % binary)
+
+ ls = p.split ('\n')
+ v= '<not found>'
+ for l in ls:
+ m = re.search ('GNU LilyPond ([0-9a-z.]+)', p)
+ if m:
+ v = m.group (1)
+
+ return v
+
+def lilypond_version_check (binary, req):
+ if req[0] <> '@' :
+ v = lilypond_version (binary)
+ if v <> req:
+ error (_("Binary %s has version %s, looking for version %s") % \
+ (binary, v, req))
+ sys.exit (1)
+