summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorbjs <bjs@pkgsrc.org>2007-10-17 09:42:39 +0000
committerbjs <bjs@pkgsrc.org>2007-10-17 09:42:39 +0000
commit0ca60cabd32e7d012fb25121ffc38cdd73afdb66 (patch)
tree2f2cbb928880b53f4cdf980fe79f71f403454c29 /net
parent0dfd5c224490dc1d2d379f8672206be3b9e7c6c0 (diff)
downloadpkgsrc-0ca60cabd32e7d012fb25121ffc38cdd73afdb66.tar.gz
Import aria2 0.11.3 (patched to stable-0.11 branch).
aria2 is a download utility with resuming and segmented downloading. Supported protocols are HTTP/HTTPS/FTP/BitTorrent; it also supports MetaLink 3.0. Some of its features: * Command-line interface * Download files through HTTP/HTTPS/FTP/BitTorrent * HTTP Proxy support * FTP through HTTP Proxy * HTTP BASIC authentication support * HTTP Proxy authentication support * Segmented downloading * Download speed throttling * Upload speed throttling in BitTorrent * Cookie support * Load Cookies from file whose format is one used by Netscape and Mozilla. * Run as a daemon process. * Selective download in multi-file torrent/metalink * BitTorrent Fast extension support * Multi-tracker support * Metalink version 3.0 support(HTTP/FTP/BitTorrent) * Chunk checksum validation in Metalink * Can disable segmented downloading in Metalink * netrc support * Configuration file support * Download URIs found in a text file or stdin * Parameterized URI support
Diffstat (limited to 'net')
-rw-r--r--net/aria2/DESCR10
-rw-r--r--net/aria2/Makefile41
-rw-r--r--net/aria2/PLIST7
-rw-r--r--net/aria2/distinfo19
-rw-r--r--net/aria2/options.mk51
-rw-r--r--net/aria2/patches/patch-aa13
-rw-r--r--net/aria2/patches/patch-ab38
-rw-r--r--net/aria2/patches/patch-ac13
-rw-r--r--net/aria2/patches/patch-ad13
-rw-r--r--net/aria2/patches/patch-ae9
-rw-r--r--net/aria2/patches/patch-af52
-rw-r--r--net/aria2/patches/patch-ag13
-rw-r--r--net/aria2/patches/patch-ah29
-rw-r--r--net/aria2/patches/patch-ai13
-rw-r--r--net/aria2/patches/patch-aj35
-rw-r--r--net/aria2/patches/patch-ak14
-rw-r--r--net/aria2/patches/patch-al13
-rw-r--r--net/aria2/patches/patch-am12
-rw-r--r--net/aria2/patches/patch-an35
19 files changed, 430 insertions, 0 deletions
diff --git a/net/aria2/DESCR b/net/aria2/DESCR
new file mode 100644
index 00000000000..9107d109851
--- /dev/null
+++ b/net/aria2/DESCR
@@ -0,0 +1,10 @@
+aria2 is a utility for downloading files. It has completely new design
+concept from its predecessor, Aria, and is written from scratch. aria2
+has a segmented downloading engine in its core. It can download one
+file from multiple URLs or multiple connections from one URL. This
+results in very high speed downloading, much faster than ordinary
+browsers. This engine in was implemented in a single-thread model. The
+architecture is clean and easy to extend. aria2 currently supports
+HTTP, FTP, and BitTorrent. It also supports Metalink version 3.0.
+
+Please visit the project web site at http://aria2.sourceforge.net
diff --git a/net/aria2/Makefile b/net/aria2/Makefile
new file mode 100644
index 00000000000..81bc99d51bf
--- /dev/null
+++ b/net/aria2/Makefile
@@ -0,0 +1,41 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+#
+
+DISTNAME= aria2-0.11.3
+PKGREVISION= 2
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=aria2/}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= bjs@NetBSD.org
+HOMEPAGE= http://aria2.sourceforge.net/
+COMMENT= Multithreaded download accelerator
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_PKGLOCALEDIR= yes
+USE_LANGUAGES= c c++
+
+CONFIGURE_ARGS+= --enable-bittorrent
+CONFIGURE_ARGS+= --with-included-gettext=no
+
+TEST_TARGET= check
+
+.include "options.mk"
+
+.include "../../mk/compiler.mk"
+
+.if !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
+BUILDLINK_DEPMETHOD.cppunit?= build
+. include "../../devel/cppunit/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-xmltest
+.endif
+
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../devel/libgetopt/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/aria2/PLIST b/net/aria2/PLIST
new file mode 100644
index 00000000000..095cefd073f
--- /dev/null
+++ b/net/aria2/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+bin/aria2c
+man/man1/aria2c.1
+share/locale/de/LC_MESSAGES/aria2c.mo
+share/locale/fr/LC_MESSAGES/aria2c.mo
+share/locale/ja/LC_MESSAGES/aria2c.mo
+share/locale/ru/LC_MESSAGES/aria2c.mo
diff --git a/net/aria2/distinfo b/net/aria2/distinfo
new file mode 100644
index 00000000000..8b83e946d1f
--- /dev/null
+++ b/net/aria2/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+SHA1 (aria2-0.11.3.tar.bz2) = bce3c6e8ca732f41736c2f81d3e69784a74817d5
+RMD160 (aria2-0.11.3.tar.bz2) = 29742d22763abefe46854a3ff99ec1634e6fb92a
+Size (aria2-0.11.3.tar.bz2) = 530059 bytes
+SHA1 (patch-aa) = ef192d6a098e59a2edf34bd693ae3f3b27567db8
+SHA1 (patch-ab) = 0f50a78ce703fef9bcd63eebeeee8f176d5886e3
+SHA1 (patch-ac) = f353c48182cc32c467078eb5339c0c8a2930f0b7
+SHA1 (patch-ad) = b7aab1c576f01f8fbe5b87e8ee5dee04b0fadd43
+SHA1 (patch-ae) = d247426fb4279ac91e6d21cfd421c0be9bd6b34a
+SHA1 (patch-af) = 946f329f17b41ca922bf8e95610f1d80cbbd32d3
+SHA1 (patch-ag) = b85662d4626ab1c7ff9ed00c1636800d8aa76b09
+SHA1 (patch-ah) = 9ad3b1ea037abc3758215238827bdfc673ed7301
+SHA1 (patch-ai) = 09b10ce2907d31ae1a88540d898feda14389d58b
+SHA1 (patch-aj) = d04c063c8cc857a3e912a7636873efe66116703a
+SHA1 (patch-ak) = 25689a271064f43867e25c518460ac7d025eaa24
+SHA1 (patch-al) = 468d16be3d9072a38fe3aec4af09bc257f03ebde
+SHA1 (patch-am) = 32e84f8269956c6b93cd4602885485d6177d4576
+SHA1 (patch-an) = 14db2deb67f38fbe7a8c3835968063796722d344
diff --git a/net/aria2/options.mk b/net/aria2/options.mk
new file mode 100644
index 00000000000..48585b7f7ac
--- /dev/null
+++ b/net/aria2/options.mk
@@ -0,0 +1,51 @@
+# $NetBSD: options.mk,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.aria2
+
+PKG_OPTIONS_GROUP.tls= gnutls ssl
+PKG_OPTIONS_GROUP.asyncns= libares libcares
+
+PKG_OPTIONS_REQUIRED_GROUPS= tls asyncns
+
+PKG_SUPPORTED_OPTIONS+= aria2-metalink
+PKG_SUGGESTED_OPTIONS+= ssl libcares aria2-metalink
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mssl)
+CONFIGURE_ARGS+= --with-openssl
+CONFIGURE_ARGS+= --without-gnutls
+
+.include "../../security/openssl/buildlink3.mk"
+
+.else
+CONFIGURE_ARGS+= --with-gnutls
+CONFIGURE_ARGS+= --without-openssl
+
+.include "../../security/gnutls/buildlink3.mk"
+
+.endif
+
+.if !empty(PKG_OPTIONS:Mlibcares)
+CONFIGURE_ARGS+= --with-libcares-prefix=${BUILDLINK_PREFIX.libcares:Q}
+
+.include "../../net/libcares/buildlink3.mk"
+
+.elif !empty(PKG_OPTIONS:Mlibares)
+CONFIGURE_ARGS+= --with-libares-prefix=${BUILDLINK_PREFIX.libares:Q}
+
+.endif
+
+
+.if !empty(PKG_OPTIONS:Maria2-metalink)
+CONFIGURE_ARGS+= --with-libxml2
+CONFIGURE_ARGS+= --enable-metalink
+CONFIGURE_ARGS+= --with-xml-prefix=${BULDLINK_PREFIX.libxml2:Q}
+
+.include "../../textproc/libxml2/buildlink3.mk"
+
+.else
+CONFIGURE_ARGS+= --without-libxml2
+CONFIGURE_ARGS+= --disable-metalink
+
+.endif
diff --git a/net/aria2/patches/patch-aa b/net/aria2/patches/patch-aa
new file mode 100644
index 00000000000..aaec1bc2da6
--- /dev/null
+++ b/net/aria2/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/DefaultBtProgressInfoFile.cc.orig 2007-09-01 12:10:30.000000000 -0400
++++ src/DefaultBtProgressInfoFile.cc
+@@ -92,7 +92,7 @@ void DefaultBtProgressInfoFile::save() {
+ filename.c_str(), strerror(errno));
+ }
+
+- if(rename(filenameTemp.c_str(), filename.c_str()) == -1) {
++ if(!File(filenameTemp).renameTo(filename)) {
+ throw new DlAbortEx(EX_SEGMENT_FILE_WRITE,
+ filename.c_str(), strerror(errno));
+ }
diff --git a/net/aria2/patches/patch-ab b/net/aria2/patches/patch-ab
new file mode 100644
index 00000000000..877c1a561e9
--- /dev/null
+++ b/net/aria2/patches/patch-ab
@@ -0,0 +1,38 @@
+$NetBSD: patch-ab,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/File.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/File.cc
+@@ -37,6 +37,11 @@
+ #include "a2io.h"
+ #include <libgen.h>
+
++#ifdef __MINGW32__
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++#endif // __MINGW32__
++
+ File::File(const string& name):name(name) {}
+
+ File::~File() {}
+@@ -140,3 +145,21 @@ bool File::isDir(const string& filename)
+ {
+ return File(filename).isDir();
+ }
++
++bool File::renameTo(const string& dest)
++{
++#ifdef __MINGW32__
++ /* MinGW's rename() doesn't delete an existing destination */
++ if (_access(dest.c_str(), 0) == 0) {
++ if (_unlink(dest.c_str()) != 0) {
++ return false;
++ }
++ }
++#endif // __MINGW32__
++ if(rename(name.c_str(), dest.c_str()) == 0) {
++ name = dest;
++ return true;
++ } else {
++ return false;
++ }
++}
diff --git a/net/aria2/patches/patch-ac b/net/aria2/patches/patch-ac
new file mode 100644
index 00000000000..01fe61b961f
--- /dev/null
+++ b/net/aria2/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/File.h.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/File.h
+@@ -96,6 +96,8 @@ public:
+ string getDirname() const;
+
+ static bool isDir(const string& filename);
++
++ bool renameTo(const string& dest);
+ };
+
+ #endif // _D_FILE_H_
diff --git a/net/aria2/patches/patch-ad b/net/aria2/patches/patch-ad
new file mode 100644
index 00000000000..72d576bfafb
--- /dev/null
+++ b/net/aria2/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/SegmentMan.cc.orig 2007-09-01 12:10:30.000000000 -0400
++++ src/SegmentMan.cc
+@@ -143,7 +143,7 @@ void SegmentMan::save() const {
+ segFilename.c_str(), strerror(errno));
+ }
+
+- if(rename(segFilenameTemp.c_str(), segFilename.c_str()) == -1) {
++ if(!File(segFilenameTemp).renameTo(segFilename)) {
+ throw new DlAbortEx(EX_SEGMENT_FILE_WRITE,
+ segFilename.c_str(), strerror(errno));
+ }
diff --git a/net/aria2/patches/patch-ae b/net/aria2/patches/patch-ae
new file mode 100644
index 00000000000..5e6035a5f23
--- /dev/null
+++ b/net/aria2/patches/patch-ae
@@ -0,0 +1,9 @@
+$NetBSD: patch-ae,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- test/DefaultBtProgressInfoFileTest.cc.orig 2007-09-01 12:10:30.000000000 -0400
++++ test/DefaultBtProgressInfoFileTest.cc
+@@ -1,3 +1,4 @@
++#include <fstream>
+ #include "DefaultBtProgressInfoFile.h"
+ #include "DefaultBtContext.h"
+ #include "Option.h"
diff --git a/net/aria2/patches/patch-af b/net/aria2/patches/patch-af
new file mode 100644
index 00000000000..b616a018b34
--- /dev/null
+++ b/net/aria2/patches/patch-af
@@ -0,0 +1,52 @@
+$NetBSD: patch-af,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- test/FileTest.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ test/FileTest.cc
+@@ -3,6 +3,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <string>
++#include <fstream>
+ #include <cppunit/extensions/HelperMacros.h>
+
+ using namespace std;
+@@ -18,6 +19,7 @@ class FileTest:public CppUnit::TestFixtu
+ CPPUNIT_TEST(testMkdir);
+ CPPUNIT_TEST(testGetDirname);
+ CPPUNIT_TEST(testGetBasename);
++ CPPUNIT_TEST(testRenameTo);
+ CPPUNIT_TEST_SUITE_END();
+ private:
+
+@@ -33,6 +35,7 @@ public:
+ void testMkdir();
+ void testGetDirname();
+ void testGetBasename();
++ void testRenameTo();
+ };
+
+
+@@ -132,3 +135,23 @@ void FileTest::testGetBasename()
+ File f("/tmp/dist/aria2.tar.bz2");
+ CPPUNIT_ASSERT_EQUAL(string("aria2.tar.bz2"), f.getBasename());
+ }
++
++void FileTest::testRenameTo()
++{
++ string fname = "FileTest_testRenameTo.txt";
++ ofstream of(fname.c_str());
++ of.close();
++
++ File f(fname);
++ string fnameTo = "FileTest_testRenameTo_dest.txt";
++ CPPUNIT_ASSERT(f.renameTo(fnameTo));
++ CPPUNIT_ASSERT(f.exists());
++ CPPUNIT_ASSERT(!File(fname).exists());
++ CPPUNIT_ASSERT_EQUAL(fnameTo, f.getBasename());
++
++ // to see renameTo() work even when the destination file exists
++ of.open(fname.c_str());
++ of.close();
++
++ CPPUNIT_ASSERT(f.renameTo(fname));
++}
diff --git a/net/aria2/patches/patch-ag b/net/aria2/patches/patch-ag
new file mode 100644
index 00000000000..33c5685ef3a
--- /dev/null
+++ b/net/aria2/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- test/HttpHeaderProcessorTest.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ test/HttpHeaderProcessorTest.cc
+@@ -105,7 +105,7 @@ void HttpHeaderProcessorTest::testGetHtt
+ CPPUNIT_ASSERT_EQUAL(string("200"), status);
+ CPPUNIT_ASSERT_EQUAL(string("Mon, 25 Jun 2007 16:04:59 GMT"), header->getFirst("Date"));
+ CPPUNIT_ASSERT_EQUAL(string("Apache/2.2.3 (Debian)"), header->getFirst("Server"));
+- CPPUNIT_ASSERT_EQUAL(9187LL, header->getFirstAsLLInt("Content-Length"));
++ CPPUNIT_ASSERT_EQUAL((int64_t)9187LL, header->getFirstAsLLInt("Content-Length"));
+ CPPUNIT_ASSERT_EQUAL(string("text/html; charset=UTF-8"), header->getFirst("Content-Type"));
+ }
+
diff --git a/net/aria2/patches/patch-ah b/net/aria2/patches/patch-ah
new file mode 100644
index 00000000000..951c8ab586c
--- /dev/null
+++ b/net/aria2/patches/patch-ah
@@ -0,0 +1,29 @@
+$NetBSD: patch-ah,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/FtpConnection.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/FtpConnection.cc
+@@ -73,13 +73,13 @@ void FtpConnection::sendType() const {
+ }
+
+ void FtpConnection::sendCwd() const {
+- string request = "CWD "+req->getDir()+"\r\n";
++ string request = "CWD "+Util::urldecode(req->getDir())+"\r\n";
+ logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
+ socket->writeData(request);
+ }
+
+ void FtpConnection::sendSize() const {
+- string request = "SIZE "+req->getFile()+"\r\n";
++ string request = "SIZE "+Util::urldecode(req->getFile())+"\r\n";
+ logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
+ socket->writeData(request);
+ }
+@@ -116,7 +116,7 @@ void FtpConnection::sendRest(const Segme
+ }
+
+ void FtpConnection::sendRetr() const {
+- string request = "RETR "+req->getFile()+"\r\n";
++ string request = "RETR "+Util::urldecode(req->getFile())+"\r\n";
+ logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
+ socket->writeData(request);
+ }
diff --git a/net/aria2/patches/patch-ai b/net/aria2/patches/patch-ai
new file mode 100644
index 00000000000..772437db64b
--- /dev/null
+++ b/net/aria2/patches/patch-ai
@@ -0,0 +1,13 @@
+$NetBSD: patch-ai,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/HttpRequest.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/HttpRequest.cc
+@@ -83,7 +83,7 @@ string HttpRequest::createRequest() cons
+ }
+ requestLine +=
+ string(" HTTP/1.1\r\n")+
+- "User-Agent: "+Util::urlencode(userAgent)+"\r\n"+
++ "User-Agent: "+userAgent+"\r\n"+
+ "Accept: */*\r\n"+ /* */
+ "Host: "+getHostText(getHost(), getPort())+"\r\n"+
+ "Pragma: no-cache\r\n"+
diff --git a/net/aria2/patches/patch-aj b/net/aria2/patches/patch-aj
new file mode 100644
index 00000000000..c0a7d19150b
--- /dev/null
+++ b/net/aria2/patches/patch-aj
@@ -0,0 +1,35 @@
+$NetBSD: patch-aj,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/IteratableChunkChecksumValidator.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/IteratableChunkChecksumValidator.cc
+@@ -36,13 +36,28 @@
+ #include "Util.h"
+ #include "message.h"
+ #include "MessageDigestHelper.h"
++#include "DlAbortEx.h"
+
+ void IteratableChunkChecksumValidator::validateChunk()
+ {
+ if(!finished()) {
+- string actualChecksum = calculateActualChecksum();
+-
++ string actualChecksum;
++ try {
++ actualChecksum = calculateActualChecksum();
++ } catch(DlAbortEx* ex) {
++ logger->debug("Caught exception while validating piece index=%d. Some part of file may be missing. Continue operation.", ex, _currentIndex);
++ delete ex;
+
++ int64_t offset = ((int64_t)_currentIndex)*_chunkChecksum->getChecksumLength();
++ int32_t startIndex;
++ int32_t endIndex;
++ Util::indexRange(startIndex, endIndex, offset,
++ _chunkChecksum->getChecksumLength(),
++ _bitfield->getBlockLength());
++ _bitfield->unsetBitRange(startIndex, endIndex);
++ _currentIndex++;
++ return;
++ }
+ if(!_chunkChecksum->validateChunk(actualChecksum, _currentIndex)) {
+ int64_t offset = ((int64_t)_currentIndex)*_chunkChecksum->getChecksumLength();
+ // wrong checksum
diff --git a/net/aria2/patches/patch-ak b/net/aria2/patches/patch-ak
new file mode 100644
index 00000000000..fcd5047fc2c
--- /dev/null
+++ b/net/aria2/patches/patch-ak
@@ -0,0 +1,14 @@
+$NetBSD: patch-ak,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/MetalinkRequestInfo.cc.orig 2007-09-05 08:40:08.000000000 -0400
++++ src/MetalinkRequestInfo.cc
+@@ -88,6 +88,9 @@ RequestInfos MetalinkRequestInfo::execut
+ RequestInfos nextReqInfos;
+ try {
+ MetalinkerHandle metalinker = proc.parseFile(metalinkFile);
++ if(metalinker->entries.empty()) {
++ throw new DlAbortEx("No file entry found. Probably, the metalink file is not configured properly or broken.");
++ }
+ MetalinkEntries entries =
+ metalinker->queryEntry(op->get(PREF_METALINK_VERSION),
+ op->get(PREF_METALINK_LANGUAGE),
diff --git a/net/aria2/patches/patch-al b/net/aria2/patches/patch-al
new file mode 100644
index 00000000000..61f3ffaa24c
--- /dev/null
+++ b/net/aria2/patches/patch-al
@@ -0,0 +1,13 @@
+$NetBSD: patch-al,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- src/Request.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ src/Request.cc
+@@ -60,7 +60,7 @@ bool Request::resetUrl() {
+ }
+
+ bool Request::redirectUrl(const string& url) {
+- previousUrl = currentUrl;
++ previousUrl = "";
+ return parseUrl(url);
+ }
+
diff --git a/net/aria2/patches/patch-am b/net/aria2/patches/patch-am
new file mode 100644
index 00000000000..0036b31f464
--- /dev/null
+++ b/net/aria2/patches/patch-am
@@ -0,0 +1,12 @@
+$NetBSD: patch-am,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- test/HttpRequestTest.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ test/HttpRequestTest.cc
+@@ -165,7 +165,6 @@ void HttpRequestTest::testCreateRequest(
+ "Host: localhost:8080\r\n"
+ "Pragma: no-cache\r\n"
+ "Cache-Control: no-cache\r\n"
+- "Referer: http://localhost:8080/archives/aria2-1.0.0.tar.bz2\r\n"
+ "\r\n";
+
+ CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
diff --git a/net/aria2/patches/patch-an b/net/aria2/patches/patch-an
new file mode 100644
index 00000000000..5c4df0ad805
--- /dev/null
+++ b/net/aria2/patches/patch-an
@@ -0,0 +1,35 @@
+$NetBSD: patch-an,v 1.1.1.1 2007/10/17 09:42:39 bjs Exp $
+
+--- test/RequestTest.cc.orig 2007-08-28 12:36:33.000000000 -0400
++++ test/RequestTest.cc
+@@ -228,8 +228,8 @@ void RequestTest::testRedirectUrl() {
+ req.getUrl());
+ // currentUrl must be updated
+ CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.co.jp/"), req.getCurrentUrl());
+- // previousUrl must be updated
+- CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com:8080/aria2/index.html"), req.getPreviousUrl());
++ // previousUrl must be "" when redirection
++ CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
+ CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
+ CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.co.jp"), req.getHost());
+ CPPUNIT_ASSERT_EQUAL((int32_t)80, req.getPort());
+@@ -246,15 +246,15 @@ void RequestTest::testRedirectUrl2() {
+ CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getPreviousUrl());
+ bool v2 = req.redirectUrl("http://aria.rednoah.com/403.html");
+
+- // previousUrl is updated
+- CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/download.html"), req.getPreviousUrl());
++ // previousUrl must be "" when redirection
++ CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
+ // referer is unchagned
+ CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getReferer());
+
+ bool v3 = req.redirectUrl("http://aria.rednoah.com/error.html");
+
+- // previousUrl is update
+- CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/403.html"), req.getPreviousUrl());
++ // previousUrl must be "" when redirection
++ CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
+ }
+
+ void RequestTest::testResetUrl() {