[Pkg-owncloud-commits] [owncloud-client] 277/333: Add options to createRemoteDir

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:04 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 58aaad3fed88c483c0ae28218c14a4cc9486350a
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Apr 1 16:00:45 2014 +0200

    Add options to createRemoteDir
---
 csync/tests/ownCloud/ownCloud/Test.pm | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/csync/tests/ownCloud/ownCloud/Test.pm b/csync/tests/ownCloud/ownCloud/Test.pm
index ba0bb40..3ef61f1 100644
--- a/csync/tests/ownCloud/ownCloud/Test.pm
+++ b/csync/tests/ownCloud/ownCloud/Test.pm
@@ -172,18 +172,27 @@ sub initLocalDir
   mkdir ($localDir, 0777 );
 }
 
-sub createRemoteDir(;$)
+sub createRemoteDir(;$$)
 {
-    my ($dir) = @_;
+    my ($dir, $optionsRef) = @_;
 
     my $url = testDirUrl() . $dir;
 
+    if( $optionsRef && $optionsRef->{user} && $optionsRef->{passwd} ) {
+	$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
+			 -user=> $optionsRef->{user},
+			 -pass=> $optionsRef->{passwd} );
+	if( $optionsRef->{url} ) {
+	    $url = $optionsRef->{url} . $dir;
+	}
+    }
+
     $d->open( $owncloud );
     print $d->message . "\n";
 
     my $re = $d->mkcol( $url );
     if( $re == 0 ) {
-	print "Failed to create directory <$url>: $re\n";
+	print "Failed to create directory <$url>: $d->message() \n";
 	exit 1;
     }
     $d->open( $url );

-- 
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