Date: Wednesday, February 29, 2012 @ 11:49:07
  Author: tomegun
Revision: 151651

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  util-linux/repos/testing-i686/PKGBUILD
    (from rev 151650, util-linux/trunk/PKGBUILD)
  
util-linux/repos/testing-i686/lib-canonicalize-always-remove-tailing-slash.patch
    (from rev 151650, 
util-linux/trunk/lib-canonicalize-always-remove-tailing-slash.patch)
  
util-linux/repos/testing-i686/libmount-allow-empty-source-for-mount-2-syscall.patch
    (from rev 151650, 
util-linux/trunk/libmount-allow-empty-source-for-mount-2-syscall.patch)
  
util-linux/repos/testing-i686/libmount-canonicalize-all-paths-from-fs-tab.patch
    (from rev 151650, 
util-linux/trunk/libmount-canonicalize-all-paths-from-fs-tab.patch)
  
util-linux/repos/testing-i686/libmount-canonicalize-targets-from-fstab-on-mount-a.patch
    (from rev 151650, 
util-linux/trunk/libmount-canonicalize-targets-from-fstab-on-mount-a.patch)
  util-linux/repos/testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch
    (from rev 151650, 
util-linux/trunk/libmount-use-mount.-type-s-for-NFS-only.patch)
  util-linux/repos/testing-i686/mount-new-cleanup-mount-a-return-codes.patch
    (from rev 151650, 
util-linux/trunk/mount-new-cleanup-mount-a-return-codes.patch)
  util-linux/repos/testing-x86_64/PKGBUILD
    (from rev 151650, util-linux/trunk/PKGBUILD)
  
util-linux/repos/testing-x86_64/lib-canonicalize-always-remove-tailing-slash.patch
    (from rev 151650, 
util-linux/trunk/lib-canonicalize-always-remove-tailing-slash.patch)
  
util-linux/repos/testing-x86_64/libmount-allow-empty-source-for-mount-2-syscall.patch
    (from rev 151650, 
util-linux/trunk/libmount-allow-empty-source-for-mount-2-syscall.patch)
  
util-linux/repos/testing-x86_64/libmount-canonicalize-all-paths-from-fs-tab.patch
    (from rev 151650, 
util-linux/trunk/libmount-canonicalize-all-paths-from-fs-tab.patch)
  
util-linux/repos/testing-x86_64/libmount-canonicalize-targets-from-fstab-on-mount-a.patch
    (from rev 151650, 
util-linux/trunk/libmount-canonicalize-targets-from-fstab-on-mount-a.patch)
  util-linux/repos/testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch
    (from rev 151650, 
util-linux/trunk/libmount-use-mount.-type-s-for-NFS-only.patch)
  util-linux/repos/testing-x86_64/mount-new-cleanup-mount-a-return-codes.patch
    (from rev 151650, 
util-linux/trunk/mount-new-cleanup-mount-a-return-codes.patch)
Deleted:
  util-linux/repos/testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch
  util-linux/repos/testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch

--------------------------------------------------------------------------+
 testing-i686/PKGBUILD                                                    |   
67 ++++++
 testing-i686/lib-canonicalize-always-remove-tailing-slash.patch          |   
37 +++
 testing-i686/libmount-allow-empty-source-for-mount-2-syscall.patch       |   
48 ++++
 testing-i686/libmount-canonicalize-all-paths-from-fs-tab.patch           |   
27 ++
 testing-i686/libmount-canonicalize-targets-from-fstab-on-mount-a.patch   |   
55 +++++
 testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch               |   
68 +++---
 testing-i686/mount-new-cleanup-mount-a-return-codes.patch                |  
101 ++++++++++
 testing-x86_64/PKGBUILD                                                  |   
67 ++++++
 testing-x86_64/lib-canonicalize-always-remove-tailing-slash.patch        |   
37 +++
 testing-x86_64/libmount-allow-empty-source-for-mount-2-syscall.patch     |   
48 ++++
 testing-x86_64/libmount-canonicalize-all-paths-from-fs-tab.patch         |   
27 ++
 testing-x86_64/libmount-canonicalize-targets-from-fstab-on-mount-a.patch |   
55 +++++
 testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch             |   
68 +++---
 testing-x86_64/mount-new-cleanup-mount-a-return-codes.patch              |  
101 ++++++++++
 14 files changed, 738 insertions(+), 68 deletions(-)

