summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/archivers/cpio/default.nix14
-rw-r--r--pkgs/tools/archivers/gnutar/1.15.1.nix9
-rw-r--r--pkgs/tools/archivers/gnutar/1.17.nix11
-rw-r--r--pkgs/tools/archivers/gnutar/1.18.nix11
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix6
-rw-r--r--pkgs/tools/compression/bzip2/default.nix2
-rw-r--r--pkgs/tools/compression/lzma/default.nix6
-rw-r--r--pkgs/tools/graphics/glxinfo/default.nix6
-rw-r--r--pkgs/tools/misc/coreutils/default.nix24
-rw-r--r--pkgs/tools/misc/coreutils/gnulib-futimens.patch54
-rw-r--r--pkgs/tools/misc/coreutils/setting-time-backward-compatibility.patch114
-rw-r--r--pkgs/tools/misc/hg2git/default.nix26
-rw-r--r--pkgs/tools/misc/su/default.nix23
-rw-r--r--pkgs/tools/misc/su/su-pam.patch396
-rw-r--r--pkgs/tools/networking/curl/connect-timeout.patch56
-rw-r--r--pkgs/tools/networking/curl/default.nix8
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix2
-rw-r--r--pkgs/tools/text/gnugrep/default.nix28
-rw-r--r--pkgs/tools/text/gnused/4.1.2.nix9
19 files changed, 186 insertions, 619 deletions
diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix
index cb9ee9e7f06..cc00857f33d 100644
--- a/pkgs/tools/archivers/cpio/default.nix
+++ b/pkgs/tools/archivers/cpio/default.nix
@@ -2,8 +2,22 @@
 
 stdenv.mkDerivation {
   name = "cpio-2.9";
+  
   src = fetchurl {
     url = mirror://gnu/cpio/cpio-2.9.tar.bz2;
     sha256 = "01s7f9hg8kgpis96j99hgkiqgdy53pm7qi7bhm3fzx58jfk5z6mv";
   };
+
+  patches = [
+    # Make it compile on GCC 4.3.
+    (fetchurl {
+      url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/app-arch/cpio/files/cpio-2.9-gnu-inline.patch?rev=1.1";
+      sha256 = "1167hrq64h9lh3qhgasm2rivfzkkgx6fik92b017qfa0q61ff8c3";
+    })
+  ];
+
+  meta = {
+    homepage = http://www.gnu.org/software/cpio/;
+    description = "A program to create or extract from cpio archives";
+  };
 }
diff --git a/pkgs/tools/archivers/gnutar/1.15.1.nix b/pkgs/tools/archivers/gnutar/1.15.1.nix
deleted file mode 100644
index 77dc1a3c76e..00000000000
--- a/pkgs/tools/archivers/gnutar/1.15.1.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "gnutar-1.15.1";
-  src = fetchurl {
-    url = http://nixos.org/tarballs/tar-1.15.1.tar.bz2;
-    md5 = "57da3c38f8e06589699548a34d5a5d07";
-  };
-}
diff --git a/pkgs/tools/archivers/gnutar/1.17.nix b/pkgs/tools/archivers/gnutar/1.17.nix
deleted file mode 100644
index c87b855ed63..00000000000
--- a/pkgs/tools/archivers/gnutar/1.17.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "gnutar-1.17";
-  src = 
-	fetchurl {
-		url = mirror://gnu/tar/tar-1.17.tar.bz2;
-		sha256 = "14m49kya1swilivc2laycw3p3y3i1s3q0vkhwjan58aiv8fh5y8r";
-	};
-  patches = [./implausible.patch];
-}
diff --git a/pkgs/tools/archivers/gnutar/1.18.nix b/pkgs/tools/archivers/gnutar/1.18.nix
deleted file mode 100644
index aab315f673e..00000000000
--- a/pkgs/tools/archivers/gnutar/1.18.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "gnutar-1.17";
-  src = 
-	fetchurl {
-		url = mirror://gnu/tar/tar-1.18.tar.bz2;
-		sha256 = "0png2yqkw333acf55k0hjs0mcx1s0w0gkf50pa6hv3kw8bh4x524";
-	};
-  patches = [./implausible.patch ./gnulib-futimens.patch];
-}
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index e2d9b9eee8b..6752b8e09ee 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnutar-1.20";
+  name = "gnutar-1.21";
   
   src = fetchurl {
-    url = mirror://gnu/tar/tar-1.20.tar.bz2;
-    sha256 = "1swx3whm2vh0qzq8v04vgwk5zds6zlznk52xwivj7p2szcxg72xy";
+    url = mirror://gnu/tar/tar-1.21.tar.bz2;
+    sha256 = "0l5kmq3s6rbps6h62li5a1yycchaa2mnhv8b8qlak90w0z970v6w";
   };
   
   patches = [./implausible.patch];
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index eedcf242bca..ddc31de6196 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   };
 
   sharedLibrary =
