From 34ae3b7f77ef389574602e86bea6f6e434ab9d1b Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 22 Oct 2014 01:17:26 +0200 Subject: parted: Update to new upstream version 3.2. In order to properly run tests, we need to fix the unicode tests and after some search, I have found that Ludo (who is also the maintainer of parted) already reported this upstream and also provided a solution: http://lists.gnu.org/archive/html/bug-parted/2014-08/msg00003.html I'm updating parted to 3.2, because the latest blivet implementation relies on it for device geometry calculations. Signed-off-by: aszlig --- pkgs/tools/misc/parted/default.nix | 14 ++++++--- pkgs/tools/misc/parted/gpt-unicode-test-fix.patch | 38 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 pkgs/tools/misc/parted/gpt-unicode-test-fix.patch (limited to 'pkgs/tools/misc') diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix index 01b9f391a443..0763532260a9 100644 --- a/pkgs/tools/misc/parted/default.nix +++ b/pkgs/tools/misc/parted/default.nix @@ -1,20 +1,26 @@ -{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline +{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline, perl, python , utillinux, check, enableStatic ? false, hurd ? null }: stdenv.mkDerivation rec { - name = "parted-3.1"; + name = "parted-3.2"; src = fetchurl { url = "mirror://gnu/parted/${name}.tar.xz"; - sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y"; + sha256 = "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"; }; + patches = stdenv.lib.optional doCheck ./gpt-unicode-test-fix.patch; + + postPatch = stdenv.lib.optionalString doCheck '' + patchShebangs tests + ''; + buildInputs = [ libuuid ] ++ stdenv.lib.optional (readline != null) readline ++ stdenv.lib.optional (gettext != null) gettext ++ stdenv.lib.optional (devicemapper != null) devicemapper ++ stdenv.lib.optional (hurd != null) hurd - ++ stdenv.lib.optional doCheck check; + ++ stdenv.lib.optionals doCheck [ check perl python ]; configureFlags = (if (readline != null) diff --git a/pkgs/tools/misc/parted/gpt-unicode-test-fix.patch b/pkgs/tools/misc/parted/gpt-unicode-test-fix.patch new file mode 100644 index 000000000000..470188bf55e5 --- /dev/null +++ b/pkgs/tools/misc/parted/gpt-unicode-test-fix.patch @@ -0,0 +1,38 @@ +From Ludo's suggestion at: + + http://debbugs.gnu.org/cgi/bugreport.cgi?msg=8;bug=18258 + +diff --git a/tests/.t0251-gpt-unicode.sh.swp b/tests/.t0251-gpt-unicode.sh.swp +deleted file mode 100644 +index b41c337..0000000 +Binary files a/tests/.t0251-gpt-unicode.sh.swp and /dev/null differ +diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh +index c845950..fa63a72 100755 +--- a/tests/t0251-gpt-unicode.sh ++++ b/tests/t0251-gpt-unicode.sh +@@ -22,7 +22,24 @@ dev=loop-file + # create zeroed device + truncate -s 10m $dev || fail=1 + +-export LC_ALL=C.UTF-8 ++found_locale=no ++for locale in en_US de_DE fr_FR es_ES ++do ++ LC_ALL="$locale.UTF-8" ++ export LC_ALL ++ ++ # In a UTF-8 locale, the string below prints as 4 characters. ++ if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then ++ found_locale=yes ++ break ++ fi ++done ++ ++if [ "$found_locale" != "yes" ]; then ++ echo "no valid UTF-8 locale found; skipping" >&2 ++ exit 77 ++fi ++ + # create gpt label with named partition + part_name=$(printf 'foo\341\264\244') + parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1 -- cgit 1.4.1