Copied: util-linux/repos/testing-i686/PKGBUILD (from rev 151650, 
util-linux/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD                               (rev 0)
+++ testing-i686/PKGBUILD       2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,67 @@
+# $Id$
+# Maintainer: Tom Gundersen <[email protected]>
+# Contributor: judd <[email protected]>
+
+pkgname=util-linux
+pkgver=2.21
+pkgrel=4
+pkgdesc="Miscellaneous system utilities for Linux"
+url="http://www.kernel.org/pub/linux/utils/util-linux/";
+arch=('i686' 'x86_64')
+groups=('base')
+depends=('udev')
+conflicts=('util-linux-ng')
+provides=("util-linux-ng=${pkgver}")
+license=('GPL2')
+options=('!libtool')
+source=(ftp://ftp.kernel.org/pub/linux/utils/${pkgname}/v${pkgver}/${pkgname}-${pkgver}.tar.xz
+       libmount-canonicalize-all-paths-from-fs-tab.patch
+       lib-canonicalize-always-remove-tailing-slash.patch
+       libmount-canonicalize-targets-from-fstab-on-mount-a.patch
+       mount-new-cleanup-mount-a-return-codes.patch
+       libmount-use-mount.-type-s-for-NFS-only.patch
+       libmount-allow-empty-source-for-mount-2-syscall.patch)
+optdepends=('perl: for chkdupexe support')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  # hardware clock
+  sed -e 's%etc/adjtime%var/lib/hwclock/adjtime%' -i include/pathnames.h
+
+  patch -p1 -i ../libmount-canonicalize-all-paths-from-fs-tab.patch
+  patch -p1 -i ../lib-canonicalize-always-remove-tailing-slash.patch
+  patch -p1 -i ../libmount-canonicalize-targets-from-fstab-on-mount-a.patch
+  patch -p1 -i ../mount-new-cleanup-mount-a-return-codes.patch 
+  patch -p1 -i ../libmount-use-mount.-type-s-for-NFS-only.patch
+  patch -p1 -i ../libmount-allow-empty-source-for-mount-2-syscall.patch
+
+  ./configure --prefix=/usr \
+              --libdir=/usr/lib \
+              --enable-write \
+              --enable-raw \
+              --disable-wall \
+              --enable-new-mount
+
+  make
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  make DESTDIR="${pkgdir}" install
+
+  cd "${pkgdir}"
+
+  install -dm755 var/lib/hwclock
+
+  # delete stray empty dir, fixed upstream
+  rm -r usr/share/man/ru
+}
+md5sums=('208aa058f4117759d2939d1be7d662fc'
+         'c4011222a19b020d9b8465c3c7e443f6'
+         '8c1bf7b10e22e2b835441e6ae2d804d6'
+         '7b92423c588ed35229a9a166349c29a9'
+         'c483ab2d52609b5857d096b256a5075c'
+         'e31037773db7f3244b71db434f60e6f0'
+         '2de5ae7916e79970e90bf06542e43d86')

Copied: 
util-linux/repos/testing-i686/lib-canonicalize-always-remove-tailing-slash.patch
 (from rev 151650, 
util-linux/trunk/lib-canonicalize-always-remove-tailing-slash.patch)
===================================================================
--- testing-i686/lib-canonicalize-always-remove-tailing-slash.patch             
                (rev 0)
+++ testing-i686/lib-canonicalize-always-remove-tailing-slash.patch     
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,37 @@
+From 28074a0952469aebf021821d95238cfb964d13ff Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 21:26:11 +0100
+Subject: [PATCH 09/12] lib/canonicalize: always remove tailing slash
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ lib/canonicalize.c |   13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/lib/canonicalize.c b/lib/canonicalize.c
+index ab32c10..fd18af4 100644
+--- a/lib/canonicalize.c
++++ b/lib/canonicalize.c
+@@ -174,9 +174,16 @@ canonicalize_path(const char *path)
+       if (path == NULL)
+               return NULL;
+ 
+-      if (!myrealpath(path, canonical, PATH_MAX+1))
+-              return strdup(path);
+-
++      if (!myrealpath(path, canonical, PATH_MAX+1)) {
++              char *res = strdup(path);
++              if (res) {
++                      p = strrchr(res, '/');
++                      /* delete trailing slash */
++                      if (p && p > res && *(p + 1) == '\0')
++                              *p = '\0';
++              }
++              return res;
++      }
+ 
+       p = strrchr(canonical, '/');
+       if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-i686/libmount-allow-empty-source-for-mount-2-syscall.patch
 (from rev 151650, 
util-linux/trunk/libmount-allow-empty-source-for-mount-2-syscall.patch)
===================================================================
--- testing-i686/libmount-allow-empty-source-for-mount-2-syscall.patch          
                (rev 0)
