[pacman-dev] python-2.7 and pacman test-suite

Rémy Oudompheng remyoudompheng at gmail.com
Mon Sep 27 14:22:02 EDT 2010


Dan McGee <dpmcgee at gmail.com> wrote:
> On Mon, Sep 27, 2010 at 12:31 PM, Rémy Oudompheng
> <remyoudompheng at gmail.com> wrote:
>> If I'm diagnosing correctly, with python 2.6, the generated package
>> files contain a ".PKGINFO" file, while python2.7 creates packages
>> containing a file "./.PKGINFO" and libalpm complains saying the
>> package is malformed.
>
> Looking quickly at the code here, I'm a bit surprised how we do it.
> The behavior of os.walk() might have changed in what it is returning?

It prepends "./", probably because we call os.walk("."). There's a
trivial fix, but I just find it terribly ugly.

-- 
Rémy
-------------- next part --------------
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 48d79a3..3095864 100755
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -168,9 +168,9 @@ def makepkg(self, path):
         # package files
         for root, dirs, files in os.walk('.'):
             for d in dirs:
-                tar.add(os.path.join(root, d), recursive=False)
+                tar.add(os.path.join(root[2:], d), recursive=False)
             for f in files:
-                tar.add(os.path.join(root, f))
+                tar.add(os.path.join(root[2:], f))
 
         tar.close()
 


More information about the pacman-dev mailing list