Skip to content

Commit

Permalink
Do not require dev pkg to be installed for path
Browse files Browse the repository at this point in the history
grass --config path as well as version and svn_revision
don't need any dev files, so we no longer require them.
This minimizes what is needed for simple GRASS startup
from Python.

Note that revision is broken due to Subversion to Git migration.
  • Loading branch information
wenzeslaus committed Jul 25, 2019
1 parent d1e8367 commit bfdb74d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/init/grass.py
Expand Up @@ -1810,17 +1810,21 @@ def grep(pattern, lines):

def print_params():
"""Write compile flags and other configuration to stderr"""
plat = gpath('include', 'Make', 'Platform.make')
if not os.path.exists(plat):
fatal(_("Please install the GRASS GIS development package"))
fileplat = open(plat)
linesplat = fileplat.readlines()
fileplat.close()

params = sys.argv[2:]
if not params:
params = ['arch', 'build', 'compiler', 'path', 'revision', 'version']

# check if we are dealing with parameters which require dev files
dev_params = ["arch", "compiler", "build", "revision"]
if any([param in dev_params for param in params]):
plat = gpath('include', 'Make', 'Platform.make')
if not os.path.exists(plat):
fatal(_("Please install the GRASS GIS development package"))
fileplat = open(plat)
# this is in fact require only for some, but prepare it anyway
linesplat = fileplat.readlines()
fileplat.close()

for arg in params:
if arg == 'path':
sys.stdout.write("%s\n" % GISBASE)
Expand Down

0 comments on commit bfdb74d

Please sign in to comment.