Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12173 (closed defect: fixed)

Opened 14 months ago

Last modified 11 months ago

BUG: pextlib tests fail on freebsd/linux

Reported by: afb@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts base bugs
Component: base Version: 1.5
Keywords: FreeBSD support, Linux support Cc: eridius@…, afb@…

Description

checksums.tcl fails with:

[md5 file $testfile] != "91d3ef5cd86741957b0b5d8f8911166d"

fs-traverse.tcl fails with:

Found `/tmp/macports-pextlib-fs-traverse/a/c/a/a', expected `/tmp/macports-pextlib-fs-traverse/a/c/a//a'
Found `/tmp/macports-pextlib-fs-traverse/a/c/a/b', expected `/tmp/macports-pextlib-fs-traverse/a/c/a//b'
Found `/tmp/macports-pextlib-fs-traverse/a/c/a/c', expected `/tmp/macports-pextlib-fs-traverse/a/c/a//c'
Found `/tmp/macports-pextlib-fs-traverse/a/c/a/d', expected `/tmp/macports-pextlib-fs-traverse/a/c/a//d'

Attachments

macports-pextlib-tests.patch (1.5 kB) - added by afb@… 14 months ago.
macports-pextlib-tests.patch

Change History

Changed 14 months ago by afb@…

macports-pextlib-tests.patch

Changed 14 months ago by afb@…

Neither is library failure, but broken test cases...

Changed 14 months ago by jmpp@…

  • milestone set to Needs developer review

Setting to "needs dev review" milestone and Cc'ing eridius, as he wrote fs-traverse and the test cases (and maybe he can also give some input on the md5 failure).

-jmpp

Changed 14 months ago by jmpp@…

  • cc eridius@… added

Changed 14 months ago by eridius@…

  • cc eridius@… added; eridius@… removed

Ok, I've fixed checksums.tcl as that wasn't a FreeBSD issue but a locale issue. As for fs-traverse, I'm rather curious about the differences your patch implies. On Darwin if I have a slash at the end of a folder and I iterate it, I get a double-slash in the child files as fts_read takes the given path, appends the path separator, and the child (and the given path in this case ends with a slash already). Your patch implies FreeBSD actually checks to make sure the given path doesn't have a slash before appending one.

Can you try the following for me and paste the results:

cd /tmp
mkdir a
ln -s a b
touch a/{a,b,c}
find a
find b
find a/
find b/

Thanks.

Changed 14 months ago by afb@…

FreeBSD and the rest of the modern world, the diff I found showed it fixed in 1997...

@@ -249,12 +253,12 @@ fts_close(sp)
 }
 
 /*
- * Special case a root of "/" so that slashes aren't appended which would
- * cause paths to be written as "//foo".
+ * Special case of "/" at the end of the path so that slashes aren't
+ * appended which would cause paths to be written as "....//foo".
  */
 #define	NAPPEND(p)							\
-	(p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 &&	\
-	    p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
+	(p->fts_path[p->fts_pathlen - 1] == '/'				\
+	    ? p->fts_pathlen - 1 : p->fts_pathlen)
 
 FTSENT *
 fts_read(sp)

Changed your test script to use "touch a/a a/b a/c" so it worked, and it said:

a/
a/a
a/b
a/c
b/
b/a
b/b
b/c

So yes, you implied correctly that the double-slash is Darwin-only...

Changed 14 months ago by jmpp@…

  • keywords FreeBSD support added

Changed 13 months ago by jmpp@…

  • milestone changed from Needs developer review to MacPorts base bugs

Milestone Needs developer review deleted

Changed 13 months ago by nox@…

  • cc eridius@…, afb@… added; eridius@… removed
  • priority changed from Expected to Normal
  • summary changed from pextlib tests fail on freebsd to BUG: pextlib tests fail on freebsd

Changed 12 months ago by afb@…

  • keywords support, Linux added
  • summary changed from BUG: pextlib tests fail on freebsd to BUG: pextlib tests fail on freebsd/linux

Changed 11 months ago by eridius@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r29414

Note: See TracTickets for help on using tickets.