diff options
author | tron <tron> | 2009-11-17 12:23:01 +0000 |
---|---|---|
committer | tron <tron> | 2009-11-17 12:23:01 +0000 |
commit | 01a716ebf7e1bfd6685c67521300607dfd1eb837 (patch) | |
tree | 858334a46840f55382d543ea4a2e2a7d2d515e6e /security | |
parent | 21fc2e19420047069b888a2a99d01334fcf81f3f (diff) | |
download | pkgsrc-01a716ebf7e1bfd6685c67521300607dfd1eb837.tar.gz |
Avoid deprecation warnings under Python:
1.) Use "hashlib" instead of "sha" module if possible.
2.) Use "subprocess" module instead of os.popen3().
Both changes tested with Python 2.4 and 2.6.
Pkgsrc-related improvements:
1.) Support "user-destdir" installation (no changes required).
2.) Set license to "gnu-gpl-v2".
3.) Reduce patches by recording the fact that the manual page gets
compressed automatically (which "pkgsrc" handles fine) instead
of trying to prevent that.
Diffstat (limited to 'security')
-rw-r--r-- | security/sshfp/Makefile | 8 | ||||
-rw-r--r-- | security/sshfp/distinfo | 5 | ||||
-rw-r--r-- | security/sshfp/patches/patch-aa | 10 | ||||
-rw-r--r-- | security/sshfp/patches/patch-ab | 49 |
4 files changed, 59 insertions, 13 deletions
diff --git a/security/sshfp/Makefile b/security/sshfp/Makefile index 6d4af93f62c..6f9d0ba86fb 100644 --- a/security/sshfp/Makefile +++ b/security/sshfp/Makefile @@ -1,16 +1,20 @@ -# $NetBSD: Makefile,v 1.3 2009/11/17 09:01:43 tron Exp $ +# $NetBSD: Makefile,v 1.4 2009/11/17 12:23:01 tron Exp $ DISTNAME= sshfp-1.1.3 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= security net MASTER_SITES= http://www.xelerance.com/software/sshfp/ MAINTAINER= agc@NetBSD.org HOMEPAGE= http://www.xelerance.com/ COMMENT= Print ssh host key fingerprint resource records +LICENSE= gnu-gpl-v2 + +PKG_DESTDIR_SUPPORT= user-destdir DEPENDS+= ${PYPKGPREFIX}-dns>=1.6.0:../../net/py-dns +MANCOMPRESSED= yes NO_BUILD= yes PYTHON_PATCH_SCRIPTS= sshfp diff --git a/security/sshfp/distinfo b/security/sshfp/distinfo index 893cd26c58a..9e3591eba43 100644 --- a/security/sshfp/distinfo +++ b/security/sshfp/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.1.1.1 2008/07/31 10:21:21 agc Exp $ +$NetBSD: distinfo,v 1.2 2009/11/17 12:23:01 tron Exp $ SHA1 (sshfp-1.1.3.tar.gz) = bf42c956a992ac9442e9bbaa4af8f5599f321c2b RMD160 (sshfp-1.1.3.tar.gz) = 9b325ed30e75e0f485eea11676a420932f5c9b1e Size (sshfp-1.1.3.tar.gz) = 15477 bytes -SHA1 (patch-aa) = 020c5799cf883a7de7d3ba345a2b413f10c16be1 +SHA1 (patch-aa) = c6a00eb486790e9d489a4f476785986209a1c11e +SHA1 (patch-ab) = b91c5a45302960c39f00e82b945eaac0e7304cf0 diff --git a/security/sshfp/patches/patch-aa b/security/sshfp/patches/patch-aa index f2b8f155652..90003eba0a4 100644 --- a/security/sshfp/patches/patch-aa +++ b/security/sshfp/patches/patch-aa @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.1.1.1 2008/07/31 10:21:21 agc Exp $ +$NetBSD: patch-aa,v 1.2 2009/11/17 12:23:01 tron Exp $ --- Makefile 2008/07/31 09:38:52 1.1 +++ Makefile 2008/07/31 09:37:43 @@ -13,11 +13,3 @@ $NetBSD: patch-aa,v 1.1.1.1 2008/07/31 10:21:21 agc Exp $ all: man-page -@@ -14,7 +14,6 @@ - install -m 0755 sshfp $(BIN) - install -d 0755 $(MAN) - install -m 0644 sshfp.1 $(MAN) -- gzip $(MAN)/sshfp.1 - - man-page: - nroff -man sshfp.1 > sshfp.1.txt diff --git a/security/sshfp/patches/patch-ab b/security/sshfp/patches/patch-ab new file mode 100644 index 00000000000..4b326d6f3f5 --- /dev/null +++ b/security/sshfp/patches/patch-ab @@ -0,0 +1,49 @@ +$NetBSD: patch-ab,v 1.1 2009/11/17 12:23:01 tron Exp $ + +Fix deprecation warnings under Python 2.6. + +--- sshfp.orig 2007-05-15 22:10:26.000000000 +0100 ++++ sshfp 2009-11-17 11:54:50.000000000 +0000 +@@ -8,9 +8,17 @@ + import sys + import getopt + import base64 +-import sha ++ ++try: ++ import hashlib ++ SHA1_CLASS = hashlib.sha1 ++except ImportError: ++ import sha ++ SHA1_CLASS = sha.sha ++ + import commands + import time ++import subprocess + # www.dnspython.org + try: + import dns.resolver +@@ -58,7 +66,9 @@ + except TypeError: + print "FAILED on hostname "+hostname+" with keyblob "+keyblob + return "ERROR" +- fpsha1 = sha.new(rawkey).hexdigest() ++ sha1 = SHA1_CLASS() ++ sha1.update(rawkey) ++ fpsha1 = sha1.hexdigest() + # check for Reverse entries + reverse = 1 + parts = hostname.split(".",3) +@@ -183,7 +193,11 @@ + cmd = "ssh-keyscan -p %s -T %s -t %s %s" % (port, timeout, algo, hosts) + if quiet: + cmd = cmd + " 2>/dev/null" +- tochild, fromchild, childerror = os.popen3(cmd, 'r') ++ cmd_pipe = subprocess.Popen(cmd, shell = True, stdin = subprocess.PIPE, ++ stdout = subprocess.PIPE, stderr = subprocess.PIPE, close_fds = True) ++ tochild = cmd_pipe.stdin ++ fromchild = cmd_pipe.stdout ++ childerror = cmd_pipe.stderr + err = childerror.readlines() + khdns = "\n".join(fromchild.readlines()) + for e in err: |