-    !stdenv.isDarwin && !(stdenv ? isDietLibC) && stdenv.system != "i686-cygwin";
+    !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin";
     
   meta = {
     homepage = http://www.bzip.org;
diff --git a/pkgs/tools/compression/lzma/default.nix b/pkgs/tools/compression/lzma/default.nix
index 67ef9c3add1..bcc649e073d 100644
--- a/pkgs/tools/compression/lzma/default.nix
+++ b/pkgs/tools/compression/lzma/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "lzma-4.32.5";
+  name = "lzma-4.32.7";
   
   src = fetchurl {
-    url = http://tukaani.org/lzma/lzma-4.32.5.tar.gz;
-    sha256 = "1mqy1biy46gqky6n3gyr2l395hwckh0xyi96waz5p5x8mgp372ch";
+    url = http://tukaani.org/lzma/lzma-4.32.7.tar.gz;
+    sha256 = "0b03bdvm388kwlcz97aflpr3ir1zpa3m0bq3s6cd3pp5a667lcwz";
   };
 
   CFLAGS = "-O3";
diff --git a/pkgs/tools/graphics/glxinfo/default.nix b/pkgs/tools/graphics/glxinfo/default.nix
index 0e2fa198a86..a0e05f878e2 100644
--- a/pkgs/tools/graphics/glxinfo/default.nix
+++ b/pkgs/tools/graphics/glxinfo/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, x11, mesa}:
 
 stdenv.mkDerivation {
-  name = "glxinfo-6.5.2";
+  name = "glxinfo-7.2";
   
   src = fetchurl {
-    url = mirror://sourceforge/mesa3d/MesaDemos-6.5.2.tar.bz2;
-    sha256 = "1shfwy0sy3kdk3nykp1gv6s0lafqgqnadwarw5cbpw7mkfap8kw0";
+    url = mirror://sourceforge/mesa3d/MesaDemos-7.2.tar.bz2;
+    md5 = "22e03dc4038cd63f32c21eb60994892b";
   };
 
   buildInputs = [x11 mesa];
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index a23f20bb244..6ba378a0f29 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -1,18 +1,28 @@
 {stdenv, fetchurl, aclSupport ? false, acl}:
 
-stdenv.mkDerivation {
-  name = "coreutils-6.12";
+stdenv.mkDerivation rec {
+  name = "coreutils-7.0";
   
   src = fetchurl {
-    url = mirror://gnu/coreutils/coreutils-6.12.tar.gz;
-    sha256 = "12pi7i2mxff5jab48pqpwlz2pi0j6sp9p7bgrcl663iiw81zglj9";
+    # Version 7.0 is marked as "beta", which is why it's on `alpha.gnu.org'.
+    # See http://lists.gnu.org/archive/html/bug-coreutils/2008-10/msg00064.html .
+    url = "ftp://alpha.gnu.org/gnu/coreutils/${name}.tar.gz";
+    sha256 = "00cwf8rqbj89ikv8fhdhv26dpc2ghzw1hn48pk1vg3nnmxj55nr7";
   };
 
+  buildInputs = stdenv.lib.optional aclSupport acl;
+  
   meta = {
     homepage = http://www.gnu.org/software/coreutils/;
     description = "The basic file, shell and text manipulation utilities of the GNU operating system";
-  };
 
-  buildInputs = stdenv.lib.optional aclSupport acl;
-  # Older kernels: patches = ./setting-time-backward-compatibility.patch;
+    longDescription = ''
+      The GNU Core Utilities are the basic file, shell and text
+      manipulation utilities of the GNU operating system.  These are
+      the core utilities which are expected to exist on every
+      operating system.
+    '';
+
+    license = "GPLv3+";
+  };
 }
diff --git a/pkgs/tools/misc/coreutils/gnulib-futimens.patch b/pkgs/tools/misc/coreutils/gnulib-futimens.patch
deleted file mode 100644
index f107f017d82..00000000000
--- a/pkgs/tools/misc/coreutils/gnulib-futimens.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-now hat glibc-2.6  declares futimens.
-http://lists.gnu.org/archive/html/bug-gnulib/2007-05/msg00089.html
-
-diff -ru cpio-2.7.orig/lib/utimens.c cpio-2.7/lib/utimens.c
---- cpio-2.7.orig/lib/utimens.c	2007-05-20 21:23:57.000000000 +0900
-+++ cpio-2.7/lib/utimens.c	2007-05-21 08:40:22.000000000 +0900
-@@ -73,7 +73,7 @@
-    Return 0 on success, -1 (setting errno) on failure.  */
- 
- int
--futimens (int fd ATTRIBUTE_UNUSED,
-+gl_futimens (int fd ATTRIBUTE_UNUSED,
- 	  char const *file, struct timespec const timespec[2])
- {
-   /* There's currently no interface to set file timestamps with
-@@ -166,5 +166,5 @@
- int
- utimens (char const *file, struct timespec const timespec[2])
- {
--  return futimens (-1, file, timespec);
-+  return gl_futimens (-1, file, timespec);
- }
-diff -ru cpio-2.7.orig/lib/utimens.h cpio-2.7/lib/utimens.h
---- cpio-2.7.orig/lib/utimens.h	2007-05-20 21:23:57.000000000 +0900
-+++ cpio-2.7/lib/utimens.h	2007-05-21 08:39:57.000000000 +0900
-@@ -1,3 +1,3 @@
- #include "timespec.h"
--int futimens (int, char const *, struct timespec const [2]);
-+int gl_futimens (int, char const *, struct timespec const [2]);
- int utimens (char const *, struct timespec const [2]);
-diff -ru coreutils-6.9.orig/src/copy.c coreutils-6.9/src/copy.c
---- coreutils-6.9.orig/src/copy.c	2007-05-21 09:27:22.000000000 +0900
-+++ coreutils-6.9/src/copy.c	2007-05-21 09:27:47.000000000 +0900
-@@ -623,7 +623,7 @@
-       timespec[0] = get_stat_atime (src_sb);
-       timespec[1] = get_stat_mtime (src_sb);
- 
--      if (futimens (dest_desc, dst_name, timespec) != 0)
-+      if (gl_futimens (dest_desc, dst_name, timespec) != 0)
- 	{
- 	  error (0, errno, _("preserving times for %s"), quote (dst_name));
- 	  if (x->require_preserve)
-diff -ru coreutils-6.9.orig/src/touch.c coreutils-6.9/src/touch.c
---- coreutils-6.9.orig/src/touch.c	2007-05-21 09:27:22.000000000 +0900
-+++ coreutils-6.9/src/touch.c	2007-05-21 09:27:57.000000000 +0900
-@@ -182,7 +182,7 @@
-       t = timespec;
-     }
- 
--  ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
-+  ok = (gl_futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
- 
-   if (fd == STDIN_FILENO)
-     {
diff --git a/pkgs/tools/misc/coreutils/setting-time-backward-compatibility.patch b/pkgs/tools/misc/coreutils/setting-time-backward-compatibility.patch
deleted file mode 100644
index afeb49cbad5..00000000000
--- a/pkgs/tools/misc/coreutils/setting-time-backward-compatibility.patch
+++ /dev/null
@@ -1,114 +0,0 @@
---- coreutils-6.12/lib/utimens.c	2008-05-29 09:21:57.000000000 -0400
-+++ lib/utimens.c	2008-06-07 11:36:50.000000000 -0400
-@@ -96,20 +96,42 @@
- #endif
- 
-   /* POSIX 200x added two interfaces to set file timestamps with
--     nanosecond resolution.  */
-+     nanosecond resolution.  We provide a fallback for ENOSYS (for
-+     example, compiling against Linux 2.6.25 kernel headers and glibc
-+     2.7, but running on Linux 2.6.18 kernel).  */
- #if HAVE_UTIMENSAT
-   if (fd < 0)
--    return utimensat (AT_FDCWD, file, timespec, 0);
-+    {
-+      int result = utimensat (AT_FDCWD, file, timespec, 0);
-+#ifdef __linux__
-+      /* Work around what might be a kernel bug:
-+         http://bugzilla.redhat.com/442352
-+         http://bugzilla.redhat.com/449910
-+         It appears that utimensat can mistakenly return 280 rather
-+         than 0 to indicate success.
-+         FIXME: remove in 2010 or whenever the offending kernels
-+         are no longer in common use.  */
-+      if (0 < result)
-+        result = 0;
-+#endif
-+
-+      if (result == 0 || errno != ENOSYS)
-+        return result;
-+    }
- #endif
- #if HAVE_FUTIMENS
--  return futimens (fd, timespec);
--#else
-+  {
-+    int result = futimens (fd, timespec);
-+    if (result == 0 || errno != ENOSYS)
-+      return result;
-+  }
-+#endif
- 
-   /* The platform lacks an interface to set file timestamps with
-      nanosecond resolution, so do the best we can, discarding any
-      fractional part of the timestamp.  */
-   {
--# if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
-+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
-     struct timeval timeval[2];
-     struct timeval const *t;
-     if (timespec)
-@@ -125,9 +147,9 @@
- 
-     if (fd < 0)
-       {
--#  if HAVE_FUTIMESAT
-+# if HAVE_FUTIMESAT
- 	return futimesat (AT_FDCWD, file, t);
--#  endif
-+# endif
-       }
-     else
-       {
-@@ -141,21 +163,21 @@
- 	   worth optimizing, and who knows what other messed-up systems
- 	   are out there?  So play it safe and fall back on the code
- 	   below.  */
--#  if HAVE_FUTIMESAT
-+# if HAVE_FUTIMESAT
- 	if (futimesat (fd, NULL, t) == 0)
- 	  return 0;
--#  elif HAVE_FUTIMES
-+# elif HAVE_FUTIMES
- 	if (futimes (fd, t) == 0)
- 	  return 0;
--#  endif
-+# endif
-       }
--# endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
-+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
- 
-     if (!file)
-       {
--# if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
-+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
- 	errno = ENOSYS;
--# endif
-+#endif
- 
- 	/* Prefer EBADF to ENOSYS if both error numbers apply.  */
- 	if (errno == ENOSYS)
-@@ -170,9 +192,9 @@
- 	return -1;
-       }
- 
--# if HAVE_WORKING_UTIMES
-+#if HAVE_WORKING_UTIMES
-     return utimes (file, t);
--# else
-+#else
-     {
-       struct utimbuf utimbuf;
-       struct utimbuf const *ut;
-@@ -187,9 +209,8 @@
- 
-       return utime (file, ut);
-     }
--# endif /* !HAVE_WORKING_UTIMES */
-+#endif /* !HAVE_WORKING_UTIMES */
-   }
--#endif /* !HAVE_FUTIMENS */
- }
- 
- /* Set the access and modification time stamps of FILE to be
-
diff --git a/pkgs/tools/misc/hg2git/default.nix b/pkgs/tools/misc/hg2git/default.nix
new file mode 100644
index 00000000000..291391b6719
--- /dev/null
+++ b/pkgs/tools/misc/hg2git/default.nix
@@ -0,0 +1,26 @@
+args: with args;
+stdenv.mkDerivation {
+  name = "hg2git";
+
+  src = sourceByName "hg2git";
+
+  buildInputs =([mercurial.python mercurial makeWrapper]);
+
+  installPhase = ''
+    ensureDir $out/bin;
+    cp hg2git.sh hg2git.py $out/bin
+    cat >> $out/bin/hg2git-doc << EOF
+    #!${coreutils}/bin/cat
+    $(cat hg2git.txt)
+    EOF
+    chmod +x $out/bin/hg2git-doc
+    wrapProgram $out/bin/hg2git.sh \
+      --set PYTHONPATH "$(echo ${mercurial}/lib/python*/site-packages)"
+  '';
+
+  meta = {
+      description = "mercurial to git one way conversion";
+      homepage = "http://git.grml.org/?p=hg-to-git.git;a=summary";
+      license = "?"; # the .py file is GPLv2
+  };
+}
diff --git a/pkgs/tools/misc/su/default.nix b/pkgs/tools/misc/su/default.nix
index 45290ad9038..ad7dddbde97 100644
--- a/pkgs/tools/misc/su/default.nix
+++ b/pkgs/tools/misc/su/default.nix
@@ -5,23 +5,28 @@
 # coreutils a dependency on PAM.
 
 stdenv.mkDerivation {
-  name = "su-6.7";
+  name = "su-7.0";
+  
   src = fetchurl {
-    url = mirror://gnu/coreutils/coreutils-6.7.tar.bz2;
-    md5 = "a16465d0856cd011a1acc1c21040b7f4";
+    url = "ftp://alpha.gnu.org/gnu/coreutils/coreutils-7.0.tar.gz";
+    sha256 = "00cwf8rqbj89ikv8fhdhv26dpc2ghzw1hn48pk1vg3nnmxj55nr7";
   };
+  
   patches = [
     # PAM patch taken from SUSE's coreutils-6.7-5.src.rpm.
     ./su-pam.patch
-	../coreutils/gnulib-futimens.patch
   ];
+  
   buildInputs = [pam];
-  buildPhase = "
+  
+  buildPhase = ''
     make -C lib
-    make -C src su su_OBJECTS=\"su.o getdef.o\" CFLAGS=\"-DUSE_PAM\" LDFLAGS=\"-lpam -lpam_misc -ldl\"
-  ";
-  installPhase = "
+    make -C src version.h
+    make -C src su su_OBJECTS="su.o getdef.o" CFLAGS="-DUSE_PAM" LDFLAGS="-lpam -lpam_misc -ldl"
+  '';
+  
+  installPhase = ''
     ensureDir $out/bin
     cp src/su $out/bin
-  ";
+  '';
 }
