Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2010 21:32:34 GMT
From:      Edmondas Girkantas <eg@fbsd.lt>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/143070: [UPDATE] database/gadfly fix for working with python 2.6
Message-ID:  <201001212132.o0LLWYtE003322@www.freebsd.org>
Resent-Message-ID: <201001212140.o0LLe4Iw042843@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         143070
>Category:       ports
>Synopsis:       [UPDATE] database/gadfly fix for working with python 2.6
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 21 21:40:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Edmondas Girkantas
>Release:        8.0-STABLE
>Organization:
>Environment:
FreeBSD big.bug.lt 8.0-STABLE FreeBSD 8.0-STABLE #11: Sun Dec  6 16:14:27 EET 2009     eg@big.bug.lt:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
bindings.py file uses reserved word "as" and it should be renamed, because this database library will not work on system with python 2.6
>How-To-Repeat:
try to run gfplus utility:

big# gfplus
/usr/local/lib/python2.6/site-packages/gadfly/store.py:11: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import sys, os, md5, types, marshal

gfplus $Revision: 1.6 $ -- Interactive gadfly shell  [readline]

Thursday January 21, 2010 11:24 PM
Using: 
DB Name: test
DB Location: .
Traceback (most recent call last):
  File "/usr/local/bin/gfplus", line 3, in <module>
    main()
  File "/usr/local/lib/python2.6/site-packages/gadfly/scripts/gfplus.py", line 269, in main
    shell = GadflyShell()
  File "/usr/local/lib/python2.6/site-packages/gadfly/scripts/gfplus.py", line 124, in __init__
    self.db = gadfly.gadfly(dbase,loc)
  File "/usr/local/lib/python2.6/site-packages/gadfly/database.py", line 26, in __init__
    from gadfly import sql, bindings
  File "/usr/local/lib/python2.6/site-packages/gadfly/bindings.py", line 64
    [create, view, name, namelist, as, selection] = l
                                    ^
SyntaxError: invalid syntax

>Fix:
apply given patch

Patch attached with submission follows:

diff -ruN gadfly.orig/Makefile gadfly/Makefile
--- gadfly.orig/Makefile	2010-01-21 23:04:55.000000000 +0200
+++ gadfly/Makefile	2010-01-21 23:20:58.000000000 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	gadfly
 PORTVERSION=	1.0.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	databases
 MASTER_SITES=	SF
 
diff -ruN gadfly.orig/files/patch-bindngs gadfly/files/patch-bindngs
--- gadfly.orig/files/patch-bindngs	1970-01-01 03:00:00.000000000 +0300
+++ gadfly/files/patch-bindngs	2010-01-21 23:11:57.000000000 +0200
@@ -0,0 +1,34 @@
+--- gadfly/bindings.py.orig	2010-01-21 23:10:47.000000000 +0200
++++ gadfly/bindings.py	2010-01-21 23:11:28.000000000 +0200
+@@ -61,7 +61,7 @@
+ 
+ # create view statement stuff
+ def createview(l, c):
+-    [create, view, name, namelist, as, selection] = l
++    [create, view, name, namelist, as_, selection] = l
+     return semantics.CreateView(name, namelist, selection)
+ 
+ optnamelist0 = returnNone
+@@ -288,11 +288,11 @@
+     return others
+ 
+ def trl1as(l,c):
+-    [name, as, alias] = l
++    [name, as_, alias] = l
+     return [(name, alias)]
+ 
+ def trlnas(l,c):
+-    [name, as, alias, comma, others] = l
++    [name, as_, alias, comma, others] = l
+     others.insert(0, (name, alias))
+     return others
+ 
+@@ -546,7 +546,7 @@
+     return (exp, None) # no binding!
+ 
+ def selectname(list, context):
+-    [exp, as, alias] = list
++    [exp, as_, alias] = list
+     return (exp, alias)
+ 
+ colalias = elt0
diff -ruN gadfly.orig/pkg-plist gadfly/pkg-plist
--- gadfly.orig/pkg-plist	2010-01-21 23:04:55.000000000 +0200
+++ gadfly/pkg-plist	2010-01-21 23:31:31.000000000 +0200
@@ -4,6 +4,8 @@
 %%PYTHON_SITELIBDIR%%/gadfly/__init__.pyc
 %%PYTHON_SITELIBDIR%%/gadfly/__init__.pyo
 %%PYTHON_SITELIBDIR%%/gadfly/bindings.py
+%%PYTHON_SITELIBDIR%%/gadfly/bindings.pyc
+%%PYTHON_SITELIBDIR%%/gadfly/bindings.pyo
 %%PYTHON_SITELIBDIR%%/gadfly/client.py
 %%PYTHON_SITELIBDIR%%/gadfly/client.pyc
 %%PYTHON_SITELIBDIR%%/gadfly/client.pyo


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001212132.o0LLWYtE003322>