[GRASS-dev] Re: [GRASS GIS] #1178: WinGrass: g.extension - problem with path to $GISBASE

GRASS GIS trac at osgeo.org
Sun Sep 26 11:07:01 EDT 2010


#1178: WinGrass: g.extension - problem with path to $GISBASE
---------------------------------------------------------------+------------
 Reporter:  hellik                                             |       Owner:  grass-dev@…              
     Type:  defect                                             |      Status:  new                      
 Priority:  major                                              |   Milestone:  6.4.1                    
Component:  Installation                                       |     Version:  svn-releasebranch64      
 Keywords:  wingrass, g.extension, path, installation, addons  |    Platform:  MSWindows Vista          
      Cpu:  x86-32                                             |  
---------------------------------------------------------------+------------

Comment(by hellik):

 Replying to [comment:6 glynn]:
 > Replying to [comment:3 hellik]:
 >
 > > with added -x in the first line:
 > >
 > {{{
 > Makefile:12: c:/Program: No such file or directory
 > Makefile:12: Files/GRASS-64-SVN/include/Make/Module.make: No such file
 or directory
 > }}}
 >
 > Makefiles can't handle spaces in filenames, and this is rather
 fundamental to the way make works. Spaces separate tokens, and there isn't
 any (documented) mechanism to quote spaces.
 >
 > If the variables were only used in commands, you could quote them, but
 that won't work elsewhere (e.g. "include" statements or dependencies).
 >
 > The only workaround I know is to use 8.3 names (e.g. "/c/progra~1"
 rather than "/c/Program Files"), but I don't know how to perform that
 conversion from within a script (from C, you can use GetShortPathName()).

 would a little bat-script on the windows-command-line help?

 {{{
 %~1 - expands %1 removing any surrounding quotes (")
 %~f1 - expands %1 to a fully qualified path name
 %~d1 - expands %1 to a drive letter only
 %~p1 - expands %1 to a path only
 %~n1 - expands %1 to a file name only
 %~x1 - expands %1 to a file extension only
 %~s1 - expanded path contains short names only
 %~a1 - expands %1 to file attributes
 %~t1 - expands %1 to date/time of file
 %~z1 - expands %1 to size of file
 %~$PATH:1 - searches the directories listed in the PATH environment
 variable and expands %1 to the fully qualified name of the first one
 found. If the environment variable name is not defined or the file is not
 found by the search, then this modifier expands to the empty string

 The modifiers can be combined to get compound results:

 %~dp1 - expands %1 to a drive letter and path only
 %~nx1 - expands %1 to a file name and extension only
 %~dp$PATH:1 - searches the directories listed in the PATH environment
 variable for %1 and expands to the drive letter and path of the first one
 found.
 %~ftza1 - expands %1 to a DIR like output line
 }}}


 for example param.bat:

 {{{
 @echo off
 echo %%~1     =      %~1
 echo %%~f1     =      %~f1
 echo %%~d1     =      %~d1
 echo %%~p1     =      %~p1
 echo %%~n1     =      %~n1
 echo %%~x1     =      %~x1
 echo %%~s1     =      %~s1
 echo %%~a1     =      %~a1
 echo %%~t1     =      %~t1
 echo %%~z1     =      %~z1
 echo %%~$PATHATH:1     =      %~$PATHATH:1
 echo %%~dp1     =      %~dp1
 echo %%~nx1     =      %~nx1
 echo %%~dp$PATH:1     =      %~dp$PATH:1
 echo %%~ftza1     =      %~ftza1
 }}}

 a little test with following installation path "C:\Program
 Files\GRASS-64-SVN\"

 {{{
 C:\wd>param.bat "C:\Program Files\GRASS-64-SVN\"
 %~1     =      C:\Program Files\GRASS-64-SVN\
 %~f1     =      C:\Program Files\GRASS-64-SVN\
 %~d1     =      C:
 %~p1     =      \Program Files\GRASS-64-SVN\
 %~n1     =
 %~x1     =
 %~s1     =      C:\PROGRA~1\GRASS-~2\
 %~a1     =      d----c---
 %~t1     =      25.09.2010 16:56
 %~z1     =      4096
 %~$PATHATH:1     =
 %~dp1     =      C:\Program Files\GRASS-64-SVN\
 %~nx1     =
 %~dp$PATH:1     =      C:\Program Files\GRASS-64-SVN\
 %~ftza1     =      d----c--- 25.09.2010 16:56 4096 C:\Program
 Files\GRASS-64-SVN\
 C:\wd>
 }}}

 Helmut

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1178#comment:7>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list