[interchange-cvs] interchange - racke modified lib/Vend/Table/Common.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sun Feb 16 06:48:59 2003


User:      racke
Date:      2003-02-16 11:48:02 GMT
Modified:  lib/Vend/Table Common.pm
Log:
revert change to unstuff method as discussed on the core ML
added filename to column_index error message

Revision  Changes    Path
2.26      +8 -4      interchange/lib/Vend/Table/Common.pm


rev 2.26, prev_rev 2.25
Index: Common.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.25
retrieving revision 2.26
diff -u -r2.25 -r2.26
--- Common.pm	13 Feb 2003 16:12:18 -0000	2.25
+++ Common.pm	16 Feb 2003 11:48:02 -0000	2.26
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.25 2003/02/13 16:12:18 racke Exp $
+# $Id: Common.pm,v 2.26 2003/02/16 11:48:02 racke Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 # Copyright (C) 2003 ICDEVGROUP <interchange@icdevgroup.org>
@@ -23,7 +23,7 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
 
-$VERSION = substr(q$Revision: 2.25 $, 10);
+$VERSION = substr(q$Revision: 2.26 $, 10);
 use strict;
 
 package Vend::Table::Common;
@@ -127,7 +127,11 @@
     return $val;
 }
 
-*unstuff = \&Vend::Util::unhexify;
+sub unstuff {
+    my ($val) = @_;
+    $val =~ s,%(..),chr(hex($1)),eg;
+    return $val;
+}
 
 sub autonumber {
 	my $s = shift;
@@ -229,7 +233,7 @@
     my ($s, $column) = @_;
 	$s = $s->import_db() if ! defined $s->[$TIE_HASH];
     my $i = $s->[$COLUMN_INDEX]{$column};
-    die "There is no column named '$column'" unless defined $i;
+    die "There is no column named '$column' in $s->[$FILENAME]" unless defined $i;
     return $i;
 }