Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix script/score.tlu: compare realpath instead of basename #26

Merged
merged 1 commit into from Aug 3, 2018
Merged

fix script/score.tlu: compare realpath instead of basename #26

merged 1 commit into from Aug 3, 2018

Conversation

@e-kwsm
Copy link
Contributor

@e-kwsm e-kwsm commented Aug 3, 2018

For example texdoc -Il thesis returns lists in arbitrary orders:

$  diff -U1 <(texdoc -Il thesis) <(texdoc -Il thesis)
--- /proc/self/fd/11	2018-08-03 14:20:14.060909785 +0900
+++ /proc/self/fd/12	2018-08-03 14:20:14.060909785 +0900
@@ -33,17 +33,17 @@
    = [de] Example document / Tutorial (German)
-18 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbArticle/main.pdf
+18 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/Manual/main.pdf
    = [de] Example document / Tutorial (German)
-19 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbLabReportDE/main.pdf
+19 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbInternshipReport/main.pdf
    = [de] Example document / Tutorial (German)
-20 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbThesisTutorial/main.pdf
+20 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbLabReportDE/main.pdf
    = [de] Example document / Tutorial (German)
-21 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbInternshipReport/main.pdf
+21 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbThesisEN/main.pdf
    = [de] Example document / Tutorial (German)
-22 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbTermReport/main.pdf
+22 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbThesisTutorial/main.pdf
    = [de] Example document / Tutorial (German)
-23 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/Manual/main.pdf
+23 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbArticle/main.pdf
    = [de] Example document / Tutorial (German)
-24 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbThesisEN/main.pdf
+24 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbLabReportEN/main.pdf
    = [de] Example document / Tutorial (German)
-25 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbLabReportEN/main.pdf
+25 /usr/local/texlive/2018/texmf-dist/doc/latex/hagenberg-thesis/examples/HgbTermReport/main.pdf
    = [de] Example document / Tutorial (German)
# ommitted

There are many packages whose names contain "thesis", and some files of them have the same score (e.g., 1.5 to hagenberg-thesis/examples/hgblabreportde/main.pdf, hagenberg-thesis/examples/hgblabreporten/main.pdf and other 8).
The problem is that sort_doclist compares basenames when scores are same, leading to arbitrary order of files whose basenames are same.

@wtsnjp
Copy link
Member

@wtsnjp wtsnjp commented Aug 3, 2018

LGTM 👍

Only one thing: could you please update following comment as well? (maybe something like fullpath are better than filename)

-- 3. then lexicographically by filename

@e-kwsm
Copy link
Contributor Author

@e-kwsm e-kwsm commented Aug 3, 2018

Amended.

@wtsnjp wtsnjp merged commit b3b2872 into TeX-Live:master Aug 3, 2018
2 checks passed
@e-kwsm e-kwsm deleted the fix-sort_doclist branch Aug 3, 2018
@e-kwsm
Copy link
Contributor Author

@e-kwsm e-kwsm commented Aug 5, 2018

else return (a.tree > b.tree)

will be never reached unless full paths conflict.

So the line should be moved up or removed.

@wtsnjp
Copy link
Member

@wtsnjp wtsnjp commented Aug 6, 2018

unless full paths conflict

I think this will very unlikely to happen, but still not zero persent, so I'll just leave this; not harmful at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants