public inbox for gnats-prs@sourceware.org
help / color / mirror / Atom feed
* gnats/384: mkdb should fail for a remote database
@ 2002-05-26  6:21 Lars.Henriksen
  0 siblings, 0 replies; only message in thread
From: Lars.Henriksen @ 2002-05-26  6:21 UTC (permalink / raw)
  To: pdm-gnats, gnats-prs, bug-gnats

>Number:         384
>Category:       gnats
>Synopsis:       mkdb should fail for a remote database
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 26 09:18:30 -0400 2002
>Originator:     Lars Henriksen
>Release:        4.0-beta1
>Organization:

>Environment:

>Description:
The databases file may describe local as well as remote databases.
The mkdb command should only work for local databases.
At present the last field of the database entry is used unconditionally.
Minimal fix attached.
>How-To-Repeat:

>Fix:
Index: mkdb.sh
===================================================================
RCS file: /cvsroot/gnats/gnats/gnats/mkdb.sh,v
retrieving revision 1.7
diff -u -r1.7 mkdb.sh
--- mkdb.sh     2 Dec 2001 14:39:09 -0000       1.7
+++ mkdb.sh     26 May 2002 12:56:21 -0000
@@ -58,10 +58,10 @@
     exit 1;
 fi
 
-dbdir=`grep "^${database}:" $DATABASES | sed 's/^.*:\([^:]*\)$/\1/'`
+dbdir=`grep "^${database}:" $DATABASES | sed -n 's/^'${database}':[^:]*:\([^:]*\)$/\1/p'`
 if [ -z "${dbdir}" ]
 then
-  echo "$prog: No proper entry for \`${database}' in \`$DATABASES'."
+  echo "$prog: No proper entry for \`${database}' in \`$DATABASES':\n"`grep "^${database}:" $DATABASES`
   exit 1
 fi
>Unformatted:
 

_______________________________________________
Gnats-prs mailing list
Gnats-prs@gnu.org
http://mail.gnu.org/mailman/listinfo/gnats-prs


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-26 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-26  6:21 gnats/384: mkdb should fail for a remote database Lars.Henriksen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).