[Pkg-owncloud-commits] [owncloud-client] 15/333: Read configuration from /etc/ownCloud/t1.cfg

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b84253054abf96f6a16e963e001307d91aca3b5d
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Feb 10 15:07:56 2014 +0100

    Read configuration from /etc/ownCloud/t1.cfg
---
 csync/tests/ownCloud/ownCloud/Test.pm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/csync/tests/ownCloud/ownCloud/Test.pm b/csync/tests/ownCloud/ownCloud/Test.pm
index 6eab047..b2c288f 100644
--- a/csync/tests/ownCloud/ownCloud/Test.pm
+++ b/csync/tests/ownCloud/ownCloud/Test.pm
@@ -82,8 +82,11 @@ sub initTesting(;$)
 {
   my ($prefix) = @_;
   
-  if( -r "./t1.cfg" ) {
-    my %config = do 't1.cfg';
+  my $cfgFile = "./t1.cfg";
+  $cfgFile = "/etc/ownCloud/t1.cfg" if( -r "/etc/ownCloud/t1.cfg" );
+
+  if( -r "$cfgFile" ) {
+    my %config = do $cfgFile;
     warn "Could not parse t1.cfg: $!\n" unless %config;
     warn "Could not do t1.cfg: $@\n" if $@;
 
@@ -92,12 +95,14 @@ sub initTesting(;$)
     $owncloud   = $config{url}  if( $config{url} );
     $ld_libpath = $config{ld_libpath} if( $config{ld_libpath} );
     $csync      = $config{csync} if( $config{csync} );
-    print "Read t1.cfg: $config{url}\n";
+    print "Read config from $cfgFile: $config{url}\n";
+  } else {
+    print STDERR "Could not read a config file $cfgFile\n";
+    exit(1);
   }
 
   $owncloud .= "/" unless( $owncloud =~ /\/$/ );
 
-
   print "Connecting to ownCloud at ". $owncloud ."\n";
   $d = HTTP::DAV->new();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list