mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-05 09:58:50 +03:00
* Quick hack to make the `info' command work properly by generating
a "dir" file on the fly in a wrapper script. svn path=/nixos/trunk/; revision=13805
This commit is contained in:
parent
93c19c4ae9
commit
d532df65dd
29
helpers/info-wrapper.nix
Normal file
29
helpers/info-wrapper.nix
Normal file
@ -0,0 +1,29 @@
|
||||
# Quick hack to make the `info' command work properly. `info' needs a
|
||||
# "dir" file containing all the installed Info files, which we don't
|
||||
# have (it would be impure to have a package installation update some
|
||||
# global "dir" file). So this wrapper script around "info" builds a
|
||||
# temporary "dir" file on the fly. This is a bit slow (on a cold
|
||||
# cache) but not unacceptably so.
|
||||
|
||||
{bash, texinfo, writeScriptBin}:
|
||||
|
||||
writeScriptBin "info"
|
||||
''
|
||||
#! ${bash}/bin/sh
|
||||
|
||||
dir=$(mktemp --tmpdir -d "info.dir.XXXXXX")
|
||||
|
||||
if test -z "$dir"; then exit 1; fi
|
||||
|
||||
trap 'rm -rf "$dir"' EXIT
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
for i in $(IFS=:; echo $INFOPATH); do
|
||||
for j in $i/*.info; do
|
||||
${texinfo}/bin/install-info --quiet $j $dir/dir
|
||||
done
|
||||
done
|
||||
|
||||
INFOPATH=$dir:$INFOPATH ${texinfo}/bin/info "$@"
|
||||
''
|
@ -226,6 +226,7 @@ rec {
|
||||
pkgs.usbutils
|
||||
pkgs.utillinux
|
||||
pkgs.wirelesstools
|
||||
(import ../helpers/info-wrapper.nix {inherit (pkgs) bash texinfo writeScriptBin;})
|
||||
]
|
||||
++ pkgs.lib.optional config.security.sudo.enable pkgs.sudo
|
||||
++ pkgs.lib.optional config.services.atd.enable pkgs.at
|
||||
|
Loading…
Reference in New Issue
Block a user