[GRASS-dev] v.line.center port to G7

Hi,

As I’d like to use the v.line.center add-on also in G7, I though about porting

the tool. I think there are just minor changes needed to adapt the parameter names
of the used modules v.to.db and v.segment to the newer G7.

The add-on is a shell script. The folder of the tool contains a Makefile and the html description.

The make file contains:

MODULE_TOPDIR = …/…

PGM = v.line.center

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script

The Makefile in the /scripts folder has also been adapted and the v.line.center subdir has
been added. However when I try to run make I get following error:

GRASS GIS 7.0.svn 56779M compilation log

Started compilation: Wed Jun 19 09:51:21 CEST 2013

Errors in:
/usr/local/src/grass7_trunk/scripts/v.line.center

In case of errors please change into the directory with error and run ‘make’.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.

Finished compilation: Wed Jun 19 09:51:38 CEST 2013
make: *** [default] Error 1
radinger@grassgis:/usr/local/src/grass7_trunk$ cd /usr/local/src/grass7_trunk/scripts/v.line.center/
radinger@grassgis:/usr/local/src/grass7_trunk/scripts/v.line.center$ make
make: *** No rule to make target /usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/scripts/v.line.center', needed by script’. Stop.

As I could not find any other shell script in that folder I am not sure if the problem is the shell script in general? Attached the slightly adapted script (v.to.db, v.segment).

/Johannes

(attachments)

v.line.center (3.18 KB)

On 19 June 2013 10:37, Johannes Radinger <johannesradinger@gmail.com> wrote:

Hi,

Hi

As I'd like to use the v.line.center add-on also in G7, I though about
porting
the tool. I think there are just minor changes needed to adapt the parameter
names
of the used modules v.to.db and v.segment to the newer G7.

The add-on is a shell script. The folder of the tool contains a Makefile and
the html description.
The make file contains:

MODULE_TOPDIR = ../..

PGM = v.line.center

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script

The Makefile in the /scripts folder has also been adapted and the
v.line.center subdir has
been added. However when I try to run make I get following error:

GRASS GIS 7.0.svn 56779M compilation log
--------------------------------------------------
Started compilation: Wed Jun 19 09:51:21 CEST 2013
--
Errors in:
/usr/local/src/grass7_trunk/scripts/v.line.center
--
In case of errors please change into the directory with error and run
'make'.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.
--
Finished compilation: Wed Jun 19 09:51:38 CEST 2013
make: *** [default] Error 1
radinger@grassgis:/usr/local/src/grass7_trunk$ cd
/usr/local/src/grass7_trunk/scripts/v.line.center/
radinger@grassgis:/usr/local/src/grass7_trunk/scripts/v.line.center$ make
make: *** No rule to make target
`/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/scripts/v.line.center',
needed by `script'. Stop.

As I could not find any other shell script in that folder I am not sure if
the problem is the shell script in general? Attached the slightly adapted
script (v.to.db, v.segment).

bash it doesn't work more with grass7, you have to convert it in python :wink:

/Johannes

--
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org

Johannes wrote:

As I could not find any other shell script in that folder
I am not sure if the problem is the shell script in general?
Attached the slightly adapted script (v.to.db, v.segment).

Luca wrote:

bash it doesn't work more with grass7, you have to convert it
in python :wink:

Sure Bash shell scripts work with GRASS 7, as do classic Bourne,
C-shell, Perl, PHP and whatever else. I'm doing that all the time.
In many cases Bash is the quickest and cleanest way to do the
job. (just cut and paste a few recent lines from the recent
command line history) Other times it is horrible and you want a
real programming language.

What doesn't work out of the box is the Script.make build support,
but since building and installing shell scripts is just copying
the file into your personal $GRASS_ADDON_PATH dir and making sure
the file is executable, it's not a big problem.

For GRASS 7 it is encouraged to write scripts meant to be used by
others in a more platform-independent language, so that MS Windows
users don't stay second-class citizens as they have been until
now, and we can do away with a lot of the sort-of-working unix-on-
Windows kludges and errors due to missing UNIX powertools,
features, etc.

But if the script is just for you, use whatever language you like.
If GRASS doesn't support that it's a bad bug. Likewise, getting
python scripts working reliably on WinGRASS 6.4 is a pretty
critical bug which we haven't figured out yet. Even though the
core-provided scripts there are all written in Bourne shell we
should still support it for users' personal scripts and
interoperability between versions.

regards,
Hamish