Skip to content

Commit

Permalink
g.extension: fix parse PGM variable from Makefile (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Dec 17, 2020
1 parent 30c3b4e commit 38247f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/g.extension/g.extension.py
Expand Up @@ -1535,15 +1535,15 @@ def install_extension_std_platforms(name, source, url, branch):
# get the module name: PGM = <module name>
with open(os.path.join(r, 'Makefile')) as fp:
for line in fp.readlines():
if "PGM" in line:
if re.match(r'PGM.*.=|PGM=', line):
try:
modulename = line.split('=')[1].strip()
if modulename:
module_list.append(modulename)
else:
grass.error(pgm_not_found_message)
grass.fatal(pgm_not_found_message)
except IndexError:
grass.error(pgm_not_found_message)
grass.fatal(pgm_not_found_message)

# change shebang from python to python3
pyfiles = []
Expand Down

0 comments on commit 38247f6

Please sign in to comment.