diff --git a/pkgs/tools/misc/su/su-pam.patch b/pkgs/tools/misc/su/su-pam.patch
index 3f81a47f12d..5962d285ebc 100644
--- a/pkgs/tools/misc/su/su-pam.patch
+++ b/pkgs/tools/misc/su/su-pam.patch
@@ -1,6 +1,6 @@
-diff -rcN coreutils-6.7-orig/getdef.c coreutils-6.7/getdef.c
-*** coreutils-6.7-orig/getdef.c	Thu Jan  1 00:00:00 1970
---- coreutils-6.7/getdef.c	Tue Jan 16 22:18:41 2007
+diff -rcN coreutils-7.0-orig/src/getdef.c coreutils-7.0/src/getdef.c
+*** coreutils-7.0-orig/src/getdef.c	1970-01-01 01:00:00.000000000 +0100
+--- coreutils-7.0/src/getdef.c	2009-02-02 15:28:08.000000000 +0100
 ***************
 *** 0 ****
 --- 1,257 ----
@@ -261,9 +261,9 @@ diff -rcN coreutils-6.7-orig/getdef.c coreutils-6.7/getdef.c
 + }
 + 
 + #endif
-diff -rcN coreutils-6.7-orig/getdef.h coreutils-6.7/getdef.h
-*** coreutils-6.7-orig/getdef.h	Thu Jan  1 00:00:00 1970
---- coreutils-6.7/getdef.h	Tue Jan 16 22:18:41 2007
+diff -rcN coreutils-7.0-orig/src/getdef.h coreutils-7.0/src/getdef.h
+*** coreutils-7.0-orig/src/getdef.h	1970-01-01 01:00:00.000000000 +0100
+--- coreutils-7.0/src/getdef.h	2009-02-02 15:28:08.000000000 +0100
 ***************
 *** 0 ****
 --- 1,29 ----
