[arch-commits] Commit in aria2/trunk (PKGBUILD aria2-1.7.1-metalink-piping.patch)

Giovanni Scafora giovanni at archlinux.org
Wed Dec 9 02:29:17 UTC 2009


    Date: Tuesday, December 8, 2009 @ 21:29:16
  Author: giovanni
Revision: 60895

upgpkg: aria2 1.7.1-2
    Fixed FS17445

Added:
  aria2/trunk/aria2-1.7.1-metalink-piping.patch
Modified:
  aria2/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |   16 +++---
 aria2-1.7.1-metalink-piping.patch |   91 ++++++++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-12-09 01:53:34 UTC (rev 60894)
+++ PKGBUILD	2009-12-09 02:29:16 UTC (rev 60895)
@@ -3,20 +3,24 @@
 
 pkgname=aria2
 pkgver=1.7.1
-pkgrel=1
+pkgrel=2
 pkgdesc="Download utility that supports HTTP(S), FTP, BitTorrent, and Metalink"
 arch=('i686' 'x86_64')
 url="http://aria2.sourceforge.net/"
 license=('GPL')
 depends=('gnutls' 'libxml2' 'sqlite3' 'c-ares' 'ca-certificates')
-source=( http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
-md5sums=('ca125faf6a8fbef108184184cb70fe24')
+source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+        aria2-1.7.1-metalink-piping.patch)
+md5sums=('ca125faf6a8fbef108184184cb70fe24'
+         'fa958d728fd0a7f002f93975f034cfd1')
 
 build() {
-  cd "$srcdir/$pkgname-$pkgver"
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  # Fix FS17445
+  patch -Np0 -i ${srcdir}/aria2-1.7.1-metalink-piping.patch || return 1
 
   ./configure --prefix=/usr \
-    --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt || return 1
+              --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt || return 1
   make || return 1
-  make DESTDIR="$pkgdir" install || return 1
+  make DESTDIR="${pkgdir}" install || return 1
 }

Added: aria2-1.7.1-metalink-piping.patch
===================================================================
--- aria2-1.7.1-metalink-piping.patch	                        (rev 0)
+++ aria2-1.7.1-metalink-piping.patch	2009-12-09 02:29:16 UTC (rev 60895)
@@ -0,0 +1,91 @@
+Index: src/OptionHandlerFactory.cc
+===================================================================
+--- src/OptionHandlerFactory.cc	(revision 1700)
++++ src/OptionHandlerFactory.cc	(working copy)
+@@ -1184,6 +1184,7 @@
+ 				   (PREF_TORRENT_FILE,
+ 				    TEXT_TORRENT_FILE,
+ 				    NO_DEFAULT_VALUE,
++				    false,
+ 				    'T'));
+     op->addTag(TAG_BASIC);
+     op->addTag(TAG_BITTORRENT);
+@@ -1215,6 +1216,7 @@
+ 				   (PREF_METALINK_FILE,
+ 				    TEXT_METALINK_FILE,
+ 				    NO_DEFAULT_VALUE,
++				    true,
+ 				    'M'));
+     op->addTag(TAG_BASIC);
+     op->addTag(TAG_METALINK);
+Index: src/OptionHandlerImpl.h
+===================================================================
+--- src/OptionHandlerImpl.h	(revision 1684)
++++ src/OptionHandlerImpl.h	(working copy)
+@@ -56,6 +56,7 @@
+ #include "message.h"
+ #include "File.h"
+ #include "FileEntry.h"
++#include "a2io.h"
+ 
+ namespace aria2 {
+ 
+@@ -576,24 +577,32 @@
+ };
+ 
+ class LocalFilePathOptionHandler : public NameMatchOptionHandler {
++private:
++  bool _acceptStdin;
+ public:
+   LocalFilePathOptionHandler
+   (const std::string& optName,
+    const std::string& description = NO_DESCRIPTION,
+    const std::string& defaultValue = NO_DEFAULT_VALUE,
++   bool acceptStdin = false,
+    char shortName = 0):
+     NameMatchOptionHandler(optName, description, defaultValue,
+ 			   OptionHandler::REQ_ARG,
+-			   shortName) {}
++			   shortName),
++    _acceptStdin(acceptStdin) {}
+ 
+   virtual void parseArg(Option& option, const std::string& optarg)
+   {
+-    File f(optarg);
+-    if(!f.exists() || f.isDir()) {
+-      throw DL_ABORT_EX
+-	(StringFormat(MSG_NOT_FILE, optarg.c_str()).str());
++    if(_acceptStdin && optarg == "-") {
++      option.put(_optName, DEV_STDIN);
++    } else {
++      File f(optarg);
++      if(!f.exists() || f.isDir()) {
++	throw DL_ABORT_EX
++	  (StringFormat(MSG_NOT_FILE, optarg.c_str()).str());
++      }
++      option.put(_optName, optarg);
+     }
+-    option.put(_optName, optarg);
+   }
+   
+   virtual std::string createPossibleValuesString() const
+Index: src/a2io.h
+===================================================================
+--- src/a2io.h	(revision 1555)
++++ src/a2io.h	(working copy)
+@@ -103,10 +103,12 @@
+ # define DEV_NULL "/dev/null"
+ #endif // HAVE_WINSOCK2_H
+ 
+-// Use 'con' instead of '/dev/stdout' in win32.
++// Use 'con' instead of '/dev/stdin' and '/dev/stdout' in win32.
+ #ifdef HAVE_WINSOCK2_H
++# define DEV_STDIN "con"
+ # define DEV_STDOUT "con"
+ #else
++# define DEV_STDIN "/dev/stdin"
+ # define DEV_STDOUT "/dev/stdout"
+ #endif // HAVE_WINSOCK2_H
+ 
+
+ 	
\ No newline at end of file




More information about the arch-commits mailing list