From b21d747280a339b5aaa4d2f966eaf598cf033995 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Thu, 5 Jan 2006 17:38:12 +0000 Subject: [PATCH] hotplug uses some tools from gnused and coreutils svn path=/nixpkgs/trunk/; revision=4493 --- pkgs/os-specific/linux/hotplug/builder.sh | 2 ++ pkgs/os-specific/linux/hotplug/default.nix | 4 ++-- .../hotplug/hotplug-2004_03_29-bash.patch | 20 ++++++++++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/hotplug/builder.sh b/pkgs/os-specific/linux/hotplug/builder.sh index eaf26fc8b60c..2a63abd5cc72 100644 --- a/pkgs/os-specific/linux/hotplug/builder.sh +++ b/pkgs/os-specific/linux/hotplug/builder.sh @@ -12,6 +12,8 @@ preBuild() { mv etc/hotplug/tape.agent.tmp etc/hotplug/tape.agent sed -e "s^@bash\@^$bash^g" \ + "s^@gnused\@^$gnused^g" \ + "s^@coreutils\@^$coreutils^g" \ < etc/hotplug.d/default/default.hotplug > etc/hotplug.d/default/default.hotplug.tmp mv etc/hotplug.d/default/default.hotplug.tmp etc/hotplug.d/default/default.hotplug } diff --git a/pkgs/os-specific/linux/hotplug/default.nix b/pkgs/os-specific/linux/hotplug/default.nix index d9b0dc007173..766ef957eae4 100644 --- a/pkgs/os-specific/linux/hotplug/default.nix +++ b/pkgs/os-specific/linux/hotplug/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, bash}: +{stdenv, fetchurl, bash, gnused, coreutils}: stdenv.mkDerivation { name = "hotplug-2004_03_29"; @@ -8,5 +8,5 @@ stdenv.mkDerivation { md5 = "167bd479a1ca30243c51ca088e0942b3"; }; patches = [./hotplug-install-path.patch ./hotplug-install.patch ./hotplug-2004_03_29-bash.patch]; - inherit bash; + inherit bash gnused coreutils; } diff --git a/pkgs/os-specific/linux/hotplug/hotplug-2004_03_29-bash.patch b/pkgs/os-specific/linux/hotplug/hotplug-2004_03_29-bash.patch index 2a71a4b5549b..1e250291f092 100644 --- a/pkgs/os-specific/linux/hotplug/hotplug-2004_03_29-bash.patch +++ b/pkgs/os-specific/linux/hotplug/hotplug-2004_03_29-bash.patch @@ -43,10 +43,28 @@ diff -ruN hotplug-2004_03_29/etc/hotplug/tape.permissions hotplug-2004_03_29.new # diff -ruN hotplug-2004_03_29/etc/hotplug.d/default/default.hotplug hotplug-2004_03_29.new/etc/hotplug.d/default/default.hotplug --- hotplug-2004_03_29/etc/hotplug.d/default/default.hotplug 2004-03-26 23:34:34.000000000 +0100 -+++ hotplug-2004_03_29.new/etc/hotplug.d/default/default.hotplug 2006-01-05 17:28:47.000000000 +0100 ++++ hotplug-2004_03_29.new/etc/hotplug.d/default/default.hotplug 2006-01-05 18:35:55.000000000 +0100 @@ -1,4 +1,4 @@ -#!/bin/bash +#!@bash@/bin/bash # # This version of /sbin/hotplug should works on most GNU/Linux systems # using Linux 2.2.18+ or 2.4.* kernels. On 2.2.*, only USB has such +@@ -32,7 +32,7 @@ + + # DEBUG=yes export DEBUG + +-debug_mesg "arguments ($*) env (`env`)" ++debug_mesg "arguments ($*) @coreutils@/bin/env (`env`)" + + # + # Only one required argument: event type type being dispatched. +@@ -47,7 +47,7 @@ + + AGENTS="" + for AGENT in /etc/hotplug/*.agent ; do +- TYPE=`basename $AGENT | sed s/.agent//` ++ TYPE=`@coreutils@/bin/basename $AGENT | @gnused@/bin/sed s/.agent//` + if [ -x $AGENT ]; then + AGENTS="$AGENTS $TYPE" + else