[GRASS5] [bug #2795] (grass) g.copy exit value

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

User does not use -o and gets
$ g.copy vect=largeA,largeC
ERROR: <largeC> already exists in mapset <jidanni>
However, $? is not set, so Makefiles etc. just roll on.

--- Headers Follow ---

From jidanni@jidanni.org Mon Dec 6 23:46:31 2004

Return-Path: <jidanni@jidanni.org>
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 2D76C102BF4
  for <grass-bugs@lists.intevation.de>; Mon, 6 Dec 2004 23:46:31 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
  by mail.intevation.de (Postfix) with ESMTP id F2CAF36DE2
  for <grass-bugs@lists.intevation.de>; Mon, 6 Dec 2004 23:46:30 +0100 (CET)
Received: from frodo.hserus.net (frodo.hserus.net [204.74.68.40])
  by mail.intevation.de (Postfix) with ESMTP id 110D236CE0
  for <grass-bugs@intevation.de>; Mon, 6 Dec 2004 23:46:30 +0100 (CET)
Received: from [219.69.72.158] (port=32799 helo=jidanni1)
  by frodo.hserus.net with esmtpsa
  (Cipher TLSv1:RC4-SHA:128) (Exim 4.43 #0)
  id 1CbRcd-000Jn3-Df by authid <jidanni> with plain
  for <grass-bugs@intevation.de>; Tue, 07 Dec 2004 04:16:28 +0530
To: grass-bugs@intevation.de
Subject: g.copy exit value
From: Dan Jacobson <jidanni@jidanni.org>
Date: Tue, 07 Dec 2004 06:07:36 +0800
Message-ID: <877jnvhyhj.fsf@jidanni.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Status: No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level:

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

On Mon, 6 Dec 2004, Request Tracker wrote:

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

User does not use -o and gets
$ g.copy vect=largeA,largeC
ERROR: <largeC> already exists in mapset <jidanni>
However, $? is not set, so Makefiles etc. just roll on.

I looked in the code (general/manage/cmd/copy.c) and it seems this behaviour is intentional, presumably because you could be copying more than one file (e.g. a raster and a vector) in one invocation of the command and it will continue and try to copy the others without stopping if there is an error in just one. I suppose it's debatable whether this is useful.