Opened 15 years ago
Closed 15 years ago
#887 closed defect (fixed)
db.describe fails if $GISBASE contains a space
Reported by: | hamish | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 6.5.0 |
Component: | Database | Version: | svn-releasebranch64 |
Keywords: | spaces | Cc: | |
CPU: | x86-64 | Platform: | Linux |
Description
Hi,
If I move "dist.x86_64-unknown-linux-gnu/" to "dist.x86_64-unknown-linux gnu/" (and edit ./bin.$ARCH/grass65), db.describe fails:
g.copy roads,roads2 db.describe roads2 D2/5: dbDbmscap(): opendir [/usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux gnu/driver/db/] D2/5: dbDbmscap(): opendir [/usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux gnu/driver/db/] sh: /usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux: No such file or directory dbmi: Protocol error ERROR: Unable to start driver <dbf>
near EOF of lib/db/dbmi_client/start.c:
execl("/bin/sh", "sh", "-c", startup, NULL);
The startup string is set correctly; I guess execl() wants to see quotes in the string itself?
n.b. all programs in $GISBASE/driver/db/ are ELF binaries, so is sh really needed at all? why not just run them directly?
Hamish
ps- building GRASS in a dir with spaces seems impossible because Autoconf2.13 expansion code does not always quote $srcdir.
(unless we run a second sed script after autoconf2.13 to run around the resulting configure
file and quote variables as needed* -- but not all variables, e.g. $pwd can expand to "pwd -W".
Attachments (1)
Change History (5)
comment:1 by , 15 years ago
follow-up: 3 comment:2 by , 15 years ago
Is the attached change a 6.4 candidate?
Markus
PS: The spaces-in-path at compile time is discussed in #682
comment:3 by , 15 years ago
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r41132 (6.4). In 6.5 and 7 it was already done.
Replying to hamish:
execl() doesn't care; it's "sh" which wants the quotes.
Why not, indeed ;) IOW:
Hmm. The __MINGW32 version uses _spawnl(). I'm not sure whether this is an issue. The documentation says that arguments must be quoted, but I don't think that applies to the program.
Actually ... maybe we should just replace the bulk of db_start_driver() with G_spawn_ex(). Redirection (including to/from pipes) should work on Windows now.
Forbidding spaces at compile time isn't a problem, and is probably inevitable. FWIW, I just use "/c/progra~1/..." for packages (e.g. !GnuWin32) which are installed there (although apparently it's possible to disable generation of 8.3 filenames).