Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id A2CF77A220 for ; Mon, 9 Jan 2017 12:02:25 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 1601F8558B; Mon, 9 Jan 2017 12:02:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9951785583 for ; Mon, 9 Jan 2017 12:02:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 7jc4p9RgjZC8 for ; Mon, 9 Jan 2017 12:02:24 +0000 (UTC) Received: from cvs.NetBSD.org (unknown [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 18AC98557E for ; Mon, 9 Jan 2017 12:02:24 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0F365FBA6; Mon, 9 Jan 2017 12:02:24 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1483963344153040" MIME-Version: 1.0 Date: Mon, 9 Jan 2017 12:02:24 +0000 From: "Joerg Sonnenberger" Subject: CVS commit: pkgsrc/print/py-Pdf To: pkgsrc-changes@NetBSD.org Reply-To: joerg@netbsd.org X-Mailer: log_accum Message-Id: <20170109120224.0F365FBA6@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk This is a multi-part message in MIME format. --_----------=_1483963344153040 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: joerg Date: Mon Jan 9 12:02:23 UTC 2017 Modified Files: pkgsrc/print/py-Pdf: Makefile distinfo pkgsrc/print/py-Pdf/patches: patch-pyPdf_pdf.py Log Message: Ensure that renaming on page merge actually creates unique names. Bump revision. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 pkgsrc/print/py-Pdf/Makefile cvs rdiff -u -r1.5 -r1.6 pkgsrc/print/py-Pdf/distinfo cvs rdiff -u -r1.1 -r1.2 pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1483963344153040 Content-Disposition: inline Content-Length: 3093 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/print/py-Pdf/Makefile diff -u pkgsrc/print/py-Pdf/Makefile:1.6 pkgsrc/print/py-Pdf/Makefile:1.7 --- pkgsrc/print/py-Pdf/Makefile:1.6 Thu Jan 23 14:38:42 2014 +++ pkgsrc/print/py-Pdf/Makefile Mon Jan 9 12:02:23 2017 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.6 2014/01/23 14:38:42 wiz Exp $ +# $NetBSD: Makefile,v 1.7 2017/01/09 12:02:23 joerg Exp $ DISTNAME= pyPdf-1.13 PKGNAME= ${PYPKGPREFIX}-Pdf-1.13 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= print python MASTER_SITES= http://pybrary.net/pyPdf/ Index: pkgsrc/print/py-Pdf/distinfo diff -u pkgsrc/print/py-Pdf/distinfo:1.5 pkgsrc/print/py-Pdf/distinfo:1.6 --- pkgsrc/print/py-Pdf/distinfo:1.5 Wed Nov 4 01:01:38 2015 +++ pkgsrc/print/py-Pdf/distinfo Mon Jan 9 12:02:23 2017 @@ -1,9 +1,9 @@ -$NetBSD: distinfo,v 1.5 2015/11/04 01:01:38 agc Exp $ +$NetBSD: distinfo,v 1.6 2017/01/09 12:02:23 joerg Exp $ SHA1 (pyPdf-1.13.tar.gz) = ba7aed11cf21a2c218df2e3979be5eb90992dcbe RMD160 (pyPdf-1.13.tar.gz) = 0669d4a93c20fcd899d15ff42cb1b8b908f28e3b SHA512 (pyPdf-1.13.tar.gz) = 1c00a5a6658054671a396e7b334cbeb9e26dc1e3ad9668e212d05a9483f164931d8bd14fb9ab4d083d7ca3999fee7a2e9eea55b604a06c7d5d0632f0791b7598 Size (pyPdf-1.13.tar.gz) = 35699 bytes SHA1 (patch-pyPdf_generic.py) = c661b2fd4cea8679ac551733ea25b7efa9fbb37d -SHA1 (patch-pyPdf_pdf.py) = b4e2822531b6d54676c1d7e5d672e1fe50f50ee5 +SHA1 (patch-pyPdf_pdf.py) = 560fbb475c976fc2c0e653d8a17e4a4277ac5a06 SHA1 (patch-pyPdf_utils.py) = 11b14d0c3bdbdac04312f1a4f8eb9f27c6d09009 Index: pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py diff -u pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py:1.1 pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py:1.2 --- pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py:1.1 Thu Jan 23 14:38:42 2014 +++ pkgsrc/print/py-Pdf/patches/patch-pyPdf_pdf.py Mon Jan 9 12:02:23 2017 @@ -1,6 +1,7 @@ -$NetBSD: patch-pyPdf_pdf.py,v 1.1 2014/01/23 14:38:42 wiz Exp $ +$NetBSD: patch-pyPdf_pdf.py,v 1.2 2017/01/09 12:02:23 joerg Exp $ python-3.x compatibility. +When renaming resources, make sure that the new name is actually new. --- pyPdf/pdf.py.orig 2010-12-04 22:49:56.000000000 +0000 +++ pyPdf/pdf.py @@ -51,3 +52,18 @@ python-3.x compatibility. user_password, key = self._authenticateUserPassword(password) if user_password: self._decryption_key = key +@@ -1062,7 +1062,13 @@ class PageObject(DictionaryObject): + renameRes = {} + for key in page2Res.keys(): + if newRes.has_key(key) and newRes[key] != page2Res[key]: +- newname = NameObject(key + "renamed") ++ base_newkey = key + "renamed" ++ newkey = base_newkey ++ counter = 0 ++ while newRes.has_key(newkey) or page2Res.has_key(newkey): ++ newkey = "%s%d" % (base_newkey, counter) ++ counter = counter + 1 ++ newname = NameObject(newkey) + renameRes[key] = newname + newRes[newname] = page2Res[key] + elif not newRes.has_key(key): --_----------=_1483963344153040--