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

install_man should allow defining additional symbolic links #14161

Open
kevemueller opened this issue Jan 20, 2025 · 0 comments
Open

install_man should allow defining additional symbolic links #14161

kevemueller opened this issue Jan 20, 2025 · 0 comments

Comments

@kevemueller
Copy link

Many complex libraries create general man pages for a set of functions and symlink all function name man pages to that general man. page.
Currently I need to install_man the actual man page and then run a loop over a dict to create the symlinks:

MAN=['archive_entry.3', ...]
MLINKS = {
    'archive_entry.3': [
        'archive_entry_clear.3',
        'archive_entry_clone.3',
        'archive_entry_free.3',
        'archive_entry_new.3',
    ],
    'archive_entry_acl.3': [ .... ]
}

install_man(MAN)
foreach MAN, MLINKG : MLINKS
    foreach MLINK : MLINKG
        install_symlink(
            MLINK,
            install_dir: get_option('mandir') / 'man3',
            pointing_to: MAN,
        )
    endforeach
endforeach

This is a lot of boilerplate code, moreover it is error prone. install_man has heuristics to determine the directory of the manual page. This needs to be replicated when manually creating the symlink as install_man does not return the actual paths of the placed manual page(s).

Instead install_man should allow passing a dict directly and install both the manual page as well as all symlinks.

Second best would be to return the path of the installed manual page(s) in install_man. The code would then be at least not trying to guess.

foreach MAN, MLINKG : MLINKS
    MANT = install_man(MAN)
    foreach MLINK : MLINKG
        install_symlink(
            MLINK,
            install_dir: fs.parent(MANT),
            pointing_to: fs.name(MANT),
        )
    endforeach
endforeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant