summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.AURINFO23
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD6
-rwxr-xr-xpkgdistcache-client19
4 files changed, 23 insertions, 31 deletions
diff --git a/.AURINFO b/.AURINFO
deleted file mode 100644
index 4de8cf26e1de..000000000000
--- a/.AURINFO
+++ /dev/null
@@ -1,23 +0,0 @@
-pkgbase = pkgdistcache
- pkgdesc = A distributed local-network cache for pacman packages
- pkgver = 0.3.1
- pkgrel = 4
- url = http://venator.ath.cx/dw/doku.php?id=linux:pkgdistcache
- install = pkgdistcache.install
- arch = any
- license = GPL
- depends = avahi
- depends = python2-dbus
- depends = python2-gobject2
- depends = curl
- source = pkgdistcache-client
- source = pkgdistcache-daemon
- source = pkgdistcache.conf
- source = pkgdistcached.service
- sha256sums = d53ba7417b6d6db3c36876f7ef92933553ce27597b94ce727deeef8c6edac1f8
- sha256sums = 812075ee7b50f576d9706e0f9aab48ccfb2ee1fd8c06d91476c90c0fe7d576d8
- sha256sums = d77ac418aa651bc622cd91204d6907554c6cdb4bb989e484cc54da32342faa51
- sha256sums = 5eb96f9e4bcec466d097ac46d72fd9626fb36bd61a3d3ceb1ca69706036f27c2
-
-pkgname = pkgdistcache
-
diff --git a/.SRCINFO b/.SRCINFO
index d96563b63a26..c4d03ad61263 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Sat Dec 23 17:46:36 UTC 2017
+# Wed Dec 27 15:40:49 UTC 2017
pkgbase = pkgdistcache
pkgdesc = A distributed local-network cache for pacman packages
- pkgver = 0.4.3
+ pkgver = 0.4.4
pkgrel = 1
url = http://venator.ath.cx/dw/doku.php?id=linux:pkgdistcache
install = pkgdistcache.install
@@ -17,7 +17,7 @@ pkgbase = pkgdistcache
source = pkgdistcache-daemon
source = pkgdistcache.conf
source = pkgdistcached.service
- sha256sums = af14f26cbcb089467080e80eae25767e60ad1af5aba6ad80fbddeeaf6b75e1b8
+ sha256sums = c3549b1a2ab680fba6c2cfc80ffc31010ee20831f40be8b64eee3cfec60965cf
sha256sums = 8f298c9f1548b56373038fe69f8568dc77e17a700476594155359df20eb275a4
sha256sums = d77ac418aa651bc622cd91204d6907554c6cdb4bb989e484cc54da32342faa51
sha256sums = 756c0bd1139e296da88937a89ab19e0b5d6c0d5d0f719034d4029b1fe1ea09e9
diff --git a/PKGBUILD b/PKGBUILD
index 30db3b0582b1..8f5b19d632e3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,19 @@
# Maintainer: Eric Anderson <ejona86@gmail.com>
pkgname=pkgdistcache
-pkgver=0.4.3
+pkgver=0.4.4
pkgrel=1
pkgdesc='A distributed local-network cache for pacman packages'
arch=('any')
url='http://venator.ath.cx/dw/doku.php?id=linux:pkgdistcache'
license=('GPL')
-depends=('avahi' 'python-dbus' 'dbus-glib' 'python-gobject' 'curl')
+depends=('avahi' 'python-dbus' 'dbus-glib' 'python-gobject' 'curl' 'python-requests')
install="${pkgname}.install"
source=('pkgdistcache-client'
'pkgdistcache-daemon'
'pkgdistcache.conf'
'pkgdistcached.service')
-sha256sums=('af14f26cbcb089467080e80eae25767e60ad1af5aba6ad80fbddeeaf6b75e1b8'
+sha256sums=('612b58f5992a20c241a03c0d205dc92e0f8de10e00ed6a81c99fb0b9fb28ab31'
'8f298c9f1548b56373038fe69f8568dc77e17a700476594155359df20eb275a4'
'd77ac418aa651bc622cd91204d6907554c6cdb4bb989e484cc54da32342faa51'
'756c0bd1139e296da88937a89ab19e0b5d6c0d5d0f719034d4029b1fe1ea09e9')
diff --git a/pkgdistcache-client b/pkgdistcache-client
index 8a2da77f1dda..8b5d8b7cb46c 100755
--- a/pkgdistcache-client
+++ b/pkgdistcache-client
@@ -15,6 +15,7 @@ import dbus
from gi.repository import GObject as gobject
import dbus.glib
import pickle
+import requests
colors = {'none': '\033[0m',
'black': '\033[0;30m', 'bold_black': '\033[1;30m',
@@ -147,14 +148,27 @@ def main(argv):
with open(cache_file, 'wb') as f:
pickle.dump(pkgdistcache_clients, f, -1)
-
+
+ if pkgdistcache_clients:
+ print("-- Discovered hosts: %s" % ", ".join(set([c.host for c in pkgdistcache_clients])))
+ else:
+ print("-- No hosts discovered")
+
for client in pkgdistcache_clients:
clientip = client.ip
if ":" in clientip:
clientip = "[" + clientip + "]"
url = "http://" + clientip + ":" + str(client.port) + "/" + pkg
+ try:
+ r = requests.head(url, timeout=1)
+ except Exception as e:
+ printwarn("Failed checking host '%s' with ip '%s': %s" % (client.host, clientip, repr(e)))
+ continue
+ if r.status_code != 200:
+ continue
+
dst = argv[2]
- printmsg("Downloading " + pkg + " from host '" + client.host + "'")
+ printmsg("Downloading %s from host '%s'" % (pkg, client.host))
download_cmd = download_cmd_template.substitute({'u': url, 'o': dst})
try:
ret = runcmd2(download_cmd)
@@ -169,6 +183,7 @@ def main(argv):
# download package file from mirror if necessary
if must_download == True:
+ print(">> Downloading %s from mirror" % pkg)
try:
download_cmd = download_cmd_template.substitute({'u': argv[1], 'o': argv[2]})
return runcmd2(download_cmd)