@@ -296,310 +296,12 @@ diff -rcN coreutils-6.7-orig/getdef.h coreutils-6.7/getdef.h
 + extern void free_getdef_data (void);
 + 
 + #endif /* _GETDEF_H_ */
-diff -rcN coreutils-6.7-orig/src/getdef.c coreutils-6.7/src/getdef.c
-*** coreutils-6.7-orig/src/getdef.c	Thu Jan  1 00:00:00 1970
---- coreutils-6.7/src/getdef.c	Tue Jan 16 22:18:57 2007
+diff -rcN coreutils-7.0-orig/src/su.c coreutils-7.0/src/su.c
+*** coreutils-7.0-orig/src/su.c	2008-08-24 22:30:10.000000000 +0200
+--- coreutils-7.0/src/su.c	2009-02-02 15:31:08.000000000 +0100
 ***************
-*** 0 ****
---- 1,257 ----
-+ /* Copyright (C) 2003, 2004, 2005 Thorsten Kukuk
-+    Author: Thorsten Kukuk <kukuk@suse.de>
-+ 
-+    This program is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License version 2 as
-+    published by the Free Software Foundation.
-+ 
-+    This program is distributed in the hope that it will be useful,
-+    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+    GNU General Public License for more details.
-+ 
-+    You should have received a copy of the GNU General Public License
-+    along with this program; if not, write to the Free Software Foundation,
-+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+ 
-+ #ifdef HAVE_CONFIG_H
-+ #include <config.h>
-+ #endif
-+ 
-+ #define _GNU_SOURCE
-+ 
-+ #include <errno.h>
-+ #include <ctype.h>
-+ #include <stdio.h>
-+ #include <stdlib.h>
-+ #include <string.h>
-+ #include <limits.h>
-+ 
-+ #include "getdef.h"
-+ 
-+ struct item {
-+   char *name;         /* name of the option.  */
-+   char *value;        /* value of the option.  */
-+   struct item *next;  /* pointer to next option.  */
-+ };
-+ 
-+ static struct item *list = NULL;
-+ 
-+ void
-+ free_getdef_data (void)
-+ {
-+   struct item *ptr;
-+ 
-+   ptr = list;
-+   while (ptr != NULL)
-+     {
-+       struct item *tmp;
-+       tmp = ptr->next;
-+       free (ptr->name);
-+       free (ptr->value);
-+       free (ptr);
-+       ptr = tmp;
-+     }
-+ 
-+   list = NULL;
-+ }
-+ 
-+ /* Add a new entry to the list.  */
-+ static void
-+ store (const char *name, const char *value)
-+ {
-+   struct item *new = malloc (sizeof (struct item));
-+ 
-+   if (new == NULL)
-+     abort ();
-+ 
-+   if (name == NULL)
-+     abort ();
-+ 
-+   new->name = strdup (name);
-+   new->value = strdup (value?:"");
-+   new->next = list;
-+   list = new;
-+ }
-+ 
-+ /* search a special entry in the list and return the value.  */
-+ static const char *
-+ search (const char *name)
-+ {
-+   struct item *ptr;
-+ 
-+   ptr = list;
-+   while (ptr != NULL)
-+     {
-+       if (strcasecmp (name, ptr->name) == 0)
-+ 	return ptr->value;
-+       ptr = ptr->next;
-+     }
-+ 
-+   return NULL;
-+ }
-+ 
-+ /* Load the login.defs file (/etc/login.defs)  */
-+ static void
-+ load_defaults_internal (const char *filename)
-+ {
-+   FILE *fp;
-+   char *buf = NULL;
-+   size_t buflen = 0;
-+ 
-+   fp = fopen (filename, "r");
-+   if (NULL == fp)
-+     return;
-+ 
-+   while (!feof (fp))
-+     {
-+       char *tmp, *cp;
-+ #if defined(HAVE_GETLINE)
-+       ssize_t n = getline (&buf, &buflen, fp);
-+ #elif defined (HAVE_GETDELIM)
-+       ssize_t n = getdelim (&buf, &buflen, '\n', fp);
-+ #else
-+       ssize_t n;
-+ 
-+       if (buf == NULL)
-+         {
-+           buflen = 8096;
-+           buf = malloc (buflen);
-+         }
-+       buf[0] = '\0';
-+       fgets (buf, buflen - 1, fp);
-+       if (buf != NULL)
-+         n = strlen (buf);
-+       else
-+         n = 0;
-+ #endif /* HAVE_GETLINE / HAVE_GETDELIM */
-+       cp = buf;
-+ 
-+       if (n < 1)
-+         break;
-+ 
-+       tmp = strchr (cp, '#');  /* remove comments */
-+       if (tmp)
-+         *tmp = '\0';
-+       while (isspace ((int)*cp))    /* remove spaces and tabs */
-+         ++cp;
-+       if (*cp == '\0')        /* ignore empty lines */
-+         continue;
-+ 
-+       if (cp[strlen (cp) - 1] == '\n')
-+         cp[strlen (cp) - 1] = '\0';
-+ 
-+       tmp = strsep (&cp, " \t=");
-+       if (cp != NULL)
-+ 	while (isspace ((int)*cp) || *cp == '=')
-+ 	  ++cp;
-+ 
-+       store (tmp, cp);
-+     }
-+   fclose (fp);
-+ 
-+   if (buf)
-+     free (buf);
-+ }
-+ 
-+ static void
-+ load_defaults (void)
-+ {
-+   load_defaults_internal ("/etc/default/su");
-+   load_defaults_internal ("/etc/login.defs");
-+ }
-+ 
-+ int
-+ getdef_bool (const char *name, int dflt)
-+ {
-+   const char *val;
-+ 
-+   if (list == NULL)
-+     load_defaults ();
-+ 
-+   val = search (name);
-+ 
-+   if (val == NULL)
-+     return dflt;
-+ 
-+   return (strcasecmp (val, "yes") == 0);
-+ }
-+ 
-+ long
-+ getdef_num (const char *name, long dflt)
-+ {
-+   const char *val;
-+   char *cp;
-+   long retval;
-+ 
-+   if (list == NULL)
-+     load_defaults ();
-+ 
-+   val = search (name);
-+ 
-+   if (val == NULL)
-+     return dflt;
-+ 
-+   retval = strtol (val, &cp, 0);
-+   if (*cp != '\0' ||
-+       ((retval == LONG_MAX || retval == LONG_MIN) && errno == ERANGE))
-+     {
-+       fprintf (stderr,
-+ 	       "%s contains invalid numerical value: %s!\n",
-+ 	       name, val);
-+       retval = dflt;
-+     }
-+   return retval;
-+ }
-+ 
-+ unsigned long
-+ getdef_unum (const char *name, unsigned long dflt)
-+ {
-+   const char *val;
-+   char *cp;
-+   unsigned long retval;
-+ 
-+   if (list == NULL)
-+     load_defaults ();
-+ 
-+   val = search (name);
-+ 
-+   if (val == NULL)
-+     return dflt;
-+ 
-+   retval = strtoul (val, &cp, 0);
-+   if (*cp != '\0' || (retval == ULONG_MAX && errno == ERANGE))
-+     {
-+       fprintf (stderr,
-+ 	       "%s contains invalid numerical value: %s!\n",
-+ 	       name, val);
-+       retval = dflt;
-+     }
-+   return retval;
-+ }
-+ 
-+ const char *
-+ getdef_str (const char *name, const char *dflt)
-+ {
-+   const char *retval;
-+ 
-+   if (list == NULL)
-+     load_defaults ();
-+ 
-+   retval = search (name);
-+ 
-+   return retval ?: dflt;
-+ }
-+ 
-+ #if defined(TEST)
-+ 
-+ int
-+ main ()
-+ {
-+   printf ("CYPT=%s\n", getdef_str ("cRypt", "no"));
-+   printf ("LOG_UNKFAIL_ENAB=%s\n", getdef_str ("log_unkfail_enab",""));
-+   printf ("DOESNOTEXIST=%s\n", getdef_str ("DOESNOTEXIST","yes"));
-+   return 0;
-+ }
-+ 
-+ #endif
-diff -rcN coreutils-6.7-orig/src/getdef.h coreutils-6.7/src/getdef.h
-*** coreutils-6.7-orig/src/getdef.h	Thu Jan  1 00:00:00 1970
---- coreutils-6.7/src/getdef.h	Tue Jan 16 22:18:57 2007
-***************
-*** 0 ****
---- 1,29 ----
-+ /* Copyright (C) 2003, 2005 Thorsten Kukuk
-+    Author: Thorsten Kukuk <kukuk@suse.de>
-+ 
-+    This program is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License version 2 as
-+    published by the Free Software Foundation.
-+ 
-+    This program is distributed in the hope that it will be useful,
-+    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+    GNU General Public License for more details.
-+ 
-+    You should have received a copy of the GNU General Public License
-+    along with this program; if not, write to the Free Software Foundation,
-+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+ 
-+ #ifndef _GETDEF_H_
-+ 
-+ #define _GETDEF_H_ 1
-+ 
-+ extern int getdef_bool (const char *name, int dflt);
-+ extern long getdef_num (const char *name, long dflt);
-+ extern unsigned long getdef_unum (const char *name, unsigned long dflt);
-+ extern const char *getdef_str (const char *name, const char *dflt);
-+ 
-+ /* Free all data allocated by getdef_* calls before.  */
-+ extern void free_getdef_data (void);
-+ 
-+ #endif /* _GETDEF_H_ */
-diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
-*** coreutils-6.7-orig/src/su.c	Sun Oct 22 16:54:15 2006
---- coreutils-6.7/src/su.c	Tue Jan 16 22:19:02 2007
-***************
-*** 38,43 ****
---- 38,49 ----
+*** 37,42 ****
+--- 37,48 ----
      restricts who can su to UID 0 accounts.  RMS considers that to
      be fascist.
   
