Details Ticket 1231


Comment | Reply | Take | Open


Serial Number 1231
Subject g.copy bug: cell_misc ignored
Area bug
Queue grass
Requestors neteler@itc.it
Owner none
Status resolved
Last User Contact Sat Aug 24 02:36:11 2002 (6 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Tue Oct 8 10:05:40 2002 (6 yr ago)
Created Wed Aug 14 11:59:08 2002 (6 yr ago)

Transaction History Ticket 1231


Wed, Aug 14 2002 11:59:08    Request created by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
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
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


Wed, Aug 14 2002 14:03:15    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <15706.18015.674666.522237@cerise.nosuchdomain.co.uk>
Date Wed, 14 Aug 2002 13:00:31 +0100
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #1231] (grass) g.copy bug: cell_misc ignored
In-Reply-To <20020814095909.1F04C139FE@lists.intevation.de>
References <20020814095909.1F04C139FE@lists.intevation.de>
X-Mailer VM 6.94 under 21.4 (patch 4) "Artificial Intelligence (candidate #1)" XEmacs Lucid
X-Spam-Status No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level
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>


Wed, Aug 14 2002 14:29:04    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 14 Aug 2002 14:29:01 +0200
From Markus Neteler <neteler@itc.it>
To Glynn Clements via RT <grass-bugs@intevation.de>
Cc grass5 developers list <grass5@grass.itc.it>
Subject Re: [bug #1231] (grass) g.copy bug: cell_misc ignored
Message-ID <20020814142901.I2167@itc.it>
Mail-Followup-To Glynn Clements via RT <grass-bugs@intevation.de>, grass5 developers list <grass5@grass.itc.it>
References <20020814120315.75EAF139FE@lists.intevation.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.2.5.1i
In-Reply-To <20020814120315.75EAF139FE@lists.intevation.de>; from grass-bugs@intevation.de on Wed, Aug 14, 2002 at 02:03:15PM +0200
X-Spam-Status No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level
On Wed, Aug 14, 2002 at 02:03:15PM +0200, Glynn Clements via RT wrote:
> 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"?

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

You are right. The problem is still there, but different:


GRASS:~ > l /ssi0/ssi/neteler/grassdata/pat/neteler/cell_misc/test
total 4
-r--r--r--    1 neteler  ssi            10 Aug 14 14:25 range
^^^

GRASS:~ > r.support -r test
   Updating the stats for [test]
 WARNING: can't write range file for [test in neteler]
   Updating the number of categories for [test]

The permissions should be
-rw-r--r--

right? That's the real problem where I was struggling.

> > 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().

Brrr...

Markus


Thu, Aug 15 2002 00:10:58    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <15706.51766.260829.373265@cerise.nosuchdomain.co.uk>
Date Wed, 14 Aug 2002 22:23:02 +0100
To Markus Neteler <neteler@itc.it>
Cc Glynn Clements via RT <grass-bugs@intevation.de>, grass5 developers list <grass5@grass.itc.it>
Subject Re: [GRASS5] Re: [bug #1231] (grass) g.copy bug: cell_misc ignored
In-Reply-To <20020814142901.I2167@itc.it>
References <20020814120315.75EAF139FE@lists.intevation.de> <20020814142901.I2167@itc.it>
X-Mailer VM 6.94 under 21.4 (patch 4) "Artificial Intelligence (candidate #1)" XEmacs Lucid
X-Spam-Status No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level
Markus Neteler wrote:

> > > 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"?
> 
> Er, yes. Sorry, but....
>  
> > AFAICT, g.copy *does* copy the cell_misc/<map> directory (assuming
> > that it's in etc/element_list).
> 
> You are right. The problem is still there, but different:
> 
> 
> GRASS:~ > l /ssi0/ssi/neteler/grassdata/pat/neteler/cell_misc/test
> total 4
> -r--r--r--    1 neteler  ssi            10 Aug 14 14:25 range
> ^^^
> 
> GRASS:~ > r.support -r test
>    Updating the stats for [test]
>  WARNING: can't write range file for [test in neteler]
>    Updating the number of categories for [test]
> 
> The permissions should be
> -rw-r--r--
> 
> right? That's the real problem where I was struggling.

I suspect that adding:

    chmod u+rw $b

after the line:

    cp $a $b

in src/general/manage/lib/copy.sh should solve the immediate problem.

However, this wouldn't be specific to the cell_misc files. AFAICT, all
files retain their permissions when copied. The obvious question is:
why was the original range file read-only?

Also, that script (in fact, almost *every* script) should really have
double quotes around all of the variable expansions, i.e.

    cp "$a" "$b"

This particular issue is likely to be the source of around half of the
bugs relating to spaces in pathnames. The other half are due to the
use of sprintf/system.

In the longer term, src/general/manage should be completely
re-written. Much of the code there is suspect, even by GRASS'
standards.

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


Fri, Aug 23 2002 15:35:44    Area changed to bug by bernhard  
Fri, Aug 23 2002 15:36:48    Mail sent by bernhard  
Is this problem already fixed?
Fri, Aug 23 2002 16:29:40    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Fri, 23 Aug 2002 16:29:23 +0200
From Markus Neteler <neteler@itc.it>
To Bernhard Reiter via RT <grass-bugs@intevation.de>
Subject Re: [bug #1231] (grass) g.copy bug: cell_misc ignored
Message-ID <20020823162923.K7452@itc.it>
References <20020823133648.75F55139C8@lists.intevation.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.2.5.1i
In-Reply-To <20020823133648.75F55139C8@lists.intevation.de>; from grass-bugs@intevation.de on Fri, Aug 23, 2002 at 03:36:48PM +0200
X-Spam-Status No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level
On Fri, Aug 23, 2002 at 03:36:48PM +0200, Bernhard Reiter via RT wrote:
> Is this problem already fixed?

Unfortunately not. The suggestions are still suggestions.

 Markus


Sat, Aug 24 2002 02:36:11    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <15718.54318.819104.848904@cerise.nosuchdomain.co.uk>
Date Sat, 24 Aug 2002 01:32:46 +0100
To Bernhard Reiter via RT <grass-bugs@intevation.de>
Cc neteler@itc.it
Subject Re: [bug #1231] (grass) g.copy bug: cell_misc ignored
In-Reply-To <20020823133648.75F55139C8@lists.intevation.de>
References <20020823133648.75F55139C8@lists.intevation.de>
X-Mailer VM 6.94 under 21.4 (patch 9) "Informed Management (RC2)" XEmacs Lucid
X-Spam-Status No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level
Bernhard Reiter via RT wrote:

> Is this problem already fixed?

The bug which was described never existed. The problem was that the
original file was read-only, and consequently the new file was also
read-only.

Personally, I'd rather not mess with something as fundamental as
g.copy at this late stage. I don't know how significant this issue is;
the database files shouldn't normally be read-only.

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


Tue, Oct 8 2002 10:05:40    Status changed to resolved by mneteler  
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request