svn commit: r366228 - in head/devel/pybugz: . files

Chris Rees crees at FreeBSD.org
Tue Aug 26 17:20:12 UTC 2014


Author: crees
Date: Tue Aug 26 17:20:10 2014
New Revision: 366228
URL: http://svnweb.freebsd.org/changeset/ports/366228
QAT: https://qat.redports.org/buildarchive/r366228/

Log:
  Update to 0.10.1
  
  Incorporate some fixes from upstream
  
  PR:		ports/192346
  Submitted by:	swills
  Obtained from:	https://github.com/williamh/pybugz/commit/3a3d736f409b59d1cbff1eba1f06aa35f61829ad

Added:
  head/devel/pybugz/files/
  head/devel/pybugz/files/patch-bugz__cli.py   (contents, props changed)
Modified:
  head/devel/pybugz/Makefile
  head/devel/pybugz/distinfo

Modified: head/devel/pybugz/Makefile
==============================================================================
--- head/devel/pybugz/Makefile	Tue Aug 26 17:15:18 2014	(r366227)
+++ head/devel/pybugz/Makefile	Tue Aug 26 17:20:10 2014	(r366228)
@@ -1,10 +1,8 @@
 # $FreeBSD$
 
 PORTNAME=	pybugz
-PORTVERSION=	0.9.3
-PORTREVISION=	2
+PORTVERSION=	0.10.1
 CATEGORIES=	devel
-MASTER_SITES=	http://www.bayofrum.net/dist/${PORTNAME}/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	crees at FreeBSD.org
@@ -12,9 +10,11 @@ COMMENT=	Command line tools for interact
 
 LICENSE=	GPLv2
 
-WRKSRC=		${WRKDIR}/${PORTNAME}
-USE_PYTHON=	2
-USE_PYDISTUTILS=yes
-PYDISTUTILS_AUTOPLIST=	yes
+USE_GITHUB=	yes
+GH_ACCOUNT=	williamh
+GH_COMMIT=	74a57cb
+
+USES=		python:2
+USE_PYTHON=	distutils autoplist
 
 .include <bsd.port.mk>

Modified: head/devel/pybugz/distinfo
==============================================================================
--- head/devel/pybugz/distinfo	Tue Aug 26 17:15:18 2014	(r366227)
+++ head/devel/pybugz/distinfo	Tue Aug 26 17:20:10 2014	(r366228)
@@ -1,2 +1,2 @@
-SHA256 (pybugz-0.9.3.tar.gz) = cc572ac66f372fe222e5e6e390c295b6fde1b72debdd1d9fa23c67b1d218daa7
-SIZE (pybugz-0.9.3.tar.gz) = 232381
+SHA256 (pybugz-0.10.1.tar.gz) = e8bd14e11b4c244767216dffcfa1bf5b4058d296638c6509f43dd84be8156cec
+SIZE (pybugz-0.10.1.tar.gz) = 23142

Added: head/devel/pybugz/files/patch-bugz__cli.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pybugz/files/patch-bugz__cli.py	Tue Aug 26 17:20:10 2014	(r366228)
@@ -0,0 +1,71 @@
+--- ./bugz/cli.py.orig	2012-05-06 20:37:35.000000000 +0000
++++ ./bugz/cli.py	2014-08-02 20:38:22.976386635 +0000
+@@ -29,6 +29,7 @@
+ """
+ 
+ DEFAULT_COOKIE_FILE = '.bugz_cookie'
++DEFAULT_TOKEN_FILE = '.bugz_token'
+ DEFAULT_NUM_COLS = 80
+ 
+ #
+@@ -143,6 +144,12 @@
+ 		except IOError:
+ 			pass
+ 
++		self.token_file = os.path.join(os.environ['HOME'], DEFAULT_TOKEN_FILE)
++		try:
++			self.token = open(self.token_file).read().strip()
++		except IOError:
++			self.token = None
++
+ 		if getattr(args, 'encoding'):
+ 			self.enc = args.encoding
+ 		else:
+@@ -170,16 +177,21 @@
+ 	def get_input(self, prompt):
+ 		return raw_input(prompt)
+ 
++	def set_token(self, *args):
++		if args and self.token:
++			args[0]['Bugzilla_token'] = self.token
++		return args
++
+ 	def bzcall(self, method, *args):
+ 		"""Attempt to call method with args. Log in if authentication is required.
+ 		"""
+ 		try:
+-			return method(*args)
++			return method(*self.set_token(*args))
+ 		except xmlrpclib.Fault, fault:
+ 			# Fault code 410 means login required
+ 			if fault.faultCode == 410 and not self.skip_auth:
+ 				self.login()
+-				return method(*args)
++				return method(*self.set_token(*args))
+ 			raise
+ 
+ 	def login(self, args=None):
+@@ -208,10 +220,21 @@
+ 			params['remember'] = True
+ 		self.log('Logging in')
+ 		self.bz.User.login(params)
++		log_info('Logging in')
++		result = self.bz.User.login(params)
++		if 'token' in result:
++			self.token = result['token']
+ 
+ 		if args is not None:
+-			self.cookiejar.save()
+-			os.chmod(self.cookiejar.filename, 0600)
++			if self.token:
++				fd = open(self.token_file, 'w')
++				fd.write(self.token)
++				fd.write('\n')
++				fd.close()
++				os.chmod(self.token_file, 0600)
++			else:
++				self.cookiejar.save()
++				os.chmod(self.cookiejar.filename, 0600)
+ 
+ 	def logout(self, args):
+ 		self.log('logging out')


More information about the svn-ports-head mailing list