@@ -613,8 +315,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
      -DSYSLOG_SUCCESS	Log successful su's (by default, to root) with syslog.
      -DSYSLOG_FAILURE	Log failed su's (by default, to root) with syslog.
 ***************
-*** 53,58 ****
---- 59,71 ----
+*** 52,57 ****
+--- 58,70 ----
   #include <sys/types.h>
   #include <pwd.h>
   #include <grp.h>
@@ -629,8 +331,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   /* Hide any system prototype for getusershell.
      This is necessary because some Cray systems have a conflicting
 ***************
-*** 66,71 ****
---- 79,87 ----
+*** 65,70 ****
+--- 78,86 ----
   
   #if HAVE_SYSLOG_H && HAVE_SYSLOG
   # include <syslog.h>
@@ -641,7 +343,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   # undef SYSLOG_SUCCESS
   # undef SYSLOG_FAILURE
 ***************
-*** 99,117 ****
+*** 98,116 ****
   # include <paths.h>
   #endif
   
@@ -661,7 +363,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   
   /* The shell to run if none is given in the user's passwd entry.  */
   #define DEFAULT_SHELL "/bin/sh"
---- 115,127 ----
+--- 114,126 ----
   # include <paths.h>
   #endif
   
@@ -676,8 +378,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   /* The shell to run if none is given in the user's passwd entry.  */
   #define DEFAULT_SHELL "/bin/sh"
 ***************
