[interchange-cvs] interchange - heins modified lib/Vend/Util.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Wed Jul 3 09:34:00 2002


User:      heins
Date:      2002-07-03 05:16:42 GMT
Modified:  lib/Vend Util.pm
Log:
* Canonical option strings passed via get_option_hash().

Revision  Changes    Path
2.28      +4 -3      interchange/lib/Vend/Util.pm


rev 2.28, prev_rev 2.27
Index: Util.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/lib/Vend/Util.pm,v
retrieving revision 2.27
retrieving revision 2.28
diff -u -r2.27 -r2.28
--- Util.pm	27 Jun 2002 22:24:10 -0000	2.27
+++ Util.pm	3 Jul 2002 05:16:42 -0000	2.28
@@ -1,6 +1,6 @@
 # Vend::Util - Interchange utility functions
 #
-# $Id: Util.pm,v 2.27 2002/06/27 22:24:10 jon Exp $
+# $Id: Util.pm,v 2.28 2002/07/03 05:16:42 mheins Exp $
 #=20
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -82,7 +82,7 @@
 use Safe;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION =3D substr(q$Revision: 2.27 $, 10);
+$VERSION =3D substr(q$Revision: 2.28 $, 10);
=20
 BEGIN {
 	eval {
@@ -890,7 +890,7 @@
 	unless ($string =3D~ /,/) {
 		@opts =3D grep $_ ne "=3D", Text::ParseWords::shellwords($string);
 		for(@opts) {
-			s/^(\w+)=3D(["'])(.*)\2$/$1$3/;
+			s/^(\w[-\w]*\w)=3D(["'])(.*)\2$/$1$3/;
 		}
 	}
 	else {
@@ -900,6 +900,7 @@
 	my %hash;
 	for(@opts) {
 		my ($k, $v) =3D split /[\s=3D]+/, $_, 2;
+		$k =3D~ s/-/_/g;
 		$hash{$k} =3D $v;
 	}
 	if($merge) {