[GRASS-dev] lib/symbol/Makefile $(INSTALL)?

Hi,

lib/symbol/Makefile has:

symb:
        $(MKDIR) $(ETC)/symbol
        find ./symbol -type f | grep -v CVS | xargs tar chBf - |(cd $(ETC); tar xBf -)

this seems very circuitous to me, should it be:

symb:
        $(MKDIR) $(ETC)/symbol
  $(INSTALL) -m 644 symbol/* $(ETC)/symbol/

(will "install" include directories?)

??

Hamish

Hamish wrote:

lib/symbol/Makefile has:

symb:
        $(MKDIR) $(ETC)/symbol
        find ./symbol -type f | grep -v CVS | xargs tar chBf - |(cd $(ETC); tar xBf -)

this seems very circuitous to me, should it be:

symb:
        $(MKDIR) $(ETC)/symbol
  $(INSTALL) -m 644 symbol/* $(ETC)/symbol/

(will "install" include directories?)

1. No, install won't copy directories.

2. All of the entities which the symbol/* pattern matches are
directories. You could use symbol/*/* instead, but that would match
symbol/CVS/* and symbol/*/CVS.

3. The install-sh script doesn't support installing multiple files in
a single command; you need to use a "for" loop or similar.

If you don't want to use "tar" (which has problems, e.g. preserving
ownership and permissions on the copied files), use:

  find symbol -path '*/CVS' -prune -o -type d -print | while read dir ; do \
    $(MKDIR) $(ETC)/"$$dir" ; \
  done
  find symbol -path '*/CVS' -prune -o -type f -print | while read file ; do \
    $(INSTALL_DATA) "$$file" $(ETC)/"$$file" ; \
  done

--
Glynn Clements <glynn@gclements.plus.com>