Skip to content

Commit

Permalink
use -O instead of -o content for curl command
Browse files Browse the repository at this point in the history
  • Loading branch information
plicease committed Mar 24, 2019
1 parent 22f979b commit 0256693
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 51 deletions.
@@ -1 +1 @@
{"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html":{"exit":0,"stdout":"ab-filename :content\nab-content_type :text/html;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 19086 0 --:--:-- --:--:-- --:--:-- 21000\n","files":{"content":"<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"}},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus/":{"files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (9) Server denied you to change to the given directory\n","stdout":"","exit":9},"-o foo-1.01.tar ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 334 0 --:--:-- --:--:-- --:--:-- 333\n","files":{"foo-1.01.tar":"content:foo-1.01\n"},"exit":0,"stdout":""},"-o dir ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir":{"exit":78,"stdout":"","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (78) RETR response: 550\n","files":{}},"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html":{"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n","files":{},"exit":22,"stdout":"ab-filename :bogus.html\nab-content_type :\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html"},"-o bogus.txt ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.txt":{"files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (78) RETR response: 550\n","stdout":"","exit":78},"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html":{"exit":0,"stdout":"ab-filename :html_test.html\nab-content_type :text/html;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 14341 0 --:--:-- --:--:-- --:--:-- 16800\n","files":{"html_test.html":"<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"}},"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 2797 0 --:--:-- --:--:-- --:--:-- 2833\n","files":{"foo-1.01.tar":"content:foo-1.01\n"},"exit":0,"stdout":"ab-filename :foo-1.01.tar\nab-content_type :text/plain\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar"},"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"exit":0,"stdout":"ab-filename :content\nab-content_type :text/plain\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 3758 0 --:--:-- --:--:-- --:--:-- 4250\n","files":{"content":"content:foo-1.01\n"}},"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html":{"exit":22,"stdout":"ab-filename :content\nab-content_type :\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n","files":{}},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/":{"stdout":"foo-1.00.tar\nfoo-1.01.tar\nfoo-1.02.tar\nhtml_test.html\n","exit":0,"files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 58 0 58 0 0 1172 0 --:--:-- --:--:-- --:--:-- 1183\n"},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.txt/":{"stdout":"","exit":9,"files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (9) Server denied you to change to the given directory\n"}}
{"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html":{"files":{},"stdout":"ab-filename :bogus.html\nab-content_type :\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n","exit":22},"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html":{"exit":0,"stdout":"ab-filename :html_test.html\nab-content_type :text/html;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html","files":{"html_test.html":"<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 14341 0 --:--:-- --:--:-- --:--:-- 16800\n"},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.txt/":{"exit":9,"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (9) Server denied you to change to the given directory\n","stdout":"","files":{}},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus/":{"exit":9,"files":{},"stdout":"","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (9) Server denied you to change to the given directory\n"},"-o dir ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir":{"exit":78,"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (78) RETR response: 550\n","files":{},"stdout":""},"-o foo-1.01.tar ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"exit":0,"stdout":"","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 334 0 --:--:-- --:--:-- --:--:-- 333\n","files":{"foo-1.01.tar":"content:foo-1.01\n"}},"-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"exit":0,"stdout":"ab-filename :foo-1.01.tar\nab-content_type :text/plain;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar","files":{"foo-1.01.tar":"content:foo-1.01\n"},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 2524 0 --:--:-- --:--:-- --:--:-- 2833\n"},"-L -O -J -f -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"exit":0,"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 2797 0 --:--:-- --:--:-- --:--:-- 2833\n","stdout":"ab-filename :foo-1.01.tar\nab-content_type :text/plain\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar","files":{"foo-1.01.tar":"content:foo-1.01\n"}},"-o bogus.txt ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.txt":{"stdout":"","files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (78) RETR response: 550\n","exit":78},"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar":{"files":{"content":"content:foo-1.01\n"},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 3758 0 --:--:-- --:--:-- --:--:-- 4250\n","stdout":"ab-filename :content\nab-content_type :text/plain\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar","exit":0},"-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html":{"exit":22,"files":{},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n","stdout":"ab-filename :bogus.html\nab-content_type :\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html"},"-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html":{"files":{"html_test.html":"<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"},"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 11433 0 --:--:-- --:--:-- --:--:-- 12000\n","stdout":"ab-filename :html_test.html\nab-content_type :text/html;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html","exit":0},"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html":{"exit":0,"files":{"content":"<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"},"stdout":"ab-filename :content\nab-content_type :text/html;charset=UTF-8\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 19086 0 --:--:-- --:--:-- --:--:-- 21000\n"},"-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html":{"files":{},"stdout":"ab-filename :content\nab-content_type :\nab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html","stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n","exit":22},"-l ftp://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/":{"stderr":" % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 58 0 58 0 0 1172 0 --:--:-- --:--:-- --:--:-- 1183\n","files":{},"stdout":"foo-1.00.tar\nfoo-1.01.tar\nfoo-1.02.tar\nhtml_test.html\n","exit":0}}
26 changes: 26 additions & 0 deletions corpus/alien_build_plugin_fetch_curlcommand/record/old.yml
Expand Up @@ -25,6 +25,32 @@
ab-filename :html_test.html
ab-content_type :text/html;charset=UTF-8
ab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html
-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html:
exit: 22
files: {}
stderr: " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) The requested URL returned error: 404 Not Found\n"
stdout: |-
ab-filename :bogus.html
ab-content_type :
ab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html
-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar:
exit: 0
files:
foo-1.01.tar: "content:foo-1.01\n"
stderr: " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 17 100 17 0 0 2524 0 --:--:-- --:--:-- --:--:-- 2833\n"
stdout: |-
ab-filename :foo-1.01.tar
ab-content_type :text/plain;charset=UTF-8
ab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/foo-1.01.tar
-L -f -O -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html:
exit: 0
files:
html_test.html: "<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>\n"
stderr: " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 84 100 84 0 0 11433 0 --:--:-- --:--:-- --:--:-- 12000\n"
stdout: |-
ab-filename :html_test.html
ab-content_type :text/html;charset=UTF-8
ab-url :http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/html_test.html
-L -f -o content -w @writeout http://localhost/corpus/alien_build_plugin_fetch_curlcommand/dir/bogus.html:
exit: 22
files: {}
Expand Down
13 changes: 1 addition & 12 deletions lib/Alien/Build/Plugin/Fetch/CurlCommand.pm
Expand Up @@ -119,7 +119,7 @@ sub init

my @command = (
$self->curl_command,
'-L', '-f', -o => 'content',
'-L', '-f', '-O',
-w => '@writeout',
);

Expand All @@ -131,17 +131,6 @@ sub init

my %h = map { my($k,$v) = m/^ab-(.*?)\s*:(.*)$/; $k => $v } split /\n/, $stdout;

if($h{url} =~ m{/([^/]+)$})
{
$h{filename} = $1;
}
else
{
$h{filename} = 'index.html';
}

rename 'content', $h{filename};

if(-e 'head')
{
$build->log(" ~ $_ => $h{$_}") for sort keys %h;
Expand Down

0 comments on commit 0256693

Please sign in to comment.