# ChangeLog for sys-apps/util-linux
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.353 2011/10/17 22:00:09 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.354 2011/10/17 22:01:41 vapier Exp $
+
+*util-linux-2.20-r1 (17 Oct 2011)
+
+ 17 Oct 2011; Mike Frysinger <vapier@gentoo.org> +util-linux-2.20-r1.ebuild,
+ +files/util-linux-2.20-dmesg-newline.patch,
+ +files/util-linux-2.20-sysfs-init.patch:
+ Add fixes from upstream for dmesg stopping with blank newlines #385305 by
+ Maxime Gervais. Add fix from upstream for nfs/btrfs unmounting #385323 by
+ Thomas Arnett.
17 Oct 2011; Mike Frysinger <vapier@gentoo.org> util-linux-2.19.1-r1.ebuild:
Mark alpha/arm/hppa/ia64/m68k/s390/sh stable #384305.
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA512
+Hash: SHA256
AUX crypto-loop.confd 412 RMD160 5e65febe9641a8362078fdae39b4ac955fb2e63b SHA1 2f881a24ff67115e74de7a11c66a34a745060864 SHA256 188c945e5e6c54cb14874057c625ff30b72fb33d3d5648e53de2f231a3375600
AUX crypto-loop.initd 1729 RMD160 fa53920677d793cf98cad994e4dabd53e53d8d04 SHA1 19d3b7c4aa95cdadde2f6fb81a391081eae04f42 SHA256 b8329250c865e79a1e761d713c2270c99d5fe96e0d5a7ca646946fab65c4b810
AUX util-linux-2.19-old-libc.patch 1051 RMD160 708207aefb228964da41ea83c2aadc2b4b887f15 SHA1 39648c38903ebdbb92a76967885ec9e6238d61ec SHA256 25a077162ed3e6e3f26a4cba96180d0bc60fc400e990621885453ba14f0542a8
AUX util-linux-2.19.1-mount-a-segv.patch 2610 RMD160 67beca8dda0e48a80246c0904329944b978d445a SHA1 8eb682296c0b948a8931d71f0780f446bdd79027 SHA256 c24dc0ed811e6c0ebc69f15c818cf89aeb1dc12b5f2f62163402ad4479d7aec9
AUX util-linux-2.19.1-umount-l-nfs.patch 2721 RMD160 60e0ccf77633bec6b7a1576810aadd937e464b46 SHA1 ec611d245d42a4ec721fdcc0301f433577d4a45c SHA256 f889de8dba4cb412ec0afcd2605c4f97e0870c6325dd0200e8c8c06794b4bf64
+AUX util-linux-2.20-dmesg-newline.patch 2629 RMD160 b13b0ab0fcfc6399300d60e19740643b453f6b91 SHA1 710d253bdc47253f621dbf305429baae3ef58245 SHA256 818c0a9fba08fe927f3af286bbae1d66dd3b1f32a0fa27722da7def019b3be0a
+AUX util-linux-2.20-sysfs-init.patch 1019 RMD160 049412722104e6a27c49e3098928583cb54ebcb1 SHA1 c76e32a9fc3c18e4fc98406afd937fc711ac8fec SHA256 44b9c38794d73db5c5fd0f0ede8055c77668ddd4df916bc52cc36f8c7c02f108
DIST util-linux-2.19.1-20110510.diff.bz2 47865 RMD160 0983ac7a48031e4b3e0ddce213887526cfa17bc0 SHA1 e73c7bca691b5d83c1b2725d53a5b669fb268495 SHA256 e04f541ca48951284331e71cbf142d777750dbc9baa051ed9e9913c7dab32b7f
DIST util-linux-2.19.1.tar.bz2 4396543 RMD160 e4763d21a3a32029ccc525a0222e271f0946a4fd SHA1 96af5d4a37c42296dae5365ba533316216a6b347 SHA256 d3eac4afcc687b3ae1ffedcab2dc12df84c7ba7045cce31386d2b7040a011c7d
DIST util-linux-2.19.tar.bz2 4376791 RMD160 a1b6bf38106c95f68929de49941c577d77cbd337 SHA1 7e08c8b5d8011b1144ff32019638fa743daf8700 SHA256 d8189ba6dfb508d5c36f50103a7b84943d893e51e6d7a314155a82f68efb33b6
DIST util-linux-ng-2.18.tar.bz2 7669676 RMD160 4781871a8f86195b886e81d364d41a57d67869e3 SHA1 154db0512caae0b6e90eee4b7312d4caf3d6b978 SHA256 b8c5c07c763888aa712b4585393346667a00793127c54cef0470cfa456b031cc
EBUILD util-linux-2.17.2.ebuild 3015 RMD160 57dac717c0d9f30dbfa07cd40dec812d18c0cfe3 SHA1 903a657757ee19a86e1f6109d0ef36c3a10e6bb7 SHA256 c2bc733ccecd90d10664a821ab7c56cb26be6e0fa8448b3fd26878241bce6d20
EBUILD util-linux-2.18-r1.ebuild 3271 RMD160 998c66452f87b053114d10625cc4f2e39ae4bd00 SHA1 14d9df40e418ec6155ba2dfc7b5ca2b30eb6f3d6 SHA256 7e6cca4e22388a373cf61538b4ff9973f706a71119e4bb66bef556175dde0170
-EBUILD util-linux-2.19.1-r1.ebuild 3300 RMD160 e19ae8a60f195e1cce005c9213316da171fd3032 SHA1 d701278e753d20b9920c514a99419c10631ccadb SHA256 9422b08fb168c59452e36fea90af2d5975c517ee2db3b2a8e36cde2981a17fff
+EBUILD util-linux-2.19.1-r1.ebuild 3292 RMD160 e60069276a615ea83e2c180cd2f0160a34872867 SHA1 d09ec15080f04e1f025e14bc174fbcaa42adb1c6 SHA256 3eeb36bf80ef89f5071722ec1eef723640b324cd9daee17a7cd81c6c65a2f7d5
EBUILD util-linux-2.19.1.ebuild 3162 RMD160 dd57955b2e9ebbc7717d2b8ce12cbdceb64e2e8d SHA1 567fcdf55eb499143aef82e34aa8cf620e5abe77 SHA256 70630679959a63448654b9152d67a2ed5a05c251f5bd08bf3a1ac77bfc6ebcad
EBUILD util-linux-2.19.ebuild 3059 RMD160 29645f9660d0caf38bd2eb3d7a97d1d0ba544e94 SHA1 e3df015f117c4867f04abc3b8b1e1be82d8cbea5 SHA256 224395e264f11496a12b8f150022bf408428fbac16b893106dbddca5d77e1724
+EBUILD util-linux-2.20-r1.ebuild 3454 RMD160 d4ecb4b5e805488f4daae510e8cb2b5171564abf SHA1 f46a1999b4b804b6dcb0c7d749445bdd708114d9 SHA256 00f578e55c81be568074247d2ee40969ad35f6d6ca6f0d6c7e96a3d442a7dd14
EBUILD util-linux-2.20.ebuild 3366 RMD160 d8185e3b3ab8524448105a7975a54690ac17d99a SHA1 4ab44773dc2cc452da27e1e80d9d6b59727bddc0 SHA256 98a183811b923cc453d7b406117d95ab271b8e5dbb50deeda698becfabf65994
EBUILD util-linux-9999.ebuild 3299 RMD160 dddbd148915ddadbbbccae31af95574e4f2c26b0 SHA1 1904cdd38eb10b886e19f611a755f5117de233bb SHA256 f1d155fe4050af89cd7321d8c1657190fb839a7e1ad13452575444fe7adabac7
-MISC ChangeLog 53302 RMD160 306b2cc4eb686f377c60f73fb05167f771a6d531 SHA1 b53464a3c91de83629d3dabcba1cc38db01ab83a SHA256 b69c3ff3693bfb6e7dcbc3b8293ed974028b53be53091e10adec7cb8d6135482
+MISC ChangeLog 53804 RMD160 3b274d24436045f9e0d38ab0e45856aec7325678 SHA1 2666137e38301c9cc5d67d39943a4decb2200f68 SHA256 0813fba03dc907a601fd4a1b14ded6d36b8c2a5a27dbef973917a063dac667f9
MISC metadata.xml 581 RMD160 0177cde9a7c9906f5d14fbefec5d689b0271a95e SHA1 9275f30ed4bc6a340dfa3b5d88e1ab1715e23a42 SHA256 869450d739d36b4731860f8fa357276b3f9f30be37cbecd1aec0048f667d643f
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
-iQIcBAEBCgAGBQJOfHxdAAoJEPiazRVxLXTFKDwQALBrGKYQXFCu7YQ871hVt3Te
-9qW+IZNJp/S9aGD2q7ESozR9OgIPb02N8OAXH7v6Wdw5otMPX8eKif8K18048tfF
-iNWqG7IpRn6vaTGmz5bGbj3jjVZWewJ+KXLMQYWgaXQ6WiUYvdEIUUgl5ft0Rpss
-akcHUhYEIxkHDiL0tZSEejHl+aGjMn9ur0Tf1mB8JLNllbJy9OuFGw2JbqssRPd+
-hZaPDthkmU/mlJUZSw0Y5f8DWNX7/bnPbK4c4VLbpZHqCZObEuv/0bfrzGksxpsl
-BFi7MHUml+NV309DGAPomlvVhoMZgD62dpekXvaawbD0vOonXeizhhBaY3w1FMDS
-h8fO1viB/KnMbllQqb9YXkq+3oOmK92UmQkgXzpbVzx45pqDQ2yCHvnloaNs6lyZ
-ZRfBQrlRrmwppvQcyhhAWT+GH0qDRlziakIkv0B+Tj4m5YZCoTT11qJlD/wE+6d1
-KUiQPNpP0zG+e2P9m26xXSsqoN2IyYY/jOpKN05DSnJcam/hB767DlVOfDYkabDU
-Bu0BXTBVt3AuflWpjm0Rh9exFnnw2kEVWghQ3BTardss/2FpkPM09LGPfh2xwQJ1
-TQeXKSrT0VjnbiEyCQksilpC2ISElTh1xsRNn/ctZjIIWZUJiA7aRJtN2LhjC1TL
-JW0V3LWXm39tJy2WHhBx
-=nuq/
+iF4EAREIAAYFAk6cpcwACgkQaC/OocHi7JaSTAD+MaopbDNktF8eDLaoBi64fkhK
+F7SixPNoY50BVaAQYJ0A/R+TR89lxA6cb0eRgD7e1BLxA5msgl0WJ+oTS1mX4+nK
+=/hOK
-----END PGP SIGNATURE-----
--- /dev/null
+https://bugs.gentoo.org/385305
+
+From 22f69825778f992ff98ed100252bf5e00a15d9d1 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 31 Aug 2011 12:28:39 +0200
+Subject: [PATCH] dmesg: fix for non-CONFIG_PRINTK_TIME kernels
+
+ * dmesg(1) incorrectly assumes that lines like "<6>\n"
+ are broken.
+
+ * it's more robust to assume the end of the record is "\n<"
+
+ * print \n for empty lines
+
+Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ sys-utils/dmesg.c | 16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
+index 6090f4e..8e7bb4b 100644
+--- a/sys-utils/dmesg.c
++++ b/sys-utils/dmesg.c
+@@ -442,12 +442,12 @@ static int get_next_record(struct dmesg_control *ctl, struct dmesg_record *rec)
+
+ if (!begin)
+ begin = p;
+- if (*p == '\n')
+- end = p;
+ if (i + 1 == rec->next_size) {
+ end = p + 1;
+ i++;
+- }
++ } else if (*p == '\n' && *(p + 1) == '<')
++ end = p;
++
+ if (begin && !*begin)
+ begin = NULL; /* zero(s) at the end of the buffer? */
+ if (!begin || !end)
+@@ -469,9 +469,6 @@ static int get_next_record(struct dmesg_control *ctl, struct dmesg_record *rec)
+ }
+ }
+
+- if (end <= begin)
+- return -1; /* error */
+-
+ if (*begin == '[' && (*(begin + 1) == ' ' ||
+ isdigit(*(begin + 1)))) {
+ if (ctl->delta || ctl->ctime) {
+@@ -534,12 +531,15 @@ static void print_buffer(const char *buf, size_t size,
+ }
+
+ while (get_next_record(ctl, &rec) == 0) {
+- if (!rec.mesg_size)
+- continue;
+
+ if (!accept_record(ctl, &rec))
+ continue;
+
++ if (!rec.mesg_size) {
++ putchar('\n');
++ continue;
++ }
++
+ if (ctl->decode && rec.level >= 0 && rec.facility >= 0)
+ printf("%-6s:%-6s: ", facility_names[rec.facility].name,
+ level_names[rec.level].name);
+--
+1.7.6.1
+
+From 31c9099a81d3a9c70fdceb198eebed678173d954 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Fri, 2 Sep 2011 14:42:04 +0200
+Subject: [PATCH] dmesg: remove extra space only after time stamp
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ sys-utils/dmesg.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
+index 8e7bb4b..b3713a0 100644
+--- a/sys-utils/dmesg.c
++++ b/sys-utils/dmesg.c
+@@ -480,11 +480,10 @@ static int get_next_record(struct dmesg_control *ctl, struct dmesg_record *rec)
+ break;
+ }
+ }
++ if (begin < end && *begin == ' ')
++ begin++;
+ }
+
+- if (begin < end && *begin == ' ')
+- begin++;
+-
+ rec->mesg = begin;
+ rec->mesg_size = end - begin;
+
+--
+1.7.6.1
+
--- /dev/null
+From 3a18db62e661fbb307ad3a53c18afabc92d3c63e Mon Sep 17 00:00:00 2001
+From: Petr Uzel <petr.uzel@suse.cz>
+Date: Tue, 13 Sep 2011 11:08:46 +0200
+Subject: [PATCH] lib: do not attempt to close(0) in sysfs_deinit()
+
+If the 'open' fails we 'goto err' which runs 'sysfs_deinit()' on a 'cxt'
+which hasn't been fully initialised. The 'dir_fd' is still 0, so
+sysfs_deinit calls "close(0)".
+
+Addresses: https://bugzilla.novell.com/show_bug.cgi?id=714151
+Reported-by: Diego Ercolani <diego.ercolani@gmail.com>
+Analysed-by: Neil Brown <nfbrown@suse.com>
+Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
+---
+ lib/sysfs.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/lib/sysfs.c b/lib/sysfs.c
+index eec1f24..ebb3bb5 100644
+--- a/lib/sysfs.c
++++ b/lib/sysfs.c
+@@ -140,6 +140,7 @@ int sysfs_init(struct sysfs_cxt *cxt, dev_t devno, struct sysfs_cxt *parent)
+ int fd, rc = 0;
+
+ memset(cxt, 0, sizeof(*cxt));
++ cxt->dir_fd = -1;
+
+ if (!sysfs_devno_path(devno, path, sizeof(path)))
+ goto err;
+--
+1.7.6.1
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.20-r1.ebuild,v 1.1 2011/10/17 22:01:41 vapier Exp $
+
+EAPI="3"
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+inherit eutils toolchain-funcs libtool flag-o-matic
+[[ ${PV} == "9999" ]] && inherit git autotools
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.bz2
+ loop-aes? ( http://loop-aes.sourceforge.net/updates/util-linux-2.20-20110905.diff.bz2 )"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+cramfs crypt ddate loop-aes ncurses nls old-linux perl selinux slang static-libs uclibc unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r3
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ perl? ( dev-lang/perl )
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ po/update-potfiles
+ autopoint --force
+ eautoreconf
+ else
+ use loop-aes && epatch "${WORKDIR}"/util-linux-*.diff
+ fi
+ epatch "${FILESDIR}"/${P}-dmesg-newline.patch
+ epatch "${FILESDIR}"/${P}-sysfs-init.patch
+ use uclibc && sed -i -e s/versionsort/alphasort/g -e s/strverscmp.h/dirent.h/g mount/lomount.c
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.c
+}
+
+usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
+src_configure() {
+ lfs_fallocate_test
+ econf \
+ --enable-fs-paths-extra=/usr/sbin \
+ $(use_enable nls) \
+ --enable-agetty \
+ $(use_enable cramfs) \
+ $(use_enable ddate) \
+ $(use_enable old-linux elvtune) \
+ --with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-last \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --disable-login-utils \
+ --enable-schedutils \
+ --disable-wall \
+ --enable-write \
+ --without-pam \
+ $(use_with selinux) \
+ $(use_with slang) \
+ $(use_enable static-libs static) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS NEWS README* TODO docs/*
+ use ddate || find "${ED}"/usr/share/man -name 'ddate.1*' -delete
+
+ if ! use perl ; then #284093
+ rm "${ED}"/usr/bin/chkdupexe || die
+ rm "${ED}"/usr/share/man/man1/chkdupexe.1 || die
+ fi
+
+ # need the libs in /
+ gen_usr_ldscript -a blkid uuid
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ rm -f "${ED}"/usr/$(get_libdir)/*.la
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}