summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anderson2017-03-11 13:21:16 -0800
committerEric Anderson2017-03-11 13:21:53 -0800
commit51cf85122c112e8162640898aebc83c764c038f1 (patch)
tree9e71ea5711d5b9f10704a0bbb2720e29acfca03b
parent34182f7913affbcd9657d7253e5161af4062fe97 (diff)
downloadaur-51cf85122c112e8162640898aebc83c764c038f1.tar.gz
Port to python3
Although the changes were small, it seems important enough to bump the minor version.
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD10
-rwxr-xr-xpkgdistcache-client10
-rwxr-xr-xpkgdistcache-daemon19
4 files changed, 26 insertions, 27 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f0b6eed2c0a8..32aa9b1eab46 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,24 @@
# Generated by mksrcinfo v8
-# Sat Feb 25 17:56:14 UTC 2017
+# Sat Mar 11 21:20:33 UTC 2017
pkgbase = pkgdistcache
pkgdesc = A distributed local-network cache for pacman packages
- pkgver = 0.3.2
- pkgrel = 4
+ pkgver = 0.4.0
+ pkgrel = 1
url = http://venator.ath.cx/dw/doku.php?id=linux:pkgdistcache
install = pkgdistcache.install
arch = any
license = GPL
depends = avahi
- depends = python2-dbus
+ depends = python-dbus
depends = dbus-glib
- depends = python2-gobject2
+ depends = python-gobject
depends = curl
source = pkgdistcache-client
source = pkgdistcache-daemon
source = pkgdistcache.conf
source = pkgdistcached.service
- sha256sums = d53ba7417b6d6db3c36876f7ef92933553ce27597b94ce727deeef8c6edac1f8
- sha256sums = b0e40b5d51b34c7613ce28656e450ecaf664d5ec8fc5d1c5179dd0a4d9f19881
+ sha256sums = cf5968974de026de73b5e063b527adb6e23400520450302d0ca2269e344f0fab
+ sha256sums = 8f298c9f1548b56373038fe69f8568dc77e17a700476594155359df20eb275a4
sha256sums = d77ac418aa651bc622cd91204d6907554c6cdb4bb989e484cc54da32342faa51
sha256sums = fdfa58e652230725a232de41c87627ed8c9a4fd9d081c8a3d261ea75cf91a81a
diff --git a/PKGBUILD b/PKGBUILD
index 00f3d6fa7e65..192cdfe7fe3c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,20 +2,20 @@
# Maintainer: Eric Anderson <ejona86@gmail.com>
pkgname=pkgdistcache
-pkgver=0.3.2
-pkgrel=4
+pkgver=0.4.0
+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' 'python2-dbus' 'dbus-glib' 'python2-gobject2' 'curl')
+depends=('avahi' 'python-dbus' 'dbus-glib' 'python-gobject' 'curl')
install="${pkgname}.install"
source=('pkgdistcache-client'
'pkgdistcache-daemon'
'pkgdistcache.conf'
'pkgdistcached.service')
-sha256sums=('d53ba7417b6d6db3c36876f7ef92933553ce27597b94ce727deeef8c6edac1f8'
- 'b0e40b5d51b34c7613ce28656e450ecaf664d5ec8fc5d1c5179dd0a4d9f19881'
+sha256sums=('cf5968974de026de73b5e063b527adb6e23400520450302d0ca2269e344f0fab'
+ '8f298c9f1548b56373038fe69f8568dc77e17a700476594155359df20eb275a4'
'd77ac418aa651bc622cd91204d6907554c6cdb4bb989e484cc54da32342faa51'
'fdfa58e652230725a232de41c87627ed8c9a4fd9d081c8a3d261ea75cf91a81a')
diff --git a/pkgdistcache-client b/pkgdistcache-client
index e051d26d18a2..424717cf7cd1 100755
--- a/pkgdistcache-client
+++ b/pkgdistcache-client
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python
# coding: utf-8
#
# pkgdistcache client v0.3.1
@@ -12,7 +12,7 @@ import subprocess
import string
import avahi
import dbus
-import gobject
+from gi.repository import GObject as gobject
import dbus.glib
import pickle
@@ -27,13 +27,13 @@ colors = {'none': '\033[0m',
'white': '\033[0;37m', 'bold_white': '\033[1;37m'}
def printmsg(msg):
- print "%s>> %s%s" % (colors['bold_blue'], msg, colors['none'])
+ print("%s>> %s%s" % (colors['bold_blue'], msg, colors['none']))
def printerr(msg):
- print "%s!! %s%s" % (colors['bold_red'], msg, colors['none'])
+ print("%s!! %s%s" % (colors['bold_red'], msg, colors['none']))
def printwarn(msg):
- print "%s!! %s%s" % (colors['bold_yellow'], msg, colors['none'])
+ print("%s!! %s%s" % (colors['bold_yellow'], msg, colors['none']))
# Run a command synchronously, redirecting stdout and stderr to strings
def runcmd(cmd, cwd=None):
diff --git a/pkgdistcache-daemon b/pkgdistcache-daemon
index ff5a83a59b6c..bdc883d1931c 100755
--- a/pkgdistcache-daemon
+++ b/pkgdistcache-daemon
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python
# coding: utf-8
#
# pkgdistcache daemon v0.3.1
@@ -15,10 +15,9 @@ import subprocess
import string
import avahi
import dbus
-import gobject
+from gi.repository import GObject as gobject
import dbus.glib
-import SimpleHTTPServer
-import BaseHTTPServer
+import http.server
import signal
import socket
@@ -38,15 +37,15 @@ def runcmd(cmd, cwd=None):
def daemonize():
try:
pid = os.fork()
- except OSError, e:
- raise Exception, "%s [%d]" % (e.strerror, e.errno)
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
if (pid == 0): # The first child.
os.setsid()
try:
pid = os.fork() # Fork a second child.
- except OSError, e:
- raise Exception, "%s [%d]" % (e.strerror, e.errno)
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
if (pid != 0): # The second child.
os._exit(0) # Exit parent (the first child) of the second child.
@@ -100,7 +99,7 @@ class AvahiPublisher:
def unpublish(self):
self.group.Reset()
-class HTTPServerV6(BaseHTTPServer.HTTPServer):
+class HTTPServerV6(http.server.HTTPServer):
address_family = socket.AF_INET6
def main(args):
@@ -128,7 +127,7 @@ def main(args):
avahi_service.publish()
os.chdir('/var/cache/pacman/pkg')
- handler = SimpleHTTPServer.SimpleHTTPRequestHandler
+ handler = http.server.SimpleHTTPRequestHandler
httpd = HTTPServerV6(('', port), handler)
try: