Date: Mon, 29 Aug 2011 17:20:34 GMT From: Ruslan Mahmatkhanov <cvs-src@yandex.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/160288: [PATCH] security/pwman3: eliminate py-pysqlite2x dependency Message-ID: <201108291720.p7THKYTq039250@red.freebsd.org> Resent-Message-ID: <201108291730.p7THUC7B043390@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 160288 >Category: ports >Synopsis: [PATCH] security/pwman3: eliminate py-pysqlite2x dependency >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Aug 29 17:30:12 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Ruslan Mahmatkhanov >Release: 9.0-BETA1 >Organization: >Environment: 9.0-BETA1 i386 >Description: pwman3 is requires python 2.5+ (via USE_PYTHON) but it actually uses deprecated python24 API for accessing sqlite databases and when dealing with celementtree. So i added a couple of simple patches that make it work with sqlite3 and xml.etree.cElementTree. And all is working fine on python27 with this patches: """ [rm@smeshariki3 ~]> pwman3 Please enter your new password: Please enter your new password again: Pwman3 0.0.6 (c) Ivan Kelly <pwman@bleurgh.com> pwman> help Documented commands (type help <topic>): ======================================== EOF delete exit filter help list new print save tags clear edit export forget import ls passwd rm set pwman> help new Usage: new Creates a new node. pwman> new Username: popo Password (Blank to generate): Password length (default 7): 7 New password: YImvIoR Url: Notes: Tags: Password ID: 1 pwman> list Current tags: None 1. popo@ pwman> ls Current tags: None 1. popo@ pwman> passwd Please enter your current password: Please enter your new password: Please enter your new password again: """ This is the last consumer of databases/py-pysqlite23 and now it doesn't need python24 too. - while i'm here, fix whitespace issues in pkg-descr - bump portrevision >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruNa pwman3.orig/Makefile pwman3/Makefile --- pwman3.orig/Makefile 2008-05-06 07:09:35.000000000 +0400 +++ pwman3/Makefile 2011-08-29 21:13:44.000000000 +0400 @@ -7,6 +7,7 @@ PORTNAME= pwman3 PORTVERSION= 0.0.6 +PORTREVISION= 1 CATEGORIES= security python MASTER_SITES= http://pwman.bleurgh.com/~ivan/pwman3/source/ \ http://source.antisupport.com/pwman3/ @@ -16,8 +17,7 @@ COMMENT= Console password management application with sql storage RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycrypto>=2.0:${PORTSDIR}/security/py-pycrypto \ - ${PYTHON_PKGNAMEPREFIX}cElementTree>=1.0.5:${PORTSDIR}/devel/py-celementtree \ - ${PYTHON_PKGNAMEPREFIX}pysqlite>=2.0.5:${PORTSDIR}/databases/py-pysqlite23 + ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:${PORTSDIR}/databases/py-sqlite3 USE_PYTHON= 2.5+ USE_PYDISTUTILS= yes diff -ruNa pwman3.orig/files/patch-pwman-data-drivers_sqlite.py pwman3/files/patch-pwman-data-drivers_sqlite.py --- pwman3.orig/files/patch-pwman-data-drivers_sqlite.py 1970-01-01 03:00:00.000000000 +0300 +++ pwman3/files/patch-pwman-data-drivers_sqlite.py 2011-08-29 21:05:06.000000000 +0400 @@ -0,0 +1,11 @@ +--- pwman/data/drivers/sqlite.py.orig 2007-02-04 21:44:43.000000000 +0300 ++++ pwman/data/drivers/sqlite.py 2011-08-29 21:02:34.000000000 +0400 +@@ -22,7 +22,7 @@ + from pwman.data.nodes import Node + from pwman.data.tags import Tag + +-from pysqlite2 import dbapi2 as sqlite ++from sqlite3 import dbapi2 as sqlite + import pwman.util.config as config + import cPickle + diff -ruNa pwman3.orig/files/patch-pwman-exchange_exporter.py pwman3/files/patch-pwman-exchange_exporter.py --- pwman3.orig/files/patch-pwman-exchange_exporter.py 1970-01-01 03:00:00.000000000 +0300 +++ pwman3/files/patch-pwman-exchange_exporter.py 2011-08-29 21:09:10.000000000 +0400 @@ -0,0 +1,11 @@ +--- pwman/exchange/exporter.py.orig 2007-02-04 21:44:43.000000000 +0300 ++++ pwman/exchange/exporter.py 2011-08-29 21:07:59.000000000 +0400 +@@ -17,7 +17,7 @@ + # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net> + #============================================================================ + +-from cElementTree import Element, SubElement, dump, ElementTree ++from xml.etree.cElementTree import Element, SubElement, dump, ElementTree + from pwman.data.nodes import Node + from pwman.data.tags import Tag + diff -ruNa pwman3.orig/files/patch-pwman-exchange_importer.py pwman3/files/patch-pwman-exchange_importer.py --- pwman3.orig/files/patch-pwman-exchange_importer.py 1970-01-01 03:00:00.000000000 +0300 +++ pwman3/files/patch-pwman-exchange_importer.py 2011-08-29 21:09:20.000000000 +0400 @@ -0,0 +1,11 @@ +--- pwman/exchange/importer.py.orig 2007-02-04 21:44:43.000000000 +0300 ++++ pwman/exchange/importer.py 2011-08-29 21:07:49.000000000 +0400 +@@ -17,7 +17,7 @@ + # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net> + #============================================================================ + +-import cElementTree as ET ++import xml.etree.cElementTree as ET + from pwman.data.nodes import Node + from pwman.data.tags import Tag + diff -ruNa pwman3.orig/pkg-descr pwman3/pkg-descr --- pwman3.orig/pkg-descr 2008-05-06 07:09:35.000000000 +0400 +++ pwman3/pkg-descr 2011-08-29 21:03:41.000000000 +0400 @@ -1,5 +1,5 @@ -Pwman3 is a console based password management application. -Pwman3 is written in python. It uses sql for storage +Pwman3 is a console based password management application. +Pwman3 is written in python. It uses sql for storage and all data is encrypted when it isn't being viewed on screen. WWW: http://pwman.bleurgh.com >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108291720.p7THKYTq039250>