-*** 119,125 ****
---- 129,137 ----
+*** 118,124 ****
+--- 128,136 ----
   /* The user to become if none is specified.  */
   #define DEFAULT_USER "root"
   
@@ -688,8 +390,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   void endusershell ();
   void setusershell ();
 ***************
-*** 216,222 ****
---- 228,253 ----
+*** 212,218 ****
+--- 224,249 ----
   }
   #endif
   
@@ -717,7 +419,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
      false if not.  Return true without asking for a password if run by UID 0
      or if PW has an empty password.  */
 ***************
-*** 224,233 ****
+*** 220,229 ****
   static bool
   correct_password (const struct passwd *pw)
   {
@@ -728,7 +430,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   
     endspent ();
     if (sp)
---- 255,303 ----
+--- 251,299 ----
   static bool
   correct_password (const struct passwd *pw)
   {
@@ -779,8 +481,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
     endspent ();
     if (sp)
 ***************
-*** 248,253 ****
---- 318,324 ----
+*** 244,249 ****
+--- 314,320 ----
     encrypted = crypt (unencrypted, correct);
     memset (unencrypted, 0, strlen (unencrypted));
     return STREQ (encrypted, correct);
@@ -789,7 +491,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   
   /* Update `environ' for the new shell based on PW, with SHELL being
 ***************
-*** 272,279 ****
+*** 268,275 ****
         xsetenv ("USER", pw->pw_name);
         xsetenv ("LOGNAME", pw->pw_name);
         xsetenv ("PATH", (pw->pw_uid
@@ -798,7 +500,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
       }
     else
       {
---- 343,350 ----
+--- 339,346 ----
         xsetenv ("USER", pw->pw_name);
         xsetenv ("LOGNAME", pw->pw_name);
         xsetenv ("PATH", (pw->pw_uid
@@ -808,8 +510,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
     else
       {
 ***************
-*** 283,288 ****
---- 354,365 ----
+*** 279,284 ****
+--- 350,361 ----
   	{
   	  xsetenv ("HOME", pw->pw_dir);
   	  xsetenv ("SHELL", shell);
@@ -823,28 +525,28 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
   	    {
   	      xsetenv ("USER", pw->pw_name);
 ***************
-*** 303,314 ****
---- 380,414 ----
-      error (EXIT_FAIL, errno, _("cannot set groups"));
+*** 299,310 ****
+--- 376,410 ----
+      error (EXIT_FAILURE, errno, _("cannot set groups"));
     endgrent ();
   #endif
 + #ifdef USE_PAM
 +   retval = pam_setcred (pamh, PAM_ESTABLISH_CRED);
 +   if (retval != PAM_SUCCESS)
-+     error (EXIT_FAIL, 0, "%s", pam_strerror (pamh, retval));
++     error (EXIT_FAILURE, 0, "%s", pam_strerror (pamh, retval));
 + 
 +   retval = pam_open_session (pamh,0);
 +   if (retval != PAM_SUCCESS)
-+     {
-+        pam_setcred (pamh, PAM_DELETE_CRED);
-+        error (EXIT_FAIL, 0, "could not open session: %s",
-+               pam_strerror (pamh, retval));
-+     }
++   {
++     pam_setcred (pamh, PAM_DELETE_CRED);
++     error (EXIT_FAILURE, 0, "could not open session: %s",
++            pam_strerror (pamh, retval));
++   }
 + #endif /* USE_PAM */
     if (setgid (pw->pw_gid))
-      error (EXIT_FAIL, errno, _("cannot set group id"));
+      error (EXIT_FAILURE, errno, _("cannot set group id"));
     if (setuid (pw->pw_uid))
-      error (EXIT_FAIL, errno, _("cannot set user id"));
+      error (EXIT_FAILURE, errno, _("cannot set user id"));
   }
   
 + #ifdef USE_PAM
@@ -861,8 +563,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
      If COMMAND is nonzero, pass it to the shell with the -c option.
      Pass ADDITIONAL_ARGS to the shell as more arguments; there
 ***************
-*** 321,326 ****
---- 421,523 ----
+*** 317,322 ****
+--- 417,519 ----
     size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
     char const **args = xnmalloc (n_args, sizeof *args);
     size_t argno = 1;
@@ -967,8 +669,8 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
     if (simulate_login)
       {
 ***************
-*** 339,344 ****
---- 536,546 ----
+*** 335,340 ****
+--- 532,542 ----
       args[argno++] = "-f";
     if (command)
       {
@@ -981,19 +683,19 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
         args[argno++] = command;
       }
 ***************
-*** 495,500 ****
---- 697,705 ----
+*** 491,496 ****
+--- 693,701 ----
   #ifdef SYSLOG_FAILURE
         log_su (pw, false);
   #endif
 + #ifdef USE_PAM
 +       sleep (getdef_num ("FAIL_DELAY", 1));
 + #endif
-        error (EXIT_FAIL, 0, _("incorrect password"));
+        error (EXIT_FAILURE, 0, _("incorrect password"));
       }
   #ifdef SYSLOG_SUCCESS
 ***************
-*** 516,524 ****
+*** 512,520 ****
         shell = NULL;
       }
     shell = xstrdup (shell ? shell : pw->pw_shell);
