Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#12173 closed defect (fixed)

BUG: pextlib tests fail on freebsd/linux

Reported by: afb@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.6
Component: base Version: 1.5
Keywords: FreeBSD support, Linux support Cc: kballard (Lily Ballard), afb@…
Port:

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 (1)

macports-pextlib-tests.patch (1.5 KB) - added by afb@… 17 years ago.
macports-pextlib-tests.patch

Download all attachments as: .zip

Change History (13)

Changed 17 years ago by afb@…

macports-pextlib-tests.patch

comment:1 Changed 17 years ago by afb@…

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

comment:2 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: 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

comment:3 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Cc: eridius@… added

comment:4 Changed 17 years ago by kballard (Lily Ballard)

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.

comment:5 Changed 17 years 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...

comment:6 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Keywords: FreeBSD support added

comment:7 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: Needs developer reviewMacPorts base bugs

Milestone Needs developer review deleted

comment:8 Changed 17 years ago by nox@…

Cc: eridius@… afb@… added; eridius@… removed
Priority: ExpectedNormal
Summary: pextlib tests fail on freebsdBUG: pextlib tests fail on freebsd

comment:9 Changed 17 years ago by afb@…

Keywords: Linux added
Summary: BUG: pextlib tests fail on freebsdBUG: pextlib tests fail on freebsd/linux

comment:10 Changed 17 years ago by kballard (Lily Ballard)

Resolution: fixed
Status: newclosed

Fixed in r29414

comment:11 Changed 16 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:12 Changed 15 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 1.6
Note: See TracTickets for help on using tickets.