Skip to content

Commit 61e956a

Browse files
committed
Move man source files to separate man-src dir, to avoid "ignoring bogus filename" warning
On Fedora (but not Ubuntu or macOS, it seems), if you put the in-repo man/ dir on the manpath and do `man cowsay`, if the corresponding .adoc source file is there, it'll give you a warning. This breaks the man dir in to separate source and built dirs, and should get rid of that warning. Example on Fedora 39: ``` janke@fed39-test-as:~/repos/cowsay$ PATH=$PWD/bin:$PATH janke@fed39-test-as:~/repos/cowsay$ which cowsay ~/repos/cowsay/bin/cowsay janke@fed39-test-as:~/repos/cowsay$ man -a -w cowsay man: warning: /home/janke/repos/cowsay/man/man1/cowsay.1.adoc: ignoring bogus filename /home/janke/repos/cowsay/man/man1/cowsay.1 janke@fed39-test-as:~/repos/cowsay$ man -a -w cowthink /home/janke/repos/cowsay/man/man1/cowsay.1 janke@fed39-test-as:~/repos/cowsay$ ```
1 parent c8c9621 commit 61e956a

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@ clean:
6262
# install time to avoid introducing a dependency on Asciidoctor for users.
6363

6464
.PHONY: man
65-
man: man/man1/cowsay.1.adoc man/man1/cowsay.1
65+
man: man-src/man1/cowsay.1.adoc man/man1/cowsay.1
6666

6767
# asciidoctor generates both cowsay.1 and cowthink.1, but the cowthink.1 uses an '.so'
6868
# include macro that doesn't work on some systems, but symlinks do.
6969
# cowthink.1 is generated as a side effect of cowsay.1, but I'm not sure how
7070
# to declare that without a redundant target definition.
71-
man/man1/cowsay.1: man/man1/cowsay.1.adoc
72-
$(ASCIIDOCTOR) -b manpage man/man1/cowsay.1.adoc
71+
# Must delete any existing cowthink.1 symlink *first*, or it may clobber the cowsay.1 file
72+
# with the wrong contents.
73+
man/man1/cowsay.1: man-src/man1/cowsay.1.adoc
74+
mkdir -p man/man1
75+
rm -f man/man1/cowthink.1
76+
$(ASCIIDOCTOR) -b manpage -D man/man1 man-src/man1/cowsay.1.adoc
7377
rm -f man/man1/cowthink.1
7478
$(LN_S) cowsay.1 man/man1/cowthink.1
7579

doc-project/Developer Notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ As of 2024, cowsay uses Asciidoctor, not AsciiDoc, to build its man page and stu
2525

2626
The man pages are built at code authoring time and checked in to the repo, instead of at `make install` time, so users do not need to have Asciidoctor installed in order to install cowsay.
2727

28+
## Dev setup and testing cowsay
29+
30+
The repo layout is organized to mimic the directory structure of the installed cowsay, so you can set up your `$PATH` to run cowsay from it, instead of the system installation location, with unqualified `cowsay` and `man cowsay` commands, instead of having to say e.g. `./bin/cowsay`. To do so, cd to the repo and run `PATH="$PWD/bin:$PATH`. (The man pages get picked up on the manpath automatically as a result of that; probably no need to set `$MANPATH` separately.) That's how I do testing as of 2024-08, and I'm thinking that future test or automation scripts will be written to work that way, instead of adding code paths to call the local `cowsay` using a full path to it. I think this approach is a good way to mimic how cowsay will work once installed.
31+
2832
## Releasing cowsay
2933

3034
See `doc-project/Release Checklist.md` for the steps needed to do a cowsay release.

doc-project/Release Checklist.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
# Cowsay Release Checklist
22

3+
## Getting ready for a release
4+
5+
Once `main` seems ready for a release, test it out.
6+
7+
1. Test the code manually by playing around with `cowsay`.
8+
2. Exercise all cows.
9+
a. `for cow in $(cowsay -l); do echo "${cow}:"; cowsay -f "$cow" moo; echo ''; done`
10+
3. Install on macOS with `brew install --HEAD cowsay/cowsay-org`.
11+
a. Test `cowsay` as above.
12+
b. Test `man cowsay` and `man cowthink`.
13+
314
## Creating a release
415

516
Steps to be done for a release:
617

718
1. Change version number in:
8-
a. `cowsay`
9-
a. `cowsay.1.adoc`
19+
a. `bin/cowsay`
20+
a. `man-src/man1/cowsay.1.adoc`
1021
2. Rebuild the man pages with `make man`.
1122
3. Update `CHANGELOG.md` with the release date, and make sure it's up to date with changes.
12-
4. Commit those changes, with a commit message like "v. X.Y.Z".
13-
5. Tag the release in git, in format "vX.Y.Z".
14-
6. Create an X.Y-fixes branch, if this is a major or minor release. (But not for patch releases.)
15-
7. Push the tag and new fixes branch to GitHub.
23+
4. Commit those changes, with a commit message like "v X.Y.Z".
24+
5. Tag the release in git, in format "vX.Y.Z", like `git tag vX.Y.Z`.
25+
6. Create a `patches/vX.Y` branch, if this is a major or minor release. (But not for patch releases.)
26+
7. Push the commits, tag, and new patches branch to GitHub.
1627
8. Create the release in [GitHub Releases](https://github.com/cowsay-org/cowsay/releases).
1728
a. Use the CHANGELOG contents as the release comments.
1829
9. Update the cowsay-org formula over in the [homebrew-cowsay Tap repo](https://github.com/cowsay-org/homebrew-cowsay) to use the new release.
1930
10. Post a comment on the ["Moos & Announcements"](https://github.com/cowsay-org/cowsay/issues/48) issue.
20-
12. Open development on next release.
31+
12. Open development on next release, if this is a major or minor release.
2132
a. Bump the version in files listed above (`cowsay`, `cowsay.1.adoc`), and give it a "-SNAPSHOT" suffix.
2233
b. Update the CHANGELOG with a section for the new release.
2334
c. Rebuild the man pages with `make man`.
24-
d. Commit with a message like "Open development for X.Y.Z", and push.
35+
d. Commit with a message like "Open development for X.Y", and push.
36+
13. Don't bother doing the "open development on next" steps if this is a patch release; just remember to do that if and when you start a patch release for that minor series.
2537

2638
## Build environment
2739

28-
You may need to do some setup to get your environment working for a build, especially the `make man` part.
29-
30-
The cowsay build depends on Asciidoctor. (Not the old AsciiDoc. If you see `a2x` usage, that's old AsciiDoc stuff, and should be removed and replaced with `asciidoctor` calls.)
40+
You may need to do some setup to get your environment working for a build, especially the `make man` part. The cowsay build depends on Asciidoctor. (Specifically Asciidoctory, not the old AsciiDoc and its `a2x` command.)
3141

3242
See the "Developer Notes.md" doc for more details. (Well, as soon as I get to writing more details.)
File renamed without changes.

0 commit comments

Comments
 (0)