[GRASS-SVN] r49708 - grass/branches/develbranch_6/gui/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 13 07:16:43 EST 2011
Author: martinl
Date: 2011-12-13 04:16:43 -0800 (Tue, 13 Dec 2011)
New Revision: 49708
Modified:
grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
g.extension: move also scripts to the main dir + fix script path in the bat-file
Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py 2011-12-13 11:35:28 UTC (rev 49707)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py 2011-12-13 12:16:43 UTC (rev 49708)
@@ -95,6 +95,7 @@
import zipfile
import tempfile
import shutil
+import fileinput
from urllib2 import urlopen, HTTPError
@@ -422,14 +423,18 @@
if os.path.exists(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_BIN):
shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_BIN,
os.path.join(options['prefix'], options['extension']) + EXT_BIN)
- if sys.platform == 'win32':
- if os.path.exists(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT):
- shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT,
- os.path.join(options['prefix'], options['extension']) + EXT_SCT)
- else:
- if os.path.exists(os.path.join(options['prefix'], 'scripts', options['extension'])):
- shutil.move(os.path.join(options['prefix'], 'scripts', options['extension']),
- os.path.join(options['prefix'], options['extension']))
+ if os.path.exists(os.path.join(options['prefix'], 'scripts', options['extension'])):
+ shutil.move(os.path.join(options['prefix'], 'scripts', options['extension']),
+ os.path.join(options['prefix'], options['extension']))
+ if sys.platform == 'win32' and \
+ os.path.exists(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT):
+ shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT,
+ os.path.join(options['prefix'], options['extension']) + EXT_SCT)
+ # fix script path
+ for line in fileinput.FileInput(os.path.join(options['prefix'], options['extension']) + EXT_SCT,
+ inplace = True):
+ line = line.replace("%GISBASE%/scripts", "%GRASS_ADDON_PATH%")
+ print line
# move man/ into docs/
if os.path.exists(os.path.join(options['prefix'], 'man', 'man1', options['extension'] + '.1')):
More information about the grass-commit
mailing list