[interchange-cvs] interchange - jon modified lib/Vend/Config.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Thu Jan 3 20:04:01 2002


User:      jon
Date:      2002-01-04 01:02:16 GMT
Modified:  lib/Vend Tag: STABLE_4_8-branch Config.pm
Log:
Add support for here documents in locale configuration with this setting:

MV_LOCALE_CHOMP_VALUES

The only problem with here documents previously was that (inherent in Perl)
they had to end in a newline, which we don't want. But the good thing about
here documents is they're the only way to put double-byte characters (or
anything moderately complex) into files without backslashes that make it
impossible to see e.g. Japanese characters in a text editor.

Example coming up.

Revision  Changes    Path
No                   revision



No                   revision



2.2.2.5   +7 -4      interchange/lib/Vend/Config.pm


rev 2.2.2.5, prev_rev 2.2.2.4
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.2.2.4
retrieving revision 2.2.2.5
diff -u -u -r2.2.2.4 -r2.2.2.5
--- Config.pm	2001/10/17 17:41:24	2.2.2.4
+++ Config.pm	2002/01/04 01:02:15	2.2.2.5
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.2.2.4 2001/10/17 17:41:24 mheins Exp $
+# $Id: Config.pm,v 2.2.2.5 2002/01/04 01:02:15 jon Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -95,7 +95,7 @@
 use Vend::Parse;
 use Vend::Util;
 
-$VERSION = substr(q$Revision: 2.2.2.4 $, 10);
+$VERSION = substr(q$Revision: 2.2.2.5 $, 10);
 
 my %CDname;
 
@@ -1729,8 +1729,11 @@
 			%{$sethash} = Text::ParseWords::shellwords($settings);
 		}
 		$c = $store->{$name} || {};
-		for (keys %{$sethash}) {
-			$c->{$_} = $sethash->{$_};
+		if (delete $sethash->{MV_LOCALE_CHOMP_VALUES}) {
+			chomp ($c->{$_} = $sethash->{$_}) for keys %$sethash;
+		}
+		else {
+			$c->{$_} = $sethash->{$_} for keys %$sethash;
 		}
 		if($item eq 'Locale') {
 			$Vend::Cfg->{DefaultLocale} = $name;