+++ testing-i686/libmount-allow-empty-source-for-mount-2-syscall.patch  
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,48 @@
+From 772cce373f693096c2ae6f156306acf9e20c09e8 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Tue, 28 Feb 2012 00:02:30 +0100
+Subject: [PATCH] libmount: allow empty source for mount(2) syscall
+
+Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/context_mount.c |    4 +++-
+ sys-utils/mount.c            |    6 +++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index a0c5951..098243b 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -451,8 +451,10 @@ static int do_mount(struct libmnt_context *cxt, const 
char *try_type)
+       src = mnt_fs_get_srcpath(cxt->fs);
+       target = mnt_fs_get_target(cxt->fs);
+ 
+-      if (!src || !target)
++      if (!target)
+               return -EINVAL;
++      if (!src)
++              src = "none";
+ 
+       type = try_type ? : mnt_fs_get_fstype(cxt->fs);
+ 
+diff --git a/sys-utils/mount.c b/sys-utils/mount.c
+index 3fbac04..23abc91 100644
+--- a/sys-utils/mount.c
++++ b/sys-utils/mount.c
+@@ -347,7 +347,11 @@ try_readonly:
+                       return MOUNT_EX_USAGE;
+               }
+ 
+-              if (src == NULL || tgt == NULL) {
++              /*
++               * TODO: add mnt_context_fstab_applied() to check if we found
++               *       target/source in the file.
++               */
++              if (!tgt) {
+                       if (mflags & MS_REMOUNT)
+                               warnx(_("%s not mounted"), src ? src : tgt);
+                       else
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-i686/libmount-canonicalize-all-paths-from-fs-tab.patch 
(from rev 151650, 
util-linux/trunk/libmount-canonicalize-all-paths-from-fs-tab.patch)
===================================================================
--- testing-i686/libmount-canonicalize-all-paths-from-fs-tab.patch              
                (rev 0)
+++ testing-i686/libmount-canonicalize-all-paths-from-fs-tab.patch      
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,27 @@
+From 59e32a1f240c5f6a1d64d5e71a4a357245c34eaf Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 20:25:43 +0100
+Subject: [PATCH 07/12] libmount: canonicalize all paths from (fs)tab
+
+Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797216
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/tab.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libmount/src/tab.c b/libmount/src/tab.c
+index 37f47bd..f10c1de 100644
+--- a/libmount/src/tab.c
++++ b/libmount/src/tab.c
+@@ -456,7 +456,7 @@ struct libmnt_fs *mnt_table_find_target(struct 
libmnt_table *tb, const char *pat
+       while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
+               char *p;
+ 
+-              if (!fs->target || !mnt_fs_is_swaparea(fs) ||
++              if (!fs->target || mnt_fs_is_swaparea(fs) ||
+                   (*fs->target == '/' && *(fs->target + 1) == '\0'))
+                      continue;
+ 
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-i686/libmount-canonicalize-targets-from-fstab-on-mount-a.patch
 (from rev 151650, 
util-linux/trunk/libmount-canonicalize-targets-from-fstab-on-mount-a.patch)
===================================================================
--- testing-i686/libmount-canonicalize-targets-from-fstab-on-mount-a.patch      
                        (rev 0)
+++ testing-i686/libmount-canonicalize-targets-from-fstab-on-mount-a.patch      
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,55 @@
+From 6eba938376c2c870d9258ef9d7b6a3690cfa78dd Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 22:52:45 +0100
+Subject: [PATCH 11/12] libmount: canonicalize targets from fstab on mount -a
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/tab.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libmount/src/tab.c b/libmount/src/tab.c
+index 66a9e4d..21b05c7 100644
+--- a/libmount/src/tab.c
++++ b/libmount/src/tab.c
+@@ -830,8 +830,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+ {
+       char *root = NULL;
+       struct libmnt_fs *src_fs;
+-      const char *src, *tgt;
+-      char *xsrc = NULL;
++      const char *src;
++      char *xsrc = NULL, *tgt;
+       int flags = 0, rc = 0;
+ 
+       assert(tb);
+@@ -852,7 +852,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+               src = xsrc = mnt_resolve_spec(mnt_fs_get_source(fstab_fs),
+                                             tb->cache);
+ 
+-      tgt = mnt_fs_get_target(fstab_fs);
++      tgt = mnt_resolve_path(mnt_fs_get_target(fstab_fs), tb->cache);
+ 
+       if (tgt && src && root) {
+               struct libmnt_iter itr;
+@@ -870,7 +870,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+                        * network filesystem source paths.
+                        */
+                       if (t && s && r &&
+-                          strcmp(t, tgt) == 0 &&
++                          streq_except_trailing_slash(t, tgt) &&
+                           streq_except_trailing_slash(s, src) &&
+                           strcmp(r, root) == 0)
+                               break;
+@@ -881,6 +881,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+ 
+       if (xsrc && !tb->cache)
+               free(xsrc);
++      if (!tb->cache)
++              free(tgt);
+ 
+       free(root);
+       return rc;
+-- 
+1.7.9.2
+

Deleted: testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch
===================================================================
--- testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch  2012-02-29 
16:45:33 UTC (rev 151650)
+++ testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch  2012-02-29 
16:49:07 UTC (rev 151651)
@@ -1,34 +0,0 @@
-From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001
-From: Karel Zak <[email protected]>
-Date: Mon, 27 Feb 2012 16:43:12 +0100
-Subject: [PATCH] libmount: use mount.<type> -s for NFS only
-
-Unfortunately, it seems that for example mount.cifs don't care about
-the API, so we need exception like the original mount(8).
-
-Signed-off-by: Karel Zak <[email protected]>
----
- libmount/src/context_mount.c |    7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
-index 8cbc25b..a0c5951 100644
---- a/libmount/src/context_mount.c
-+++ b/libmount/src/context_mount.c
-@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
-               args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
-               args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
- 
--              if (mnt_context_is_sloppy(cxt))
-+              /*
-+               * TODO: remove the exception for "nfs", -s is documented
-+               *       for years should be usable everywhere.
-+               */
-+              if (mnt_context_is_sloppy(cxt) &&
-+                  type && startswith(type, "nfs"))
-                       args[i++] = "-s";               /* 4 */
-               if (mnt_context_is_fake(cxt))
-                       args[i++] = "-f";               /* 5 */
--- 
-1.7.9.2
-

Copied: 
util-linux/repos/testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch 
(from rev 151650, 
util-linux/trunk/libmount-use-mount.-type-s-for-NFS-only.patch)
===================================================================
--- testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch                  
        (rev 0)
+++ testing-i686/libmount-use-mount.-type-s-for-NFS-only.patch  2012-02-29 
16:49:07 UTC (rev 151651)
@@ -0,0 +1,34 @@
+From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Mon, 27 Feb 2012 16:43:12 +0100
+Subject: [PATCH] libmount: use mount.<type> -s for NFS only
+
+Unfortunately, it seems that for example mount.cifs don't care about
+the API, so we need exception like the original mount(8).
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/context_mount.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index 8cbc25b..a0c5951 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
+               args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
+               args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
+ 
+-              if (mnt_context_is_sloppy(cxt))
++              /*
++               * TODO: remove the exception for "nfs", -s is documented
++               *       for years should be usable everywhere.
++               */
++              if (mnt_context_is_sloppy(cxt) &&
++                  type && startswith(type, "nfs"))
+                       args[i++] = "-s";               /* 4 */
+               if (mnt_context_is_fake(cxt))
+                       args[i++] = "-f";               /* 5 */
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-i686/mount-new-cleanup-mount-a-return-codes.patch 
(from rev 151650, util-linux/trunk/mount-new-cleanup-mount-a-return-codes.patch)
===================================================================
--- testing-i686/mount-new-cleanup-mount-a-return-codes.patch                   
        (rev 0)
+++ testing-i686/mount-new-cleanup-mount-a-return-codes.patch   2012-02-29 
16:49:07 UTC (rev 151651)
@@ -0,0 +1,101 @@
+From 16b73aae8cb73df2974fd75c2a42ec3b92535851 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 23:03:22 +0100
+Subject: [PATCH 12/12] mount: (new) cleanup mount -a return codes
+
+New return codes:
+
+  0 : all mounted (or all ignored)
+ 64 : some mounted, some failed
+ 32 : all failed
+
+Note that already mounted or ignored (filtered out by -t or -O)
+filesystems don't affect the final return code.
+
+The original mount(8) returns 0 instead of 64, so the situation
+"some mounted, some failed" cannot be detected.
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ sys-utils/mount.8 |    4 ++++
+ sys-utils/mount.c |   23 +++++++++++++++++------
+ 2 files changed, 21 insertions(+), 6 deletions(-)
+
+diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
+index f1cff74..d18881b 100644
+--- a/sys-utils/mount.8
++++ b/sys-utils/mount.8
+@@ -2759,6 +2759,10 @@ mount failure
+ .TP
+ .BR 64
+ some mount succeeded
++.RE
++
++The command mount -a returns 0 (all success), 32 (all failed) or 64 (some
++failed, some success).
+ 
+ .SH NOTES
+ The syntax of external mount helpers is:
+diff --git a/sys-utils/mount.c b/sys-utils/mount.c
+index 17991b0..3fbac04 100644
+--- a/sys-utils/mount.c
++++ b/sys-utils/mount.c
+@@ -182,6 +182,8 @@ static int mount_all(struct libmnt_context *cxt)
+       struct libmnt_fs *fs;
+       int mntrc, ignored, rc = MOUNT_EX_SUCCESS;
+ 
++      int nsucc = 0, nerrs = 0;
++
+       itr = mnt_new_iter(MNT_ITER_FORWARD);
+       if (!itr) {
+               warn(_("failed to initialize libmount iterator"));
+@@ -197,31 +199,40 @@ static int mount_all(struct libmnt_context *cxt)
+                               printf(ignored == 1 ? _("%-25s: ignored\n") :
+                                                     _("%-25s: already 
mounted\n"),
+                                               tgt);
+-
+               } else if (mnt_context_is_fork(cxt)) {
+                       if (mnt_context_is_verbose(cxt))
+                               printf("%-25s: mount successfully forked\n", 
tgt);
+               } else {
+-                      rc |= mk_exit_code(cxt, mntrc);
++                      mk_exit_code(cxt, mntrc);       /* to print warnings */
+ 
+                       if (mnt_context_get_status(cxt)) {
+-                              rc |= MOUNT_EX_SOMEOK;
++                              nsucc++;
+ 
+                               if (mnt_context_is_verbose(cxt))
+                                       printf("%-25s: successfully mounted\n", 
tgt);
+-                      }
++                      } else
++                              nerrs++;
+               }
+       }
+ 
+       if (mnt_context_is_parent(cxt)) {
+               /* wait for mount --fork children */
+-              int nerrs = 0, nchildren = 0;
++              int nchildren = 0;
++
++              nerrs = 0, nsucc = 0;
+ 
+               rc = mnt_context_wait_for_children(cxt, &nchildren, &nerrs);
+               if (!rc && nchildren)
+-                      rc = nchildren == nerrs ? MOUNT_EX_FAIL : 
MOUNT_EX_SOMEOK;
++                      nsucc = nchildren - nerrs;
+       }
+ 
++      if (nerrs == 0)
++              rc = MOUNT_EX_SUCCESS;          /* all success */
++      else if (nsucc == 0)
++              rc = MOUNT_EX_FAIL;             /* all failed */
++      else
++              rc = MOUNT_EX_SOMEOK;           /* some success, some failed */
++
+       mnt_free_iter(itr);
+       return rc;
+ }
+-- 
+1.7.9.2
+

Copied: util-linux/repos/testing-x86_64/PKGBUILD (from rev 151650, 
util-linux/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD                             (rev 0)
+++ testing-x86_64/PKGBUILD     2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,67 @@
+# $Id$
+# Maintainer: Tom Gundersen <[email protected]>
+# Contributor: judd <[email protected]>
+
+pkgname=util-linux
+pkgver=2.21
+pkgrel=4
+pkgdesc="Miscellaneous system utilities for Linux"
+url="http://www.kernel.org/pub/linux/utils/util-linux/";
+arch=('i686' 'x86_64')
+groups=('base')
+depends=('udev')
+conflicts=('util-linux-ng')
+provides=("util-linux-ng=${pkgver}")
+license=('GPL2')
+options=('!libtool')
+source=(ftp://ftp.kernel.org/pub/linux/utils/${pkgname}/v${pkgver}/${pkgname}-${pkgver}.tar.xz
+       libmount-canonicalize-all-paths-from-fs-tab.patch
+       lib-canonicalize-always-remove-tailing-slash.patch
+       libmount-canonicalize-targets-from-fstab-on-mount-a.patch
+       mount-new-cleanup-mount-a-return-codes.patch
+       libmount-use-mount.-type-s-for-NFS-only.patch
+       libmount-allow-empty-source-for-mount-2-syscall.patch)
+optdepends=('perl: for chkdupexe support')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  # hardware clock
+  sed -e 's%etc/adjtime%var/lib/hwclock/adjtime%' -i include/pathnames.h
+
+  patch -p1 -i ../libmount-canonicalize-all-paths-from-fs-tab.patch
+  patch -p1 -i ../lib-canonicalize-always-remove-tailing-slash.patch
+  patch -p1 -i ../libmount-canonicalize-targets-from-fstab-on-mount-a.patch
+  patch -p1 -i ../mount-new-cleanup-mount-a-return-codes.patch 
+  patch -p1 -i ../libmount-use-mount.-type-s-for-NFS-only.patch
+  patch -p1 -i ../libmount-allow-empty-source-for-mount-2-syscall.patch
+
+  ./configure --prefix=/usr \
+              --libdir=/usr/lib \
+              --enable-write \
+              --enable-raw \
+              --disable-wall \
+              --enable-new-mount
+
+  make
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  make DESTDIR="${pkgdir}" install
+
+  cd "${pkgdir}"
+
+  install -dm755 var/lib/hwclock
+
+  # delete stray empty dir, fixed upstream
+  rm -r usr/share/man/ru
+}
+md5sums=('208aa058f4117759d2939d1be7d662fc'
+         'c4011222a19b020d9b8465c3c7e443f6'
+         '8c1bf7b10e22e2b835441e6ae2d804d6'
+         '7b92423c588ed35229a9a166349c29a9'
+         'c483ab2d52609b5857d096b256a5075c'
+         'e31037773db7f3244b71db434f60e6f0'
+         '2de5ae7916e79970e90bf06542e43d86')

Copied: 
util-linux/repos/testing-x86_64/lib-canonicalize-always-remove-tailing-slash.patch
 (from rev 151650, 
util-linux/trunk/lib-canonicalize-always-remove-tailing-slash.patch)
===================================================================
--- testing-x86_64/lib-canonicalize-always-remove-tailing-slash.patch           
                (rev 0)
+++ testing-x86_64/lib-canonicalize-always-remove-tailing-slash.patch   
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,37 @@
+From 28074a0952469aebf021821d95238cfb964d13ff Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 21:26:11 +0100
+Subject: [PATCH 09/12] lib/canonicalize: always remove tailing slash
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ lib/canonicalize.c |   13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/lib/canonicalize.c b/lib/canonicalize.c
+index ab32c10..fd18af4 100644
+--- a/lib/canonicalize.c
++++ b/lib/canonicalize.c
+@@ -174,9 +174,16 @@ canonicalize_path(const char *path)
+       if (path == NULL)
+               return NULL;
+ 
+-      if (!myrealpath(path, canonical, PATH_MAX+1))
+-              return strdup(path);
+-
++      if (!myrealpath(path, canonical, PATH_MAX+1)) {
++              char *res = strdup(path);
++              if (res) {
++                      p = strrchr(res, '/');
++                      /* delete trailing slash */
++                      if (p && p > res && *(p + 1) == '\0')
++                              *p = '\0';
++              }
++              return res;
++      }
+ 
+       p = strrchr(canonical, '/');
+       if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-x86_64/libmount-allow-empty-source-for-mount-2-syscall.patch
 (from rev 151650, 
util-linux/trunk/libmount-allow-empty-source-for-mount-2-syscall.patch)
===================================================================
--- testing-x86_64/libmount-allow-empty-source-for-mount-2-syscall.patch        
                        (rev 0)
+++ testing-x86_64/libmount-allow-empty-source-for-mount-2-syscall.patch        
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,48 @@
+From 772cce373f693096c2ae6f156306acf9e20c09e8 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Tue, 28 Feb 2012 00:02:30 +0100
+Subject: [PATCH] libmount: allow empty source for mount(2) syscall
+
+Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/context_mount.c |    4 +++-
+ sys-utils/mount.c            |    6 +++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index a0c5951..098243b 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -451,8 +451,10 @@ static int do_mount(struct libmnt_context *cxt, const 
char *try_type)
+       src = mnt_fs_get_srcpath(cxt->fs);
+       target = mnt_fs_get_target(cxt->fs);
+ 
+-      if (!src || !target)
++      if (!target)
+               return -EINVAL;
++      if (!src)
++              src = "none";
+ 
+       type = try_type ? : mnt_fs_get_fstype(cxt->fs);
+ 
+diff --git a/sys-utils/mount.c b/sys-utils/mount.c
+index 3fbac04..23abc91 100644
+--- a/sys-utils/mount.c
++++ b/sys-utils/mount.c
+@@ -347,7 +347,11 @@ try_readonly:
+                       return MOUNT_EX_USAGE;
+               }
+ 
+-              if (src == NULL || tgt == NULL) {
++              /*
++               * TODO: add mnt_context_fstab_applied() to check if we found
++               *       target/source in the file.
++               */
++              if (!tgt) {
+                       if (mflags & MS_REMOUNT)
+                               warnx(_("%s not mounted"), src ? src : tgt);
+                       else
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-x86_64/libmount-canonicalize-all-paths-from-fs-tab.patch
 (from rev 151650, 
util-linux/trunk/libmount-canonicalize-all-paths-from-fs-tab.patch)
===================================================================
--- testing-x86_64/libmount-canonicalize-all-paths-from-fs-tab.patch            
                (rev 0)
+++ testing-x86_64/libmount-canonicalize-all-paths-from-fs-tab.patch    
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,27 @@
+From 59e32a1f240c5f6a1d64d5e71a4a357245c34eaf Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 20:25:43 +0100
+Subject: [PATCH 07/12] libmount: canonicalize all paths from (fs)tab
+
+Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797216
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/tab.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libmount/src/tab.c b/libmount/src/tab.c
+index 37f47bd..f10c1de 100644
+--- a/libmount/src/tab.c
++++ b/libmount/src/tab.c
+@@ -456,7 +456,7 @@ struct libmnt_fs *mnt_table_find_target(struct 
libmnt_table *tb, const char *pat
+       while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
+               char *p;
+ 
+-              if (!fs->target || !mnt_fs_is_swaparea(fs) ||
++              if (!fs->target || mnt_fs_is_swaparea(fs) ||
+                   (*fs->target == '/' && *(fs->target + 1) == '\0'))
+                      continue;
+ 
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-x86_64/libmount-canonicalize-targets-from-fstab-on-mount-a.patch
 (from rev 151650, 
util-linux/trunk/libmount-canonicalize-targets-from-fstab-on-mount-a.patch)
===================================================================
--- testing-x86_64/libmount-canonicalize-targets-from-fstab-on-mount-a.patch    
                        (rev 0)
+++ testing-x86_64/libmount-canonicalize-targets-from-fstab-on-mount-a.patch    
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,55 @@
+From 6eba938376c2c870d9258ef9d7b6a3690cfa78dd Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 22:52:45 +0100
+Subject: [PATCH 11/12] libmount: canonicalize targets from fstab on mount -a
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/tab.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libmount/src/tab.c b/libmount/src/tab.c
+index 66a9e4d..21b05c7 100644
+--- a/libmount/src/tab.c
++++ b/libmount/src/tab.c
+@@ -830,8 +830,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+ {
+       char *root = NULL;
+       struct libmnt_fs *src_fs;
+-      const char *src, *tgt;
+-      char *xsrc = NULL;
++      const char *src;
++      char *xsrc = NULL, *tgt;
+       int flags = 0, rc = 0;
+ 
+       assert(tb);
+@@ -852,7 +852,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+               src = xsrc = mnt_resolve_spec(mnt_fs_get_source(fstab_fs),
+                                             tb->cache);
+ 
+-      tgt = mnt_fs_get_target(fstab_fs);
++      tgt = mnt_resolve_path(mnt_fs_get_target(fstab_fs), tb->cache);
+ 
+       if (tgt && src && root) {
+               struct libmnt_iter itr;
+@@ -870,7 +870,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+                        * network filesystem source paths.
+                        */
+                       if (t && s && r &&
+-                          strcmp(t, tgt) == 0 &&
++                          streq_except_trailing_slash(t, tgt) &&
+                           streq_except_trailing_slash(s, src) &&
+                           strcmp(r, root) == 0)
+                               break;
+@@ -881,6 +881,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, 
struct libmnt_fs *fstab_fs)
+ 
+       if (xsrc && !tb->cache)
+               free(xsrc);
++      if (!tb->cache)
++              free(tgt);
+ 
+       free(root);
+       return rc;
+-- 
+1.7.9.2
+

Deleted: testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch
===================================================================
--- testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch        
2012-02-29 16:45:33 UTC (rev 151650)
+++ testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch        
2012-02-29 16:49:07 UTC (rev 151651)
@@ -1,34 +0,0 @@
-From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001
-From: Karel Zak <[email protected]>
-Date: Mon, 27 Feb 2012 16:43:12 +0100
-Subject: [PATCH] libmount: use mount.<type> -s for NFS only
-
-Unfortunately, it seems that for example mount.cifs don't care about
-the API, so we need exception like the original mount(8).
-
-Signed-off-by: Karel Zak <[email protected]>
----
- libmount/src/context_mount.c |    7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
-index 8cbc25b..a0c5951 100644
---- a/libmount/src/context_mount.c
-+++ b/libmount/src/context_mount.c
-@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
-               args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
-               args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
- 
--              if (mnt_context_is_sloppy(cxt))
-+              /*
-+               * TODO: remove the exception for "nfs", -s is documented
-+               *       for years should be usable everywhere.
-+               */
-+              if (mnt_context_is_sloppy(cxt) &&
-+                  type && startswith(type, "nfs"))
-                       args[i++] = "-s";               /* 4 */
-               if (mnt_context_is_fake(cxt))
-                       args[i++] = "-f";               /* 5 */
--- 
-1.7.9.2
-

Copied: 
util-linux/repos/testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch 
(from rev 151650, 
util-linux/trunk/libmount-use-mount.-type-s-for-NFS-only.patch)
===================================================================
--- testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch                
                (rev 0)
+++ testing-x86_64/libmount-use-mount.-type-s-for-NFS-only.patch        
2012-02-29 16:49:07 UTC (rev 151651)
@@ -0,0 +1,34 @@
+From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Mon, 27 Feb 2012 16:43:12 +0100
+Subject: [PATCH] libmount: use mount.<type> -s for NFS only
+
+Unfortunately, it seems that for example mount.cifs don't care about
+the API, so we need exception like the original mount(8).
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ libmount/src/context_mount.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index 8cbc25b..a0c5951 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
+               args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
+               args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
+ 
+-              if (mnt_context_is_sloppy(cxt))
++              /*
++               * TODO: remove the exception for "nfs", -s is documented
++               *       for years should be usable everywhere.
++               */
++              if (mnt_context_is_sloppy(cxt) &&
++                  type && startswith(type, "nfs"))
+                       args[i++] = "-s";               /* 4 */
+               if (mnt_context_is_fake(cxt))
+                       args[i++] = "-f";               /* 5 */
+-- 
+1.7.9.2
+

Copied: 
util-linux/repos/testing-x86_64/mount-new-cleanup-mount-a-return-codes.patch 
(from rev 151650, util-linux/trunk/mount-new-cleanup-mount-a-return-codes.patch)
===================================================================
--- testing-x86_64/mount-new-cleanup-mount-a-return-codes.patch                 
        (rev 0)
+++ testing-x86_64/mount-new-cleanup-mount-a-return-codes.patch 2012-02-29 
16:49:07 UTC (rev 151651)
@@ -0,0 +1,101 @@
+From 16b73aae8cb73df2974fd75c2a42ec3b92535851 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Fri, 24 Feb 2012 23:03:22 +0100
+Subject: [PATCH 12/12] mount: (new) cleanup mount -a return codes
+
+New return codes:
+
+  0 : all mounted (or all ignored)
+ 64 : some mounted, some failed
+ 32 : all failed
+
+Note that already mounted or ignored (filtered out by -t or -O)
+filesystems don't affect the final return code.
+
+The original mount(8) returns 0 instead of 64, so the situation
+"some mounted, some failed" cannot be detected.
+
+Signed-off-by: Karel Zak <[email protected]>
+---
+ sys-utils/mount.8 |    4 ++++
+ sys-utils/mount.c |   23 +++++++++++++++++------
+ 2 files changed, 21 insertions(+), 6 deletions(-)
+
+diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
+index f1cff74..d18881b 100644
+--- a/sys-utils/mount.8
++++ b/sys-utils/mount.8
+@@ -2759,6 +2759,10 @@ mount failure
+ .TP
+ .BR 64
+ some mount succeeded
++.RE
++
++The command mount -a returns 0 (all success), 32 (all failed) or 64 (some
++failed, some success).
+ 
+ .SH NOTES
+ The syntax of external mount helpers is:
+diff --git a/sys-utils/mount.c b/sys-utils/mount.c
+index 17991b0..3fbac04 100644
+--- a/sys-utils/mount.c
++++ b/sys-utils/mount.c
+@@ -182,6 +182,8 @@ static int mount_all(struct libmnt_context *cxt)
+       struct libmnt_fs *fs;
+       int mntrc, ignored, rc = MOUNT_EX_SUCCESS;
+ 
++      int nsucc = 0, nerrs = 0;
++
+       itr = mnt_new_iter(MNT_ITER_FORWARD);
+       if (!itr) {
+               warn(_("failed to initialize libmount iterator"));
+@@ -197,31 +199,40 @@ static int mount_all(struct libmnt_context *cxt)
+                               printf(ignored == 1 ? _("%-25s: ignored\n") :
+                                                     _("%-25s: already 
mounted\n"),
+                                               tgt);
+-
+               } else if (mnt_context_is_fork(cxt)) {
+                       if (mnt_context_is_verbose(cxt))
+                               printf("%-25s: mount successfully forked\n", 
tgt);
+               } else {
+-                      rc |= mk_exit_code(cxt, mntrc);
++                      mk_exit_code(cxt, mntrc);       /* to print warnings */
+ 
+                       if (mnt_context_get_status(cxt)) {
+-                              rc |= MOUNT_EX_SOMEOK;
++                              nsucc++;
+ 
+                               if (mnt_context_is_verbose(cxt))
+                                       printf("%-25s: successfully mounted\n", 
tgt);
+-                      }
++                      } else
++                              nerrs++;
+               }
+       }
+ 
+       if (mnt_context_is_parent(cxt)) {
+               /* wait for mount --fork children */
+-              int nerrs = 0, nchildren = 0;
++              int nchildren = 0;
++
++              nerrs = 0, nsucc = 0;
+ 
+               rc = mnt_context_wait_for_children(cxt, &nchildren, &nerrs);
+               if (!rc && nchildren)
+-                      rc = nchildren == nerrs ? MOUNT_EX_FAIL : 
MOUNT_EX_SOMEOK;
++                      nsucc = nchildren - nerrs;
+       }
+ 
++      if (nerrs == 0)
++              rc = MOUNT_EX_SUCCESS;          /* all success */
++      else if (nsucc == 0)
++              rc = MOUNT_EX_FAIL;             /* all failed */
++      else
++              rc = MOUNT_EX_SOMEOK;           /* some success, some failed */
++
+       mnt_free_iter(itr);
+       return rc;
+ }
+-- 
+1.7.9.2
+

Reply via email to