summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlad2015-09-05 12:57:35 +0300
committervlad2015-09-05 12:57:35 +0300
commit47929f40d08deb032e1dbe19d19b6c6a2272cd7d (patch)
tree04d68a6a8c91958a03b394c972de2eb3baa08903
parentf23a2ffcdfff357b2d7882fb7880546800c8f1e7 (diff)
downloadaur-47929f40d08deb032e1dbe19d19b6c6a2272cd7d.tar.gz
add support for mega.nz link
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD16
-rw-r--r--mega.nz.patch17
3 files changed, 33 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 58ec0657d8c7..9ffd282fac0f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = megatools
pkgdesc = Command line client application for Mega.co.nz
pkgver = 1.9.95
- pkgrel = 1
+ pkgrel = 2
url = http://megatools.megous.com
arch = i686
arch = x86_64
@@ -12,7 +12,9 @@ pkgbase = megatools
depends = fuse
optdepends = gobject-introspection: Bindings support for JavaScript
options = !libtool
+ source = mega.nz.patch
source = http://megatools.megous.com/builds/megatools-1.9.95.tar.gz
+ md5sums = 6cfbc84ff6fb8351838bc7ab682f8a12
md5sums = 93c7762196af8ed90920084df03210fb
pkgname = megatools
diff --git a/PKGBUILD b/PKGBUILD
index 7a850c7205cb..b82d98369007 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=megatools
pkgver=1.9.95
-pkgrel=1
+pkgrel=2
pkgdesc="Command line client application for Mega.co.nz"
arch=('i686' 'x86_64')
url="http://megatools.megous.com"
@@ -10,9 +10,19 @@ license=('GPL')
depends=('curl' 'glib-networking' 'fuse')
makedepends=('gobject-introspection')
optdepends=('gobject-introspection: Bindings support for JavaScript')
-source=("http://megatools.megous.com/builds/megatools-${pkgver}.tar.gz")
+source=(mega.nz.patch
+ "http://megatools.megous.com/builds/megatools-${pkgver}.tar.gz")
options=(!libtool)
-md5sums=('93c7762196af8ed90920084df03210fb')
+md5sums=('6cfbc84ff6fb8351838bc7ab682f8a12'
+ '93c7762196af8ed90920084df03210fb')
+
+prepare() {
+ cd "megatools-${pkgver}"
+
+ # Mega.nz support
+ # https://github.com/megous/megatools/commit/9da13bb
+ patch -Np1 -i ../mega.nz.patch
+}
build() {
cd "megatools-${pkgver}"
diff --git a/mega.nz.patch b/mega.nz.patch
new file mode 100644
index 000000000000..9e98190bb5e4
--- /dev/null
+++ b/mega.nz.patch
@@ -0,0 +1,17 @@
+diff --git a/tools/dl.c b/tools/dl.c
+index 0f3771d..30b6465 100644
+--- a/tools/dl.c
++++ b/tools/dl.c
+@@ -179,10 +179,10 @@ int main(int ac, char* av[])
+
+ // prepare link parsers
+
+- file_regex = g_regex_new("^https?://mega.co.nz/#!([a-z0-9_-]{8})!([a-z0-9_-]{43})$", G_REGEX_CASELESS, 0, NULL);
++ file_regex = g_regex_new("^https?://mega(?:\\.co)?\\.nz/#!([a-z0-9_-]{8})!([a-z0-9_-]{43})$", G_REGEX_CASELESS, 0, NULL);
+ g_assert(file_regex != NULL);
+
+- folder_regex = g_regex_new("^https?://mega.co.nz/#F!([a-z0-9_-]{8})!([a-z0-9_-]{22})$", G_REGEX_CASELESS, 0, NULL);
++ folder_regex = g_regex_new("^https?://mega(?:\\.co)?\\.nz/#F!([a-z0-9_-]{8})!([a-z0-9_-]{22})$", G_REGEX_CASELESS, 0, NULL);
+ g_assert(folder_regex != NULL);
+
+ // create session