Ticket #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: | eridius@…, 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
Change History
Changed 6 years ago by afb@…
- Attachment macports-pextlib-tests.patch added
comment:2 Changed 6 years 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
comment:4 Changed 6 years 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.
comment:5 Changed 6 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:7 Changed 6 years ago by jmpp@…
- Milestone changed from Needs developer review to MacPorts base bugs
Milestone Needs developer review deleted
comment:8 Changed 6 years 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
comment:9 Changed 6 years ago by afb@…
- Keywords support, Linux added
- Summary changed from BUG: pextlib tests fail on freebsd to BUG: pextlib tests fail on freebsd/linux
comment:10 Changed 6 years ago by eridius@…
- Status changed from new to closed
- Resolution set to fixed
Fixed in r29414
comment:11 Changed 5 years ago by toby@…
- Milestone changed from MacPorts base bugs to MacPorts Future
Milestone MacPorts base bugs deleted


macports-pextlib-tests.patch