From 06bdd77d3db484b755dfec605a6bba80a87e4da1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 16 Oct 2012 19:09:02 +0200 Subject: [PATCH 1/2] grub-2.0: fix bash completion script --- pkgs/tools/misc/grub/2.0x.nix | 2 ++ .../tools/misc/grub/fix-bash-completion.patch | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/tools/misc/grub/fix-bash-completion.patch diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 4186a440535..5006d8f4f4a 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -51,6 +51,8 @@ stdenv.mkDerivation rec { -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g" ''; + patches = [ ./fix-bash-completion.patch ]; + configureFlags = let arch = if stdenv.system == "i686-linux" then "i386" else if stdenv.system == "x86_64-linux" then "x86_64" diff --git a/pkgs/tools/misc/grub/fix-bash-completion.patch b/pkgs/tools/misc/grub/fix-bash-completion.patch new file mode 100644 index 00000000000..97cecdce373 --- /dev/null +++ b/pkgs/tools/misc/grub/fix-bash-completion.patch @@ -0,0 +1,24 @@ +diff -ubr grub-2.00-orig/util/bash-completion.d/grub-completion.bash.in grub-2.00/util/bash-completion.d/grub-completion.bash.in +--- grub-2.00-orig/util/bash-completion.d/grub-completion.bash.in 2012-10-16 19:02:36.342733957 +0200 ++++ grub-2.00/util/bash-completion.d/grub-completion.bash.in 2012-10-16 19:04:48.262733941 +0200 +@@ -17,6 +17,12 @@ + # along with GRUB. If not, see . + # bash completion for grub + ++have() ++{ ++ unset -v have ++ _have $1 && have=yes ++} ++ + __grub_dir() { + local i c=1 boot_dir + +@@ -479,6 +485,7 @@ + have ${__grub_script_check_program} && \ + complete -F _grub_script_check -o filenames ${__grub_script_check_program} + ++unset -f have + + # Local variables: + # mode: shell-script From 347b5800b201b214349b50de3e1610b96fe29ea0 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 16 Oct 2012 19:09:14 +0200 Subject: [PATCH 2/2] grub-2.0: strip trailing whitespace --- pkgs/tools/misc/grub/2.0x.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 5006d8f4f4a..d37ce9f5aac 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -4,14 +4,14 @@ let prefix = "grub${if EFIsupport then "-efi" else ""}"; - + version = "2.00"; - + unifont_bdf = fetchurl { url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx"; }; - + in stdenv.mkDerivation rec {