-
Notifications
You must be signed in to change notification settings - Fork 45
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 some errors related to .glog file #1632
Fix some errors related to .glog file #1632
Conversation
- If there is an error opening the .glog file, write the error to stderr (previously the error could go nowhere)
…kay because the only error that gregorio prints to stderr (instead of the .glog file) is if the .glog file itself is not writable. - Eliminate some duplicate code.
I've switched this to be against release-6.1 instead of develop. Please make sure that this hasn't broken anything. |
- don't search for .gtex file using kpse; instead always use tmp-gre - don't clean up old .gtex files
- If there is an error opening the .glog file, write the error to stderr (previously the error could go nowhere)
…kay because the only error that gregorio prints to stderr (instead of the .glog file) is if the .glog file itself is not writable. - Eliminate some duplicate code.
- don't search for .gtex file using kpse; instead always use tmp-gre - don't clean up old .gtex files
It's difficult to test all the possible combinations, but the core cases definitely work against |
Yes, fancyhdr-hooks is new. How is it failing? Sent with GitHawk |
… into glog_fixes
That’s breaking fancyhdr-hooks back to what it was before the fix. Are you testing from a branch which doesn’t have that fix applied? Sent with GitHawk |
…ell and therefore doesn't need quoting. Previously, filenames containing ' were okay, but filenames containing " were not; now, both should be okay.
…ell and therefore doesn't need quoting. Previously, filenames containing ' were okay, but filenames containing " were not; now, both should be okay.
… into glog_fixes
It appears to be because my fancyhdr is too old (v4.1, which was in TeXLive 2024) and hooks have only been around since v4.5 (Dec 2024). |
- .glog files are also deleted - Files are deleted just before every run of gregorio (previously it was only when the .gtex file was missing) - Fixed a possible bug where even on Windows, a pathname was matched against a pattern containing /
OK, this code is restored; actually it now deletes more files than it used to:
|
I just pushed a couple of bug fixes, and a "feature" for replacing |
Testing against d3e4bd6 File locations specified relative to Main.texCompiling from the main directory (the location of the tex file):Works. Directory structures are created as expected (alongside is under tmp-gre/dotdot). Compiling from Test_gregorio_dev (parent of main):Scores cannot be found since locations are specified relative to Main.tex and not the current working directory. Directory structure of tmp-gre is as expected, however. Compiling from alongside:Scores in alongside and main are found (as they are in the same location relative to alongside as they are relative to main). Scores in main/subdir and main/subdir are not. Directory structure of tmp-gre is as expected. Compiling from subdirectories:Scores in main and subdir are found (coincidence due to directory names). Scores in subdir/subdir and alongside are not. Directory structure of tmp-gre is as expected. File locations specified with
|
That sounds better…some of these conditions are not expected to work, right? Are there remaining bugs? |
The only ones I would expect to work are compiling from the directory of the file itself and compilations where We've thought about doing something different in the past (here's a post from Elie from 2015 where he appears to have been working on this), but since this would be different from how Windows testing results: File locations specified relative to Main.texCompiling from the main directory (the location of the tex file):Score in main is found, others are not. File name normalization doesn't appear to be active. I'm getting errors involving path names with both Testing from other directories not done. I'm out of time and the above needs to be fixed anyway, so I might as well do those tests after that fix is applied. |
Quick question about backslashes. The function |
My earlier exchange with Akira indicated that the directory separator should be |
Does kpse.find_file return paths with |
I don't know. I'd have to test it (and I'm headed to class right now). If you can provide a simple test file (one that say, uses |
…herever a pathname component could be introduced - only replace `..` with `dotdot` when it is an entire pathname component
I just went ahead and applied lfs.normalize to the output of kpse.find_file, and a couple of other places where I wasn't certain. |
Windows testing against the new head: Compiling from mainWorks. tmp-gre is created and structured as expected (with alongside below (dotdot). Compiling from Test_gregorio_devNo scores found. tmp-gre is not created. Compiling from alongsideScores in main and alongside are found. Scores in subdir and subdir/subdir are not. tmp-gre is created with dotdot/alongside inside, but no subdir. Compiling from subdirScores in main and subdir are found (coincidence because subdir and subdir/subdir exist and contain the same score). Scores in subdir/subdir and alongside are not. tmp-gre is created with subdir inside, but not dotdot. Changing paths and setting
|
Oh, this is happening when kpse.find_file can’t find the file, so it returns nil, and lfs.normalize is called on nil. Should be an easy fix. But I am not sure why it’s not finding the file. I will have to understand \gresetgregpath better. |
Sent with GitHawk |
Does the last commit change anything? It was certainly a bug, but I don't understand why the bug was activated in that particular case. |
Changing paths and setting \gresetgregpath{{../}}Compiling from mainWorks. tmp-gre has expected structure. Compiling from Test_gregorio_devWorks. tmp-gre has expected structure. Compiling from alongsideWorks. tmp-gre has expected structure. Compiling from subdirNo scores found. tmp-gre created with expected structure (but has no files in it). Changing to Those are all the results I would expect. Barring any other objections I think this is ready for merge. That done I'll upload a new version as a release candidate and we'll hopefully be able to wrap the release in the next couple of days. |
Looks good to me. |
Addresses #1628