Skip to contentSkip to conversation

problems with tools/pygrub/setup.py and xen/xm/main.py

DISCUSSION peter Bier 2 participants 2 messages Oct 21, 2005

lore
Share & tools
lore

peter Bier

author
#0 lore raw

When making the "unstable" version I got an in "tools". There was a complaint about "cc.has_function" in the following code area in tools/pygrub/setup.py

    if cc.has_function("ext2fs_open"):
       ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
    else :
       sys.stderr.write ("Warning: older veriosn of e2fsprogs installed ...")
       sys.stderr.write (" .... " )
    ext2 = ...

As workaround I simply deleted the entire if - else construct. Make worked then, but I suppose this is not a really satisfactory solution. My python version is 2.2

in xen/xm/main.py I got a problem with the line :

warnings.filterwarnings('ignore', category=FutureWarning );

python complained about FutureWarning being an undefined name.

Commenting this out resulted in code that seems to work properly.

Peter Bier

#1 lore raw
Quoted 11 lines · peter Bier

When making the "unstable" version I got an in "tools". There was a complaint about "cc.has_function" in the following code area in tools/pygrub/setup.py

    if cc.has_function("ext2fs_open"):
       ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
    else :
       sys.stderr.write ("Warning: older veriosn of e2fsprogs installed ...")
       sys.stderr.write (" .... " )
    ext2 = ...
Quoted 2 lines

As workaround I simply deleted the entire if - else construct. Make worked then, but I suppose this is not a really satisfactory solution.

There's a patch for this from Jeremy Katz at
http://bugzilla.xensource.com/bugzilla/attachment.cgi?id=75. Could someone please commit it?

(Signed-Off-By Jeremy available here:
http://lists.xensource.com/archives/html/xen-devel/2005-10/msg01071.html).

Patch also attached for convenience:

tools/pygrub/setup.py +1 -1
diff -r 7c951e3eb5ab tools/pygrub/setup.py
@@ -12,7 +12,7 @@
     ext2defines = []
     cc = new_compiler()
     cc.add_library("ext2fs")
-    if cc.has_function("ext2fs_open2"):
+    if hasattr(cc, "has_function") and cc.has_function("ext2fs_open2"):
         ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
     else:
         sys.stderr.write("WARNING: older version of e2fsprogs installed, not building full\n")

Cheers,
Muli

Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/