8 my ($ftp_file, $ftp_host, $ftp_user, $ftp_pass, $ftp_path);
12 open(FTP, $ftp_file) or die "Unable to read FTP config file $ftp_file: $!\n";
24 my ($myself, $path) = fileparse($0);
29 #Switch to the output folder.
30 chdir(Build::PathFormat('../../OUTPUT/package'));
34 $version = Build::ProductVersion(Build::PathFormat('../../build/product.version'));
35 $version =~ s/-dev//g;
36 $version .= '-hg' . Build::HgRevNum('../../build');
38 # Append OS to package version
43 elsif ($^O =~ /MSWin/)
45 $version .= '-windows';
49 $version .= '-' . $^O;
53 $filename = 'cssdm-' . $version;
56 $filename .= '.tar.gz';
57 print "tar zcvf $filename addons cfg\n";
58 system("tar zcvf $filename addons cfg");
63 print "zip -r $filename addons cfg\n";
64 system("zip -r $filename addons cfg");
67 my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/);
68 $ftp_path .= "/cssdm/$major.$minor";
72 $ftp = Net::FTP->new($ftp_host, Debug => 0, Passive => 1)
73 or die "Cannot connect to host $ftp_host: $@";
75 $ftp->login($ftp_user, $ftp_pass)
76 or die "Cannot connect to host $ftp_host as $ftp_user: " . $ftp->message . "\n";
81 or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n";
86 or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n";
90 print "File sent to drop site as $filename -- build succeeded.\n";