From 41b1b80d9ebebcf21bdd58851af464e6134da9f9 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Sun, 22 Feb 2009 16:07:10 +0000 Subject: [PATCH] * Quick hack to make the `info' command work properly by generating a "dir" file on the fly in a wrapper script. svn path=/nixos/branches/fix-style/; revision=14164 --- helpers/info-wrapper.nix | 29 +++++++++++++++++++++++++++++ system/system.nix | 1 + 2 files changed, 30 insertions(+) create mode 100644 helpers/info-wrapper.nix diff --git a/helpers/info-wrapper.nix b/helpers/info-wrapper.nix new file mode 100644 index 000000000000..0f482dd4c276 --- /dev/null +++ b/helpers/info-wrapper.nix @@ -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 "$@" + '' diff --git a/system/system.nix b/system/system.nix index bfa81c5566ad..570ba91c96f9 100644 --- a/system/system.nix +++ b/system/system.nix @@ -153,6 +153,7 @@ rec { pkgs.usbutils pkgs.utillinux pkgs.wirelesstools + (import ../helpers/info-wrapper.nix {inherit (pkgs) bash texinfo writeScriptBin;}) ] ++ pkgs.lib.optional config.services.bitlbee.enable pkgs.bitlbee ++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp