2010-06-12 21:45:58 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
my $file = shift;
|
|
|
|
die "Usage: test-put <file> [base_url]" unless -f $file;
|
|
|
|
my $sha1 = `sha1sum $file`;
|
|
|
|
$sha1 =~ s!\s.*!!s;
|
|
|
|
|
|
|
|
my $url = shift;
|
|
|
|
$url ||= "http://127.0.0.1:3179";
|
|
|
|
$url =~ s!/$!!;
|
|
|
|
|
|
|
|
# Bogus sha1:
|
|
|
|
#$sha1 = "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15";
|
|
|
|
|
|
|
|
$url .= "/camli/sha1-$sha1";
|
|
|
|
|
2010-06-13 00:15:49 +00:00
|
|
|
print "PUT'ing to $url ...\n";
|
2010-06-14 04:51:18 +00:00
|
|
|
system("curl", "-u", "test:foo", "-T", $file, $url) and die "Curl failed.";
|
2010-06-12 21:45:58 +00:00
|
|
|
|
|
|
|
|