Package: linda
Version: 0.3.26

If you set TMPDIR to a value with more than one path component, eg
/root/tmp, then linda fails to build because it fails the test
test_iterate_dir in base_funcs.py.

This is because the process used for stripping the prefix directory
(which came from tempfile.mkdtemp) from the results of the iteration
assumes that dir is "/tmp/<something>", and that it can therefore be
removed by removing the first three /-separated components.

Not only is this incorrect, it also fails to check that all of the
generated filenames start with the nominated temporary directory.

The patch below fixes this problem by removing exactly the expected
initial prefix string, which is (dir+'/'), and failing if it finds
paths not starting with the expected prefix.

I have tested this fix on a current Ubuntu gutsy and there is no
reason to think it won't work on Debian too.

Ian.

diff -ru orig/linda-0.3.26/debian/changelog linda-0.3.26/debian/changelog
--- orig/linda-0.3.26/debian/changelog  2007-06-16 13:08:50.000000000 +0100
+++ linda-0.3.26/debian/changelog       2007-10-11 19:03:41.000000000 +0100
@@ -1,3 +1,10 @@
+linda (0.3.26ubuntu1) gutsy; urgency=low
+
+  * Cope with TMPDIR being set to a pathname with >1 component.
+    Fixes autopkgest FTBFS, LP: #137187.
+
+ -- Ian Jackson <[EMAIL PROTECTED]>  Thu, 11 Oct 2007 19:03:37 +0100
+
 linda (0.3.26) unstable; urgency=low
 
   * LibraryCheck:
Only in linda-0.3.26/debian: changelog~
diff -ru orig/linda-0.3.26/tests/base_funcs.py linda-0.3.26/tests/base_funcs.py
--- orig/linda-0.3.26/tests/base_funcs.py       2005-03-25 11:20:58.000000000 
+0000
+++ linda-0.3.26/tests/base_funcs.py    2007-10-11 19:05:58.000000000 +0100
@@ -19,7 +19,8 @@
         f.close()
         files = iterate_dir(dir)
         for x in range(len(files)):
-            files[x] = '/'.join(files[x].split('/')[3:])
+            self.assertEqual(files[x][0:len(dir)+1], dir+'/')
+            files[x] = files[x][len(dir)+1:]
         vals = Set(('a', 'b/c'))
         self.assertEqual(vals.intersection(files), vals)
         shutil.rmtree(dir)
Only in linda-0.3.26/tests: base_funcs.py~



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to