[GRASS-dev] Re: [GRASS GIS] #595: WinGRASS g.version -c fails
GRASS GIS
trac at osgeo.org
Thu Oct 1 22:30:37 EDT 2009
#595: WinGRASS g.version -c fails
---------------------------+------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: License | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass gpl
Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by hamish):
> When Makefile runs:
{{{
cat ./../../COPYING | sed -f sed.script | tr -d '\012' > /src/dev_6/dist.
i686-pc-mingw32/etc/VERSION
sed: file sed.script line 1: Unknown option to 's'
}}}
(sed.script contains {{{ s/.*$/&\\n/g }}})
so what is this Makefile line doing exactly?
- It's copying the COPYING file into the $GISBASE/etc/VERSION file
- it's terminating each line with a literal '\n'
- it's removing all actual newline chars from the file.
So this is getting the file ready to be a string embedded in the C code.
The g.version Makefile has it with comments:
{{{
# cat the COPYING file, add a c line-break \n at each line end
# and remove the unix newline.
COPYING=`cat ./../../COPYING | sed -f sed.script | tr -d '\012'`
...
EXTRA_CFLAGS=-DVERSION_NUMBER=\"'$(VERSION_NUMBER)'\"
-DVERSION_DATE=\"'$(VERSION_DATE)'\"
-DVERSION_UPDATE_PKG=\"'$(VERSION_UPDATE_PKG)'\"
-DCOPYING="\"$(COPYING)\""
...
COPYING:
cat ./../../COPYING | sed -f sed.script | tr -d '\012' >
$(GRASS_VERSION_FILE)
GRASS_CONFIGURE_PARAMS:
head -n 7 ./../../config.status | tail -n 1 | sed 's+#++1' | tr -d
'\012' > $(GRASS_BUILD_FILE)
}}}
On linux 'strings' shows the COPYING text within the binary, from the
native WinGrass Msys prompt it doesn't.
{{{
strings `which g.version`
}}}
so the COPYING: ... > VERSION make rule could be simplified into a
straight cp?
interestingly the build info string does make it into the WinGrass binary
and the $GISBASE/etc/BUILD file also has the correct content in it.
??,
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/595#comment:5>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list