Limit grep operation to what's relevant and avoid accidental matches

Signed-off-by: Oliver Bock <oliver.bock@aei.mpg.de>
This commit is contained in:
Bernd Machenschalk 2012-11-14 15:25:21 +00:00 committed by Oliver Bock
parent 17ea7a1a63
commit 7a35b69c64
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ def xlistdir(dir):
def get_api_version(exec_file):
tmpfile = '.uvtemp'
cmd = "strings %s | grep API_VERSION > %s"%(exec_file, tmpfile)
cmd = "strings %s | egrep '^API_VERSION_[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' > %s"%(exec_file, tmpfile)
os.system(cmd)
f = open(tmpfile, 'r')
if (f):