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

man: fix redirect for locales and file arguments #1019

Closed
wants to merge 1 commit into from

Conversation

mohd-akram
Copy link
Contributor

Use the locale-specific path for localized pages and the appropriate parent directory for file arguments when handling redirects.

Use the locale-specific path for localized pages and the appropriate parent
directory for file arguments when handling redirects.

Signed-off-by: Mohamed Akram <[email protected]>
@bsdimp
Copy link
Member

bsdimp commented Jan 17, 2024

This change looks like it should be good. How can I test, though, that it fixes the bug you are chasing? And what's the current misbehavior look like?

@mohd-akram
Copy link
Contributor Author

mohd-akram commented Jan 18, 2024

This is how I tested:

Setup:

cd /tmp
mkdir -p man/man1/amd64
mkdir -p man/fr.UTF-8/man1
echo hello >man/man1/page.1
echo salut >man/fr.UTF-8/man1/page.1
echo '.so man1/page.1' >man/man1/regular.1
echo '.so man1/page.1' >man/man1/amd64/machine.1
echo '.so man1/page.1' >man/fr.UTF-8/man1/locale.1

For testing the local version alias man=~/freebsd-src/usr.bin/man/man.sh and unalias man afterwards.

Tests:

export MANPAGER=cat
(cd man/man1/ && man ./regular.1) #should show hello
(cd man/man1/amd64 && man ./machine.1) # should show hello
LANG=fr_FR.UTF-8 MANPATH=man man locale # should show salut

In the current version, the first two tests show nothing (because it can't find the linked man pages), and the last shows hello instead of salut (because it doesn't use the locale path).

@bsdimp bsdimp self-assigned this Feb 2, 2024
@bsdimp bsdimp added the ready label Feb 2, 2024
freebsd-git pushed a commit that referenced this pull request Feb 3, 2024
Use the locale-specific path for localized pages and the appropriate parent
directory for file arguments when handling redirects.

Signed-off-by: Mohamed Akram <[email protected]>
Reviewed by: imp
Pull Request: #1019
@bsdimp bsdimp added merged and removed ready labels Feb 3, 2024
@bsdimp bsdimp closed this Feb 3, 2024
@mohd-akram mohd-akram deleted the fix-man-so branch February 3, 2024 07:03
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Aug 1, 2024
Use the locale-specific path for localized pages and the appropriate parent
directory for file arguments when handling redirects.

Signed-off-by: Mohamed Akram <[email protected]>
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants