-
Notifications
You must be signed in to change notification settings - Fork 27
Install doc files #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
base: main
Are you sure you want to change the base?
Conversation
|
#26 is merged. We can talk about this one now. Hmm. I like installing the documentation files into $docdir. But I don't know about dropping READMEs in to the various data directories, though. That doesn't seem to be very conventional for Unix programs. I don't have a reference for that; just not something I've seen much. The other thing is that, while this isn't correctly documented, cowsay supports no-extension cow files. You can use them with The man page says this under "COWFILE FORMAT": But the code allows no-extension files (or extensions in the So under this PR, you get an odd error if you use "README" as the name of a cow. I think we should make the behavior uniform here. I think that undocumented no-extension cowfile behavior has been here for a while. The 3.04 code does it: So for back-compatibility, should probably keep it around. But I'd like to make Not much impact here, but it doesn't feel "clean" to me. Either way, IMHO the man page should be updated to note the *.pm and extensionless cow files. Or we should just remove the *.pm cows, since support for that format is broken. I'm leaning toward the latter. |
|
I have seen I think the idea to place a README where a bit of information is needed makes sense. That is a nice gesture towards the people who are not cowsay developers. Case in point: On my system, I have 182 README type files in such as Regarding the problem with no-extension cow files (NECF)... we could also call these doc files So... the man page says "*.cow or *.pm", and the code behind That undocumented legacy behaviour might exist because it allowed testing IMHO extending Keeping the existing |
|
Yeah, I think I agree. The "make them README.md, and only treat *.cow extension files as cowfiles" seems like a good approach. And then tighten up the behavior for Want to rebase this on 3.9.0 seems like a reasonable tentative release target for this. |
92491a8 to
f0f25b2
Compare
|
Uhmm... I rebased, added a CI workflow, and fixed a few things. Until you have enabled Actions for PRs on cowsay-org/cowsay, see https://github.com/ndim/cowsay/actions for the CI jobs and their results. |
.PHONY: man
man: cowsay-man.stamp
cowsay-man.stamp: cowsay.adoc
asciidoctor cowsay.adoc # generates both cowsay.1 and cowthink.1
date > cowsay-man.stamp # if successful, generate and update the stamp fileThe basic idea is:
This is the same principle which the automatic dependency file generation uses as described in https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/. .PHONY: man
man: cowsay.1 cowthink.1
cowsay.1 cowthink.1: cowsay.adoc
asciidoctor cowsay.adoc # generates both cowsay.1 and cowthink.1If you have a make recipe with two targets, To make that recipe run only once, the third alternative is to write the .PHONY: man
man: cowsay-man.stamp
cowsay-man.stamp: cowsay.adoc
asciidoctor cowsay.adoc # generates both cowsay.1 and cowthink.1
date > cowsay-man.stamp # if successful, generate and update the stamp fileHowever, why deal with a separate stamp file when you can just use the generated cowsay.1 file? And now we are back at the basic idea from above: Generate one target explicitly, and have all other files generated as a side effect. |
01fcfd9 to
01fb22d
Compare
|
I have just rebased this onto I have worked around the cowsay.1/cowthink.1 parallel build issue by only updating The green checkmarks on https://github.com/ndim/cowsay/commits/install-docs/ say the CI runs successfully. |
|
Sorry I forgot to push cleaning up of the XXX temporary commits. 12 to 24 hours. |
|
Finished. |
|
Uhm... @apjanke with "rebase", did you mean "rebase onto main" or "rebase onto dev/free-mime" (whatever "free-mime" means)? I have rebased onto |
Do a basic "make install" and "make uninstall", showing the list of installed files. Additionally, a check is performed to ensure "make uninstall" uninstalls all files, and the man pages are being rebuilt.
As you cannot rely on "ln -s foo bar" to do the right thing if the something of the same name already exists, it is prudent to remove the name before creating it as a symlink. And "ln -sf" has its own issues. So... "rm -f ... && ln -s" it is.
Clean up the make recipe which updates the man page:
* There is no need for an additional dependency of
.PHONY target "man" to depend on the adoc file which
the "cowsay.1" target already depends on.
* We do not touch the man/man1/cowthink.1 symlink in any
make recipe any more.
* We have asciidoctor put its results into a temporary
directory, and then move only the cowsay.1 file from
there to the make target. So the make recipe only updates
one file, and we avoid the need to think about generating
files as side effects.
Also, we only need to update the man page if it has actually
changed. A change to the Asciidoctor version or to the current
date does not count as an actual change, so we normalize those
away before deciding whether to update cowsay.1 or not.
Install cowsay documentation files into docdir, such as CHANGELOG.md LICENSE.txt README.md
I just meant "rebase onto main". I'm not going to make you deal with my alternate work branches. :) "free-mime" is a silly phrase that sounds like "three nine", and is where I'm putting my work for the upcoming 3.9.x minor release series. Similarly, for the "dev/fro-yo" branch, "fro-yo" sounds like "four oh", and is where I'm putting my longer-term changes for the 4.0 major release. This rebase looks good. I should be able to review it, and read through your longer comment about the |
|
The long comment recently became shorter, as it was easier to just implement the thing than to describe it in the comment. |
|
BTW, regarding the three-nine branch consequences for install-docs:
|
|
I pulled the CI setup on to main in ee5c050 (with a cherry-pick, preserving your author credit). I think that will enable CI for new PRs based off |
|
Pulled the reliable symlink creation code in 9eba758. |
|
Working on the |




Install doc files:
README.mdandCHANGELOG.mdLICENSE.txtInstall
READMEfiles into all directories where the user can place files describing the respective directories:cowpathdir(default:/usr/local/etc/cowsay/cowpath.d)cowsdir(default:/usr/local/share/cowsay/cows)sitecowsdir(default:/usr/local/share/cowsay/site-cows)This PR is based on #26 - merge that one first.