r35077 - in /trunk/libdbix-password-perl/debian: changelog patches/02-config-file.patch

roam-guest at users.alioth.debian.org roam-guest at users.alioth.debian.org
Sat May 9 12:41:05 UTC 2009


Author: roam-guest
Date: Sat May  9 12:40:59 2009
New Revision: 35077

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35077
Log:
Now that DBIx::Password 1.9 has wrapped its head around the concept of
not being initialized from the start, we can also stop dying horribly
if the config file cannot be read at module load time.

Modified:
    trunk/libdbix-password-perl/debian/changelog
    trunk/libdbix-password-perl/debian/patches/02-config-file.patch

Modified: trunk/libdbix-password-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-password-perl/debian/changelog?rev=35077&op=diff
==============================================================================
--- trunk/libdbix-password-perl/debian/changelog (original)
+++ trunk/libdbix-password-perl/debian/changelog Sat May  9 12:40:59 2009
@@ -17,6 +17,7 @@
     - add the README.source file to document the use of quilt
     - add the Homepage control field
   * New upstream release.
+  * Allow the module to be loaded even without a config file.
 
  -- Peter Pentchev <roam at ringlet.net>  Sat, 09 May 2009 12:54:32 +0300
 

Modified: trunk/libdbix-password-perl/debian/patches/02-config-file.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-password-perl/debian/patches/02-config-file.patch?rev=35077&op=diff
==============================================================================
--- trunk/libdbix-password-perl/debian/patches/02-config-file.patch (original)
+++ trunk/libdbix-password-perl/debian/patches/02-config-file.patch Sat May  9 12:40:59 2009
@@ -3,7 +3,7 @@
 
 --- a/Password.pm
 +++ b/Password.pm
-@@ -7,6 +7,47 @@
+@@ -7,6 +7,50 @@
  
  my $virtual1 = {};
  
@@ -34,24 +34,27 @@
 +
 +#Now let's fill %virtual1 with values
 +my $config = "/etc/dbix-password.conf";
-+open (IN,$config) || die "I need a config file: $!";
 +
-+my @fields = qw(user username password port database connect driver
++if (-r $config) {
++	open (IN,$config) || die "Opening config file $config: $!";
++
++	my @fields = qw(user username password port database connect driver
 +host);
 +
-+while (<IN>) {
-+	next if /^(#.*)?$/; #skip comments and blanks
-+	my @user = m/:?'([^']*)':?/g;
-+	foreach (1 .. 7) { #write fields
-+		$virtual1->{$user[0]}->{$fields[$_]} = $user[$_];
-+	};
-+	$virtual1->{$user[0]}->{attributes} ||= {};
++	while (<IN>) {
++		next if /^(#.*)?$/; #skip comments and blanks
++		my @user = m/:?'([^']*)':?/g;
++		foreach (1 .. 7) { #write fields
++			$virtual1->{$user[0]}->{$fields[$_]} = $user[$_];
++		};
++		$virtual1->{$user[0]}->{attributes} ||= {};
++	}
++	close IN;
 +}
-+close IN;
  
  my %driver_cache;
  
-@@ -94,11 +135,11 @@
+@@ -94,11 +138,11 @@
  
  Don't you hate keeping track of database passwords and such throughout
  your scripts? How about the problem of changing those passwords 
@@ -67,7 +70,7 @@
  You can add as many as you like.
  
  I would recommend that if you are only using this with
-@@ -127,20 +168,6 @@
+@@ -127,20 +171,6 @@
  
  Hope you enjoy it.
  




More information about the Pkg-perl-cvs-commits mailing list