aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2010-05-21 16:33:20 +0800
committerdanfe <danfe@FreeBSD.org>2010-05-21 16:33:20 +0800
commita0d25af0f7c76eb6aadfe225833c1c00f3709129 (patch)
tree109e16b80162b6e8241178a1d55a8476327f6471
parentad69a952b62ecd1e507800a0bb61777b31bb5ffb (diff)
downloadfreebsd-ports-gnome-a0d25af0f7c76eb6aadfe225833c1c00f3709129.tar.gz
freebsd-ports-gnome-a0d25af0f7c76eb6aadfe225833c1c00f3709129.tar.zst
freebsd-ports-gnome-a0d25af0f7c76eb6aadfe225833c1c00f3709129.zip
- Update to version 1.5
- Switch to hashlib instead of deprecated md5 module in newer Python - Don't attempt to fetch a default userpic if the user hasn't set one Patches obtained from: ljdump repository on GitHub
-rw-r--r--www/ljdump/Makefile4
-rw-r--r--www/ljdump/distinfo6
-rw-r--r--www/ljdump/files/patch-ljdump.py68
3 files changed, 56 insertions, 22 deletions
diff --git a/www/ljdump/Makefile b/www/ljdump/Makefile
index 56b670c5d29d..f7f50637e7e6 100644
--- a/www/ljdump/Makefile
+++ b/www/ljdump/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= ljdump
-PORTVERSION= 1.2
+PORTVERSION= 1.5
CATEGORIES= www python
-MASTER_SITES= http://hewgill.com/software/ljdump/ \
+MASTER_SITES= http://hewgill.com/ljdump/ \
http://freebsd.nsu.ru/distfiles/
MAINTAINER= danfe@FreeBSD.org
diff --git a/www/ljdump/distinfo b/www/ljdump/distinfo
index a180e9172998..00ec59631af4 100644
--- a/www/ljdump/distinfo
+++ b/www/ljdump/distinfo
@@ -1,3 +1,3 @@
-MD5 (ljdump-1.2.tar.gz) = 45d8907289021f8931080c0d2ce646dc
-SHA256 (ljdump-1.2.tar.gz) = d7343b074991156dc8054995f3faf6e2fb2f1d2af58aec09fbd47859d776f40e
-SIZE (ljdump-1.2.tar.gz) = 3909
+MD5 (ljdump-1.5.tar.gz) = 43d99b8f793549dd628fc5306ce33d55
+SHA256 (ljdump-1.5.tar.gz) = b060e5a6adbcc2edc6c8203f8245c65c3e58f4e44261a9f802b22565c20f7b4d
+SIZE (ljdump-1.5.tar.gz) = 5761
diff --git a/www/ljdump/files/patch-ljdump.py b/www/ljdump/files/patch-ljdump.py
index 6ed1503c58d1..6d182146d2fc 100644
--- a/www/ljdump/files/patch-ljdump.py
+++ b/www/ljdump/files/patch-ljdump.py
@@ -1,24 +1,58 @@
---- ljdump.py.orig 2006-09-08 15:49:11.000000000 +0700
-+++ ljdump.py 2008-01-12 03:30:50.000000000 +0600
+--- ljdump.py.orig
++++ ljdump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!%%LOCALBASE%%/bin/python
#
# ljdump.py - livejournal archiver
# Greg Hewgill <greg@hewgill.com> http://hewgill.com
-@@ -113,7 +113,14 @@
- return ""
- return e[0].firstChild.nodeValue
+@@ -24,7 +24,7 @@
+ #
+ # Copyright (c) 2005-2009 Greg Hewgill
+
+-import codecs, md5, os, pickle, pprint, re, shutil, sys, urllib2, xml.dom.minidom, xmlrpclib
++import codecs, os, pickle, pprint, re, shutil, sys, urllib2, xml.dom.minidom, xmlrpclib
+ from xml.sax import saxutils
+
+ MimeExtensions = {
+@@ -33,8 +33,14 @@
+ "image/png": ".png",
+ }
+
++try:
++ from hashlib import md5
++except ImportError:
++ import md5 as _md5
++ md5 = _md5.new
++
+ def calcchallenge(challenge, password):
+- return md5.new(challenge+md5.new(password).hexdigest()).hexdigest()
++ return md5(challenge+md5(password).hexdigest()).hexdigest()
+
+ def flatresponse(response):
+ r = {}
+@@ -157,7 +163,8 @@
+ 'getpickwurls': 1,
+ }, Password))
+ userpics = dict(zip(map(str, r['pickws']), r['pickwurls']))
+- userpics['*'] = r['defaultpicurl']
++ if r['defaultpicurl']:
++ userpics['*'] = r['defaultpicurl']
+
+ while True:
+ r = server.LJ.XMLRPC.syncitems(dochallenge(server, {
+@@ -345,8 +352,12 @@
+ print "%d errors" % errors
--config = xml.dom.minidom.parse("ljdump.config")
-+for file in [ "%%PREFIX%%/etc/ljdump.config", "ljdump.config", "/"]:
-+ if os.access(file, os.R_OK):
-+ break
-+if file == "/":
-+ print "Neither global (in %%PREFIX%%/etc) nor local configuration file found, exiting"
-+ sys.exit()
-+print "Using configuration file %s" % file
-+config = xml.dom.minidom.parse(file)
- Server = config.documentElement.getElementsByTagName("server")[0].childNodes[0].data
- Username = config.documentElement.getElementsByTagName("username")[0].childNodes[0].data
- Password = config.documentElement.getElementsByTagName("password")[0].childNodes[0].data
+ if __name__ == "__main__":
+- if os.access("ljdump.config", os.F_OK):
+- config = xml.dom.minidom.parse("ljdump.config")
++ for file in [ "%%PREFIX%%/etc/ljdump.config", "ljdump.config", "/"]:
++ if os.access(file, os.F_OK):
++ break
++ if file != "/":
++ print "Using configuration file %s" % file
++ config = xml.dom.minidom.parse(file)
+ server = config.documentElement.getElementsByTagName("server")[0].childNodes[0].data
+ username = config.documentElement.getElementsByTagName("username")[0].childNodes[0].data
+ password = config.documentElement.getElementsByTagName("password")[0].childNodes[0].data