Re: jhbuild error



Works great now ! Here's the diff - do you want me to commit it for you
?

Rgds,
Biswa.

On Thu, 2002-12-19 at 15:55, James Henstridge wrote:
> 
> 
> Biswapesh Chattopadhyay wrote:
> 
> >>On Thu, Dec 19, 2002 at 02:46:57PM +0530, Biswapesh Chattopadhyay wrote:
> >>
> >>
> >>>Can anyone tell me how to fix this (happens when I run jhbuild):
> >>>
> >>>  File "/opt/gnome/src/jhbuild/jhbuild.py", line 142
> >>>    module_list = [ module_set.modules[modname] for modname in args ]
> >>>
> >>>This is fresh checkout of jhbuild from CVS.
> >>>
> >>>
> >>That is not the full error message it gives you (for example, the last
> >>line will be the type of exception thrown and maybe an explanatory
> >>string). Can you post the full error message, please?
> >>
> >>
> >There si just a 'syntax error' line after this:
> >--------------------
> >  File "/opt/gnome/src/jhbuild/jhbuild.py", line 142
> >    module_list = [ module_set.modules[modname] for modname in args ]
> >                                                  ^
> >SyntaxError: invalid syntax
> >---------------------
> >
> That line is a list comprehension, which is a feature added in Python
> 2.0 (released a bit over 2 years ago).  I will add a check to make sure
> installing jhbuild picks an appropriate Python in the future.
> 
> Does anyone have a problem with jhbuild requiring a version of Python
> newer than 1.5.2?  The newer versions of Python allow writing
> signficantly cleaner code, so I would prefer not to code to the lowest
> common denominator.  The list comprehensions can be rewritten with
> map/lambda, but they end up looking more messy than list comprehensions
> if you can't rely on nested scopes (which were implemented in an even
> newer Python).
> 
> >
> >
> >
> >>Also, better mention what platform you are using and which version of
> >>Python.
> >>
> >>
> >RH 7.3 Python version 1.5.2. But I've tried with python2 and python2.2.
> >They just give errors at different places. With python2:
> >---------------------------------------------
> >Traceback (most recent call last):
> >  File "/opt/gnome/src/jhbuild/jhbuild.py", line 22, in ?
> >    import module
> >  File "/opt/gnome/src/jhbuild/module.py", line 52, in ?
> >    class CVSModule(Package):
> >  File "/opt/gnome/src/jhbuild/module.py", line 84, in CVSModule
> >    def do_checkout(self, buildscript, force_checkout=False):
> >NameError: name 'False' is not defined
> >---------------------------------------------
> >
> >With python2.2, it's the same as python2.
> >
> >
> In the new code I have been writing in jhbuild, I made use of the True
> and False constants which were introduced for Python 2.3, and backported
> to Python 2.2.1.  I put in some compatibility code in jhbuild.py to make
> it work with older versions, but it looks like it doesn't get run early
> enough.  I will check in a fix for this tonight, but if you want to fix
> your local copy edit jhbuild.py and move the import of module and
> moduleinfo below the block that sets __builtins__.True and False.
> 
> Thanks for the bug report.
> 
> James.
> 
> --
> Email: james daa com au              | Linux.conf.au
> http://linux.conf.au/
> WWW:   http://www.daa.com.au/~james/ | Jan 22-25   Perth, Western
> Australia.
> 
> 
> 
> 

? python.diff
Index: Makefile
===================================================================
RCS file: /cvs/gnome/jhbuild/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- Makefile	6 Jul 2002 03:00:58 -0000	1.8
+++ Makefile	19 Dec 2002 10:40:15 -0000
@@ -16,7 +16,7 @@
 	@echo "Creating $(bindir)/jhbuild"
 	@mkdir -p $(bindir)
 	@echo '#!/bin/sh' > $(bindir)/jhbuild
-	@echo 'python '`pwd`'/jhbuild.py "$$@"' >> $(bindir)/jhbuild
+	@echo 'python2 '`pwd`'/jhbuild.py "$$@"' >> $(bindir)/jhbuild
 	@chmod a+x $(bindir)/jhbuild
 	@[ -f $(HOME)/.jhbuildrc ]||echo "Don't forget to create ~/.jhbuildrc"
 	install -m755 install-check $(bindir)/install-check
Index: jhbuild.py
===================================================================
RCS file: /cvs/gnome/jhbuild/jhbuild.py,v
retrieving revision 1.23
diff -u -r1.23 jhbuild.py
--- jhbuild.py	17 Dec 2002 14:57:13 -0000	1.23
+++ jhbuild.py	19 Dec 2002 10:40:17 -0000
@@ -19,12 +19,12 @@
 
 import sys, os, string, getopt
 
-import module
-import moduleinfo
-
 if not hasattr(__builtins__, 'True'):
     __builtins__.True = (1 == 1)
     __builtins__.False = (1 != 1)
+
+import module
+import moduleinfo
 
 usage = 'usage: jhbuild [ -f config ] command [ options ... ]'
 help = '''Build a set of CVS modules (such as GNOME).
****** Message from InterScan E-Mail VirusWall NT ******


NO VIRUS FOUND: SERVER GENERATED MESSAGE
*****************     End of message     ***************



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]