@@ -1003,7 +705,7 @@ diff -rcN coreutils-6.7-orig/src/su.c coreutils-6.7/src/su.c
     if (simulate_login && chdir (pw->pw_dir) != 0)
       error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
   
---- 721,732 ----
+--- 717,728 ----
         shell = NULL;
       }
     shell = xstrdup (shell ? shell : pw->pw_shell);
diff --git a/pkgs/tools/networking/curl/connect-timeout.patch b/pkgs/tools/networking/curl/connect-timeout.patch
index 339930e03f6..1edb1f70b9b 100644
--- a/pkgs/tools/networking/curl/connect-timeout.patch
+++ b/pkgs/tools/networking/curl/connect-timeout.patch
@@ -1,8 +1,8 @@
-diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
-*** curl-7.18.1-orig/lib/connect.c	2008-02-07 23:25:04.000000000 +0100
---- curl-7.18.1/lib/connect.c	2008-04-23 11:25:30.000000000 +0200
+diff -rc curl-7.19.3-orig/lib/connect.c curl-7.19.3/lib/connect.c
+*** curl-7.19.3-orig/lib/connect.c	2009-01-02 23:30:50.000000000 +0100
+--- curl-7.19.3/lib/connect.c	2009-01-21 15:04:08.000000000 +0100
 ***************
