[arch-commits] Commit in util-linux-ng/trunk (PKGBUILD util-linux-ng-blkid.patch)
Thomas Bächler
thomas at archlinux.org
Thu Feb 3 20:52:36 UTC 2011
Date: Thursday, February 3, 2011 @ 15:52:35
Author: thomas
Revision: 108823
util-linux-ng 2.18-4: Fix some issues with blkid (FS#22666), clean up PKGBUILD
Added:
util-linux-ng/trunk/util-linux-ng-blkid.patch
Modified:
util-linux-ng/trunk/PKGBUILD
---------------------------+
PKGBUILD | 28 ++++++++----
util-linux-ng-blkid.patch | 96 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 114 insertions(+), 10 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2011-02-03 20:51:18 UTC (rev 108822)
+++ PKGBUILD 2011-02-03 20:52:35 UTC (rev 108823)
@@ -2,7 +2,7 @@
# Maintainer: judd <jvinet at zeroflux.org>
pkgname=util-linux-ng
pkgver=2.18
-pkgrel=3
+pkgrel=4
pkgdesc="Miscellaneous system utilities for Linux"
url="http://userweb.kernel.org/~kzak/util-linux-ng/"
arch=('i686' 'x86_64')
@@ -16,31 +16,39 @@
source=(ftp://ftp.kernel.org/pub/linux/utils/${pkgname}/v2.18/${pkgname}-${pkgver}.tar.bz2
fix-findmnt.patch
util-linux-ng-nilfs2.patch
- util-linux-ng-cfdisk.patch)
+ util-linux-ng-cfdisk.patch
+ util-linux-ng-blkid.patch)
optdepends=('perl: for chkdupexe support')
install=util-linux-ng.install
md5sums=('2f5f71e6af969d041d73ab778c141a77'
'7346673932b165faadde2fa2a9c1cd3a'
'aa1f210aa22363605363b7b14b8f7a78'
- 'e6d9309d44c258b25a7fb0b70f94f94e')
+ 'e6d9309d44c258b25a7fb0b70f94f94e'
+ '0e7f8aa87e227fd176cb54435a94c8c5')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
# hardware clock
- sed -e 's%etc/adjtime%var/lib/hwclock/adjtime%' -i hwclock/hwclock.c || return 1
- mkdir -p "${pkgdir}/var/lib/hwclock" || return 1
+ sed -e 's%etc/adjtime%var/lib/hwclock/adjtime%' -i hwclock/hwclock.c
# fix findmnt
patch -p1 -i "${srcdir}/fix-findmnt.patch"
# add nilfs2 support, included in next upstream release
patch -Np1 -i "${srcdir}/util-linux-ng-nilfs2.patch"
# fix cfdisk partition changing, included in next upstream release
patch -Np1 -i "${srcdir}/util-linux-ng-cfdisk.patch"
+ # fix some issues with blkid low-level probing that affect current initscripts
+ patch -Np1 -i "${srcdir}/util-linux-ng-blkid.patch"
- autoreconf || return 1
- automake || return 1
- ./configure --enable-arch --enable-write --enable-raw --disable-wall --enable-rdev --enable-partx || return 1
- make HAVE_SLN=yes ADD_RAW=yes || return 1
- make HAVE_SLN=yes ADD_RAW=yes DESTDIR="${pkgdir}" install || return 1
+ autoreconf
+ automake
+ ./configure --enable-arch --enable-write --enable-raw --disable-wall --enable-rdev --enable-partx
+ make HAVE_SLN=yes ADD_RAW=yes
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ mkdir -p "${pkgdir}/var/lib/hwclock"
+ make HAVE_SLN=yes ADD_RAW=yes DESTDIR="${pkgdir}" install
# remove files
rm -f "${pkgdir}/bin/kill"
rm -f "${pkgdir}/usr/share/man/man1/kill.1"
Added: util-linux-ng-blkid.patch
===================================================================
--- util-linux-ng-blkid.patch (rev 0)
+++ util-linux-ng-blkid.patch 2011-02-03 20:52:35 UTC (rev 108823)
@@ -0,0 +1,96 @@
+diff --git a/misc-utils/blkid.8 b/misc-utils/blkid.8
+index 8968bb2..b2c43a6 100644
+--- a/misc-utils/blkid.8
++++ b/misc-utils/blkid.8
+@@ -160,7 +160,12 @@ print the device name only, this output format is always enabled for \fB-L\fR
+ and \fB-U\fR options
+ .TP
+ .B udev
+-print key="value" pairs for easy import into the udev environment
++print key="value" pairs for easy import into the udev environment. The keys are
++prefixed by ID_FS_ or ID_PART_ prefixes.
++
++The udev output returns ID_FS_AMBIVALENT tag if more superblocks are detected,
++and ID_PART_ENTRY_* tags are always returned for all partitions including empty
++partitions.
+ .TP
+ .B export
+ print key=value pairs for easy import into the environment. This output format
+@@ -173,6 +178,9 @@ used together with \fB-i\fR option.
+ .TP
+ .BI \-p
+ Switch to low-level superblock probing mode (bypass cache).
++
++Note that low-level probing also returns information about partition table type
++(PTTYPE tag) and partitions (PART_ENTRY_* tags).
+ .TP
+ .BI \-s " tag"
+ For each (specified) device, show only the tags that match
+@@ -245,9 +253,15 @@ appear in
+ are shown, if they are recognized.
+ .SH "RETURN CODE"
+ If the specified token was found, or if any tags were shown from (specified)
+-devices, 0 is returned. If the specified token was not found, or no
+-(specified) devices could be identified, an exit code of 2 is returned.
++devices, 0 is returned.
++
++If the specified token was not found, or no (specified) devices could be
++identified an exit code of 2 is returned.
++
+ For usage or other errors, an exit code of 4 is returned.
++
++If the ambivalent low-level probing result was detected an exit code of 8 is
++returned.
+ .SH AUTHOR
+ .B blkid
+ was written by Andreas Dilger for libblkid and improved by Theodore Ts'o
+diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
+index f94df06..343d05d 100644
+--- a/misc-utils/blkid.c
++++ b/misc-utils/blkid.c
+@@ -513,13 +513,28 @@ static int lowprobe_device(blkid_probe pr, const char *devname,
+ if (rc < 0)
+ goto done;
+
+- nvals = blkid_probe_numof_values(pr);
++ if (!rc)
++ nvals = blkid_probe_numof_values(pr);
++
++ if (nvals &&
++ !(output & OUTPUT_UDEV_LIST) &&
++ !blkid_probe_has_value(pr, "TYPE") &&
++ !blkid_probe_has_value(pr, "PTTYPE"))
++ /*
++ * Ignore probing result if there is not any filesystem or
++ * partition table on the device and udev output is not
++ * requested.
++ *
++ * The udev db stores information about partitions, so
++ * PART_ENTRY_* values are alway important.
++ */
++ nvals = 0;
+
+ if (nvals && !first && output & (OUTPUT_UDEV_LIST | OUTPUT_EXPORT_LIST))
+ /* add extra line between output from devices */
+ fputc('\n', stdout);
+
+- if (output & OUTPUT_DEVICE_ONLY) {
++ if (nvals && (output & OUTPUT_DEVICE_ONLY)) {
+ printf("%s\n", devname);
+ goto done;
+ }
+@@ -550,7 +565,13 @@ done:
+ devname);
+ }
+ close(fd);
+- return !nvals ? 2 : 0;
++
++ if (rc == -2)
++ return 8; /* ambivalent probing result */
++ if (!nvals)
++ return 2; /* nothing detected */
++
++ return 0; /* sucess */
+ }
+
+ /* converts comma separated list to BLKID_USAGE_* mask */
More information about the arch-commits
mailing list