[GRASS5] [bug #1231] (grass) g.copy bug: cell_misc ignored

this bug's URL: http://intevation.de/rt/webrt?serial_num=1231
-------------------------------------------------------------------------

Hi,

it seems that g.copy doesn't completely cop a map.
At least the range file in cell_misc/ is ignored:

E.g. current mapset 'modis', I am copying from 'PERMANENT' into
'modis':

GRASS:~ > l ~/grassdata/pat/PERMANENT/cell_misc/geologia/
total 4
-r--r--r-- 1 merler ssi 10 Jul 20 1998 range

GRASS:~ > g.copy geologia,test
COPY [geologia@PERMANENT] to [test]
raster
header
category
color
history
misc
fcell MISSING
g3dcell MISSING

GRASS:~ >l ~/grassdata/pat/PERMANENT/cell_misc/test
ls: /ssi0/ssi/neteler/grassdata/pat/PERMANENT/cell_misc/test: No such file or
directory

I feel that this should be fixed for 5.0.0 since the cell_misc
may also contain histogram, reclassed_to and null.

Markus

--- Headers Follow ---

From neteler@itc.it Wed Aug 14 11:59:08 2002

Return-Path: <neteler@itc.it>
Delivered-To: grass-bugs@lists.intevation.de
Received: from mail.intevation.de (aktaia [212.95.126.10])
  by lists.intevation.de (Postfix) with ESMTP id 5148113948
  for <grass-bugs@lists.intevation.de>; Wed, 14 Aug 2002 11:59:08 +0200 (CEST)
Received: from camelot.itc.it (camelot.itc.it [195.223.171.5])
  by mail.intevation.de (Postfix) with ESMTP id 48B061B6D6
  for <grass-bugs@intevation.de>; Wed, 14 Aug 2002 11:59:07 +0200 (CEST)
Received: from orchestra.itc.it (orchestra [10.0.10.11])
  by camelot.itc.it (8.11.3/8.11.3) with ESMTP id g7E9x6X19874
  for <grass-bugs@intevation.de>; Wed, 14 Aug 2002 11:59:06 +0200 (MET DST)
Received: from thuille.itc.it. (thuille [10.40.0.110])
  by orchestra.itc.it (8.11.6/8.11.6) with ESMTP id g7E9x5n24154
  for <grass-bugs@intevation.de>; Wed, 14 Aug 2002 11:59:05 +0200
Received: (from neteler@localhost)
  by thuille.itc.it. (8.11.6/8.11.2) id g7E9x5505198
  for grass-bugs@intevation.de; Wed, 14 Aug 2002 11:59:05 +0200
Date: Wed, 14 Aug 2002 11:59:05 +0200
From: Markus Neteler <neteler@itc.it>
To: grass-bugs@intevation.de
Subject: g.copy bug: cell_misc ignored
Message-ID: <20020814115905.D2167@itc.it>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5.1i
X-Spam-Status: No, hits=0.0 required=5.0 tests= version=2.20
X-Spam-Level:

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=1231
-------------------------------------------------------------------------

Hi,

it seems that g.copy doesn't completely cop a map.
At least the range file in cell_misc/ is ignored:

E.g. current mapset 'modis', I am copying from 'PERMANENT' into
'modis':

GRASS:~ > l ~/grassdata/pat/PERMANENT/cell_misc/geologia/
total 4
-r--r--r-- 1 merler ssi 10 Jul 20 1998 range

GRASS:~ > g.copy geologia,test
COPY [geologia@PERMANENT] to [test]
raster
header
category
color
history
misc
fcell MISSING
g3dcell MISSING

GRASS:~ >l ~/grassdata/pat/PERMANENT/cell_misc/test
ls: /ssi0/ssi/neteler/grassdata/pat/PERMANENT/cell_misc/test: No such file or
directory

Er, shouldn't this be "modis" instead of "PERMANENT"?

AFAICT, g.copy *does* copy the cell_misc/<map> directory (assuming
that it's in etc/element_list).

I feel that this should be fixed for 5.0.0 since the cell_misc
may also contain histogram, reclassed_to and null.

Note that g.copy explicitly removes the reclassed_to file. This is
correct; however:

1. The code is part of cmd/copy.c, whereas the code to remove the
colr2 file is in lib/do_copy.c.

2. It uses sprintf/system ("rm -f ..."), rather than G_remove().

--
Glynn Clements <glynn.clements@virgin.net>