-*** 99,105 ****
+*** 115,121 ****
   singleipconnect(struct connectdata *conn,
                   const Curl_addrinfo *ai, /* start connecting to this */
                   long timeout_ms,
@@ -10,7 +10,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
   
   /*
    * Curl_timeleft() returns the amount of milliseconds left allowed for the
---- 99,106 ----
+--- 115,122 ----
   singleipconnect(struct connectdata *conn,
                   const Curl_addrinfo *ai, /* start connecting to this */
                   long timeout_ms,
@@ -20,8 +20,8 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
   /*
    * Curl_timeleft() returns the amount of milliseconds left allowed for the
 ***************
-*** 552,557 ****
---- 553,559 ----
+*** 541,546 ****
+--- 542,548 ----
   {
     curl_socket_t sockfd;
     Curl_addrinfo *ai;
@@ -30,7 +30,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
     /* first close the failed socket */
     sclose(conn->sock[sockindex]);
 ***************
-*** 565,571 ****
+*** 554,560 ****
     ai = conn->ip_addr->ai_next;
   
     while(ai) {
@@ -38,7 +38,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
       if(sockfd != CURL_SOCKET_BAD) {
         /* store the new socket descriptor */
         conn->sock[sockindex] = sockfd;
---- 567,573 ----
+--- 556,562 ----
     ai = conn->ip_addr->ai_next;
   
     while(ai) {
@@ -47,36 +47,36 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
         /* store the new socket descriptor */
         conn->sock[sockindex] = sockfd;
 ***************
-*** 720,726 ****
+*** 714,720 ****
   singleipconnect(struct connectdata *conn,
                   const Curl_addrinfo *ai,
                   long timeout_ms,
 !                 bool *connected)
   {
+    struct Curl_sockaddr_ex addr;
     char addr_buf[128];
-    int rc;
---- 722,729 ----
+--- 716,723 ----
   singleipconnect(struct connectdata *conn,
                   const Curl_addrinfo *ai,
                   long timeout_ms,
 !                 bool *connected,
 !                 bool *timed_out)
   {
+    struct Curl_sockaddr_ex addr;
     char addr_buf[128];
-    int rc;
 ***************
-*** 740,745 ****
---- 743,750 ----
-    struct curl_sockaddr *addr=(struct curl_sockaddr*)&addr_storage;
-    const void *iptoprint;
+*** 730,735 ****
+--- 733,740 ----
+    struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
+  #endif
   
 +   *timed_out = FALSE;
 + 
-    addr->family=ai->ai_family;
-    addr->socktype=conn->socktype;
-    addr->protocol=ai->ai_protocol;
+    /*
+     * The Curl_sockaddr_ex structure is basically libcurl's external API
+     * curl_sockaddr structure with enough space available to directly hold
 ***************
-*** 841,848 ****
+*** 880,887 ****
       infof(data, "connected\n");
       return sockfd;
     }
@@ -85,7 +85,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
     else {
       data->state.os_errno = error;
       infof(data, "%s\n", Curl_strerror(conn, error));
---- 846,855 ----
+--- 885,894 ----
       infof(data, "connected\n");
       return sockfd;
     }
@@ -97,7 +97,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
       data->state.os_errno = error;
       infof(data, "%s\n", Curl_strerror(conn, error));
 ***************
-*** 872,879 ****
+*** 911,918 ****
     int num_addr;
     Curl_addrinfo *ai;
     Curl_addrinfo *curr_addr;
@@ -106,7 +106,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
     struct timeval before = Curl_tvnow();
   
     /*************************************************************
---- 879,886 ----
+--- 918,925 ----
     int num_addr;
     Curl_addrinfo *ai;
     Curl_addrinfo *curr_addr;
@@ -116,7 +116,7 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
   
     /*************************************************************
 ***************
-*** 915,933 ****
+*** 955,973 ****
          curr_addr = curr_addr->ai_next, aliasindex++) {
   
       /* start connecting to the IP curr_addr points to */
@@ -135,8 +135,8 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
 -     before = after;
     }  /* end of connect-to-each-address loop */
   
-    if(sockfd == CURL_SOCKET_BAD) {
---- 922,938 ----
+    *sockconn = sockfd;    /* the socket descriptor we've connected */
+--- 962,978 ----
          curr_addr = curr_addr->ai_next, aliasindex++) {
   
       /* start connecting to the IP curr_addr points to */
@@ -153,4 +153,4 @@ diff -rc curl-7.18.1-orig/lib/connect.c curl-7.18.1/lib/connect.c
       }
     }  /* end of connect-to-each-address loop */
   
-    if(sockfd == CURL_SOCKET_BAD) {
+    *sockconn = sockfd;    /* the socket descriptor we've connected */
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index a429e1c9514..314f7c48be2 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -1,14 +1,14 @@
-{stdenv, fetchurl, zlibSupport ? false, zlib, sslSupport ? false, openssl ? null}:
+{stdenv, fetchurl, zlibSupport ? false, zlib ? null, sslSupport ? false, openssl ? null}:
 
 assert zlibSupport -> zlib != null;
 assert sslSupport -> openssl != null;
 
 stdenv.mkDerivation {
-  name = "curl-7.18.1";
+  name = "curl-7.19.3";
   
   src = fetchurl {
-    url = http://curl.haxx.se/download/curl-7.18.1.tar.bz2;
-    sha256 = "0v5fpr4bsdlg262nsgrijlfhp3vgr1ypir1rrkmhxcsnpv4frw6c";
+    url = http://curl.haxx.se/download/curl-7.19.3.tar.bz2;
+    sha256 = "08ij168xflbhsypdliknmds095fw5x35d19hnf559yq0jpj0hmln";
   };
   
   buildInputs =
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index a55c052b32c..c613f2f63f9 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -21,6 +21,8 @@ stdenv.mkDerivation {
     --disable-init-state
   '';
 
+  doCheck = true;
+
   meta = {
     description = "The Nix Deployment System";
     homepage = http://nixos.org/;
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index c44aa10c700..4f44d61108e 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -1,21 +1,37 @@
 {stdenv, fetchurl, pcre}:
 
+let version = "2.5.4"; in
+
 stdenv.mkDerivation {
-  name = "gnugrep-2.5.3";
+  name = "gnugrep-${version}";
   
   src = fetchurl {
-    url = http://nixos.org/tarballs/grep-2.5.3-with-info.tar.bz2;
-    sha256 = "0rg9dipksqzbg8v1xalib1n3xkkycc5r1l2gb9cxy1cz3cjip5l8";
+    url = "mirror://gnu/grep/grep-${version}.tar.bz2";
+    sha256 = "0800lj1ywf43x5jnjyga56araak0f601sd9k5q1vv3s5057cdgha";
   };
   
   buildInputs = [pcre];
 
-  preBuild = ''
-    makeFlagsArray=(mkdir_p="mkdir -p")
+  doCheck = true;
+
+  # On Mac OS X, force use of mkdir -p, since Grep's fallback
+  # (./install-sh) is broken.
+  preConfigure = ''
+    export MKDIR_P="mkdir -p"
   '';
-  
+
   meta = {
     homepage = http://www.gnu.org/software/grep/;
     description = "GNU implementation of the Unix grep command";
+
+    longDescription = ''
+      The grep command searches one or more input files for lines
+      containing a match to a specified pattern.  By default, grep
+      prints the matching lines.
+    '';
+
+    license = "GPLv3+";
   };
+
+  passthru = {inherit pcre;};
 }
diff --git a/pkgs/tools/text/gnused/4.1.2.nix b/pkgs/tools/text/gnused/4.1.2.nix
deleted file mode 100644
index fce5228cbbb..00000000000
--- a/pkgs/tools/text/gnused/4.1.2.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "gnused-4.1.2";
-  src = fetchurl {
-    url = mirror://gnu/sed/sed-4.1.2.tar.gz;
-    md5 = "928f0e06422f414091917401f1a834d0";
-  };
-}