mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 04:04:06 +01:00
unixtools: fix subpackages to include ALL relevant manpages
some tools have man sections other than `1`, which the previous logic would omit. for example, `man 8 sysctl` was previously not linked into the `unixtools.sysctl` package but now is.
This commit is contained in:
parent
d1b7f8c034
commit
ec2b988672
1 changed files with 7 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ let
|
|||
singleBinary = cmd: providers: let
|
||||
provider = providers.${stdenv.hostPlatform.parsed.kernel.name} or providers.linux;
|
||||
bin = "${getBin provider}/bin/${cmd}";
|
||||
manpage = "${getOutput "man" provider}/share/man/man1/${cmd}.1.gz";
|
||||
manDir = "${getOutput "man" provider}/share/man";
|
||||
in runCommand "${cmd}-${provider.name}" {
|
||||
meta = {
|
||||
mainProgram = cmd;
|
||||
|
|
@ -43,9 +43,12 @@ let
|
|||
mkdir -p $out/bin
|
||||
ln -s ${bin} $out/bin/${cmd}
|
||||
|
||||
if [ -f ${manpage} ]; then
|
||||
mkdir -p $out/share/man/man1
|
||||
ln -s ${manpage} $out/share/man/man1/${cmd}.1.gz
|
||||
if [ -d ${manDir} ]; then
|
||||
manpages=($(cd ${manDir} ; find . -name '${cmd}*'))
|
||||
for manpage in "''${manpages[@]}"; do
|
||||
mkdir -p $out/share/man/$(dirname $manpage)
|
||||
ln -s ${manDir}/$manpage $out/share/man/$manpage
|
||||
done
|
||||
fi
|
||||
'';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue