From 2f412f5d2ddc27d4e87f62843267434fdfcb8b9f Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Sat, 15 May 2010 18:31:36 -0500 Subject: [PATCH] Fixed buildbot upload for OS X with horrible workaround (r=dvander). --- support/buildbot/package.pl | 38 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/support/buildbot/package.pl b/support/buildbot/package.pl index 284c1cc..8751ff1 100755 --- a/support/buildbot/package.pl +++ b/support/buildbot/package.pl @@ -67,25 +67,33 @@ else my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/); $ftp_path .= "/$major.$minor"; -my ($ftp); - -$ftp = Net::FTP->new($ftp_host, Debug => 0) - or die "Cannot connect to host $ftp_host: $@"; - -$ftp->login($ftp_user, $ftp_pass) - or die "Cannot connect to host $ftp_host as $ftp_user: " . $ftp->message . "\n"; - -if ($ftp_path ne '') +if ($^O eq "darwin") { - $ftp->cwd($ftp_path) - or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n"; + # Horrible workaround for weird upload failure + system("ftp -Vu ftp://$ftp_user:$ftp_pass\@$ftp_host/$ftp_path/$filename $filename"); } +else +{ + my ($ftp); -$ftp->binary(); -$ftp->put($filename) - or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n"; + $ftp = Net::FTP->new($ftp_host, Debug => 0) + or die "Cannot connect to host $ftp_host: $@"; -$ftp->close(); + $ftp->login($ftp_user, $ftp_pass) + or die "Cannot connect to host $ftp_host as $ftp_user: " . $ftp->message . "\n"; + + if ($ftp_path ne '') + { + $ftp->cwd($ftp_path) + or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n"; + } + + $ftp->binary(); + $ftp->put($filename) + or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n"; + + $ftp->close(); +} print "File sent to drop site as $filename -- build succeeded.\n";