commit 9bb72014e876a05637cd58d3e06c24dc03ca0457 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:12:29 2019 -0400 Package init diff --git a/HTTP-Tiny-0.070-Croak-on-failed-write-into-a-file.patch b/HTTP-Tiny-0.070-Croak-on-failed-write-into-a-file.patch new file mode 100644 index 0000000..510d701 --- /dev/null +++ b/HTTP-Tiny-0.070-Croak-on-failed-write-into-a-file.patch @@ -0,0 +1,36 @@ +From ddda87fb08ca523115be1ffd6dec8442e47bc20b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 27 Nov 2013 10:45:39 +0100 +Subject: [PATCH] Croak on failed write into a file +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The mirror() method saves a document into a file. Any error while +writing to the file, e.g. no disk space, was ignored. This patch fixes +it by croaking on such I/O error. + +Signed-off-by: Petr Písař +--- + lib/HTTP/Tiny.pm | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/HTTP/Tiny.pm b/lib/HTTP/Tiny.pm +index 541befe..b3fffd0 100644 +--- a/lib/HTTP/Tiny.pm ++++ b/lib/HTTP/Tiny.pm +@@ -300,7 +300,10 @@ sub mirror { + sysopen my $fh, $tempfile, Fcntl::O_CREAT()|Fcntl::O_EXCL()|Fcntl::O_WRONLY() + or _croak(qq/Error: Could not create temporary file $tempfile for downloading: $!\n/); + binmode $fh; +- $args->{data_callback} = sub { print {$fh} $_[0] }; ++ $args->{data_callback} = sub { ++ print {$fh} $_[0] ++ or _croak(qq/Error: Could not write into temporary file $tempfile: $!\n/); ++ }; + my $response = $self->request('GET', $url, $args); + close $fh + or _croak(qq/Error: Caught error closing temporary file $tempfile: $!\n/); +-- +2.7.4 + diff --git a/HTTP-Tiny-0.076.tar.gz b/HTTP-Tiny-0.076.tar.gz new file mode 100644 index 0000000..027aa66 Binary files /dev/null and b/HTTP-Tiny-0.076.tar.gz differ diff --git a/perl-HTTP-Tiny.spec b/perl-HTTP-Tiny.spec new file mode 100644 index 0000000..7380283 --- /dev/null +++ b/perl-HTTP-Tiny.spec @@ -0,0 +1,71 @@ +Name: perl-HTTP-Tiny +Version: 0.076 +Release: 2 +Summary: A small, simple, correct HTTP/1.1 client +License: GPL+ or Artistic +URL: https://metacpan.org/release/HTTP-Tiny +Source0: https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/HTTP-Tiny-%{version}.tar.gz + +# https://github.com/chansen/p5-http-tiny/issues/32 +Patch0: HTTP-Tiny-0.070-Croak-on-failed-write-into-a-file.patch + +BuildArch: noarch + +BuildRequires: make perl-generators perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) perl(warnings) perl(bytes) perl(Carp) perl(Errno) perl(Fcntl) +BuildRequires: perl(IO::Socket) perl(MIME::Base64) perl(Socket) perl(Time::Local) +BuildRequires: perl(Exporter) perl(File::Basename) perl(File::Spec) perl(File::Temp) +BuildRequires: perl(IO::Dir) perl(IO::File) perl(IPC::Cmd) perl(lib) perl(open) +BuildRequires: perl(Test::More) >= 0.96 + +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(bytes) perl(Carp) perl(Fcntl) perl(MIME::Base64) perl(Time::Local) +Recommends: perl(IO::Socket::IP) >= 0.32 +Recommends: perl(IO::Socket::SSL) >= 1.56 +Recommends: perl(Mozilla::CA) + +%description +This is a very simple HTTP/1.1 client, designed for doing simple requests +without the overhead of a large framework like LWP::UserAgent. + +It is more correct and more complete than HTTP::Lite. It supports proxies and +redirection. It also correctly resumes after EINTR. + +If IO::Socket::IP 0.25 or later is installed, HTTP::Tiny will use it instead +of IO::Socket::INET for transparent support for both IPv4 and IPv6. + +Cookie support requires HTTP::CookieJar or an equivalent class. + +%package help +Summary: Documents for perl-HTTP-Tiny +Buildarch: noarch + +%description help +Man pages and other related documents. + +%prep +%autosetup -n HTTP-Tiny-%{version} -p1 + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 +%make_build + +%install +make pure_install DESTDIR='%{buildroot}' +%{_fixperms} '%{buildroot}'/* + +%check +make test + +%files +%license LICENSE +%{perl_vendorlib}/* + +%files help +%doc Changes CONTRIBUTING.mkdn eg README +%{_mandir}/man3/* + +%changelog +* Tue Sep 17 2019 openEuler Buildteam - 0.076-2 +- Package init \ No newline at end of file