[quota] Fix documentation

Petr Pisar ppisar at fedoraproject.org
Thu Mar 14 08:47:15 UTC 2013


commit 0713020a8186cec4f298c514ce837c3385f903a4
Author: Petr Písař <ppisar at redhat.com>
Date:   Thu Mar 14 09:28:48 2013 +0100

    Fix documentation

 quota-4.01-Add-quotasync-1-manual-page.patch |   96 ++++++++++++++++++++++++
 quota-4.01-Complete-quotasync-usage.patch    |   47 ++++++++++++
 quota-4.01-Correct-quotasync-exit-code.patch |  102 ++++++++++++++++++++++++++
 quota-4.01-Fix-various-usage-mistakes.patch  |   72 ++++++++++++++++++
 quota.spec                                   |   18 ++++-
 5 files changed, 334 insertions(+), 1 deletions(-)
---
diff --git a/quota-4.01-Add-quotasync-1-manual-page.patch b/quota-4.01-Add-quotasync-1-manual-page.patch
new file mode 100644
index 0000000..3345c58
--- /dev/null
+++ b/quota-4.01-Add-quotasync-1-manual-page.patch
@@ -0,0 +1,96 @@
+From 801386a31d0ae47779cf74cbb4f343be346a07db Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 6 Mar 2013 11:21:50 +0100
+Subject: [PATCH 1/4] Add quotasync(1) manual page
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+Signed-off-by: Jan Kara <jack at suse.cz>
+---
+ quotasync.1 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+ create mode 100644 quotasync.1
+
+diff --git a/quotasync.1 b/quotasync.1
+new file mode 100644
+index 0000000..e968403
+--- /dev/null
++++ b/quotasync.1
+@@ -0,0 +1,72 @@
++.TH QUOTASYNC 1
++.SH NAME
++quotasync \- synchronize in-kernel file system usage and limits to disk format
++.SH SYNOPSIS
++.B quotasync
++[
++.B -ug
++] 
++.IR mount-point ...
++.br
++.B quotasync
++[
++.B -ug
++] 
++.B -a
++.br
++.B quotasync
++.B -h
++|
++.B -V
++.SH DESCRIPTION
++.B quotasync
++flushes file system usage and limits from kernel memory to quota files stored
++in the file system. By default only the user quotas are synchronized.
++.P
++This tool can be useful if you want to display accurate quotas by tools that
++parse quota files, like
++.BR repquota (8).
++.SH OPTIONS
++.TP
++.B -u, --user
++Synchronize user usage and limits.
++.TP
++.B -g, --group
++Synchronize group usage and limits.
++.TP
++.B -a, --all
++Synchronize usage and limits on all file systems. You have to specify this
++option or to specify desired file systems.
++.TP
++.B -V, --version
++Show program version information and exit.
++.TP
++.B -h, --help
++Show program usage and exit.
++.SH DIAGNOSTICS
++If requested synchronization fails, or invalid option is given,
++.B quotasync
++will terminate with non-zero exit code. Otherwise it will return zero.
++.SH FILES
++.PD 0
++.TP 16
++.B aquota.user " or " aquota.group
++Quota file at the file system root (version 2 quota, non-XFS/GFS2 file systems).
++.TP 16
++.B quota.user " or " quota.group
++Quota file at the file system root (version 1 quota, non-XFS/GFS2 file systems).
++.TP 16
++.B /etc/mtab
++List of mounted file systems maintained by user space.
++.TP 16
++.B /proc/mounts
++List of mounted file systems maintained by kernel.
++.PD
++.SH SEE ALSO
++.BR quota (1),
++.BR quotactl (2),
++.BR mount (8),
++.BR quotacheck (8),
++.BR quotaon (8),
++.BR repquota (8),
++.BR warnquota (8).
+-- 
+1.8.1.4
+
diff --git a/quota-4.01-Complete-quotasync-usage.patch b/quota-4.01-Complete-quotasync-usage.patch
new file mode 100644
index 0000000..e66eb9b
--- /dev/null
+++ b/quota-4.01-Complete-quotasync-usage.patch
@@ -0,0 +1,47 @@
+From 9384c1c0f8b64535595c89bb2b1a980538c8be43 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 6 Mar 2013 13:10:25 +0100
+Subject: [PATCH 2/4] Complete quotasync usage
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+Signed-off-by: Jan Kara <jack at suse.cz>
+---
+ quotasync.c | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/quotasync.c b/quotasync.c
+index dd8ade9..cab9015 100644
+--- a/quotasync.c
++++ b/quotasync.c
+@@ -22,8 +22,23 @@ char *progname;
+ 
+ static void usage(void)
+ {
+-	errstr(_("Utility for syncing quotas.\nUsage:\n%s [-ug] -a | mntpoint...\n\n"), progname);
+-	fprintf(stderr, _("Bugs to %s\n"), MY_EMAIL);
++	printf(_(
++"%1$s: Utility for syncing quotas.\n"
++"Usage: %1$s [-ug] mount-point...\n"
++"   or: %1$s [-ug] -a\n"
++"   or: %1$s -h | -V\n"
++"\n"
++		), progname);
++	printf(_(
++"Options:\n"
++"-u, --user     synchronize user quotas\n"
++"-g, --group    synchronize group quotas\n"
++"-a, --all      synchronize quotas for all mounted file systems\n"
++"-h, --help     display this help message and exit\n"
++"-V, --version  display version information and exit\n"
++"\n"
++		));
++	printf(_("Report bugs to <%s>.\n"), MY_EMAIL);
+ 	exit(1);
+ }
+ 
+-- 
+1.8.1.4
+
diff --git a/quota-4.01-Correct-quotasync-exit-code.patch b/quota-4.01-Correct-quotasync-exit-code.patch
new file mode 100644
index 0000000..68a903e
--- /dev/null
+++ b/quota-4.01-Correct-quotasync-exit-code.patch
@@ -0,0 +1,102 @@
+From 0d5a11f41afe14f779908fbc366c492b818a0864 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 6 Mar 2013 11:32:32 +0100
+Subject: [PATCH 3/4] Correct quotasync exit code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes `quotasync -h' exit code as well as it uses more portable
+EXIT_SUCCESS/EXIT_FAILURE values.
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+Signed-off-by: Jan Kara <jack at suse.cz>
+---
+ quotasync.c | 23 +++++++++++++----------
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/quotasync.c b/quotasync.c
+index cab9015..cfc3f2d 100644
+--- a/quotasync.c
++++ b/quotasync.c
+@@ -20,7 +20,7 @@ static char **mnt;
+ static int mntcnt;
+ char *progname;
+ 
+-static void usage(void)
++static void usage(int status)
+ {
+ 	printf(_(
+ "%1$s: Utility for syncing quotas.\n"
+@@ -39,7 +39,7 @@ static void usage(void)
+ "\n"
+ 		));
+ 	printf(_("Report bugs to <%s>.\n"), MY_EMAIL);
+-	exit(1);
++	exit(status);
+ }
+ 
+ static void parse_options(int argcnt, char **argstr)
+@@ -57,11 +57,12 @@ static void parse_options(int argcnt, char **argstr)
+ 	while ((ret = getopt_long(argcnt, argstr, "ahugV", long_opts, NULL)) != -1) {
+ 		switch (ret) {
+ 			case '?':
++				usage(EXIT_FAILURE);
+ 			case 'h':
+-				usage();
++				usage(EXIT_SUCCESS);
+ 			case 'V':
+ 				version();
+-				exit(0);
++				exit(EXIT_SUCCESS);
+ 			case 'u':
+ 				flags |= FL_USER;
+ 				break;
+@@ -77,7 +78,7 @@ static void parse_options(int argcnt, char **argstr)
+ 	if ((flags & FL_ALL && optind != argcnt) ||
+ 	    (!(flags & FL_ALL) && optind == argcnt)) {
+ 		fputs(_("Bad number of arguments.\n"), stderr);
+-		usage();
++		usage(EXIT_FAILURE);
+ 	}
+ 	if (!(flags & FL_ALL)) {
+ 		mnt = argstr + optind;
+@@ -100,10 +101,12 @@ static int syncquotas(int type)
+ 	int i, ret = 0;
+ 
+ 	if (flags & FL_ALL) {
+-		if (sync_one(type, NULL) < 0)
++		if (sync_one(type, NULL) < 0) {
+ 			errstr(_("%s quota sync failed: %s\n"), _(type2name(type)),
+ 					strerror(errno));
+-		return -1;
++			ret = -1;
++		}
++		return ret;
+ 	}
+ 
+ 	handles = create_handle_list(mntcnt, mnt, type, fmt,
+@@ -124,7 +127,7 @@ static int syncquotas(int type)
+ 
+ int main(int argc, char **argv)
+ {
+-	int ret = 0;
++	int ret = EXIT_SUCCESS;
+ 
+ 	gettexton();
+ 	progname = basename(argv[0]);
+@@ -134,9 +137,9 @@ int main(int argc, char **argv)
+ 
+ 	if (flags & FL_USER)
+ 		if (syncquotas(USRQUOTA))
+-			ret = 1;
++			ret = EXIT_FAILURE;
+ 	if (flags & FL_GROUP)
+ 		if (syncquotas(GRPQUOTA))
+-			ret = 1;
++			ret = EXIT_FAILURE;
+ 	return ret;
+ }
+-- 
+1.8.1.4
+
diff --git a/quota-4.01-Fix-various-usage-mistakes.patch b/quota-4.01-Fix-various-usage-mistakes.patch
new file mode 100644
index 0000000..86e8504
--- /dev/null
+++ b/quota-4.01-Fix-various-usage-mistakes.patch
@@ -0,0 +1,72 @@
+From 97fad5f32bfe24b3a3ce8b3923b27099b746de06 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 6 Mar 2013 13:41:23 +0100
+Subject: [PATCH 4/4] Fix various usage mistakes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+quota: Fix long variant for -A option in usage
+repquota: Fix long variant for -c option in usage and manual
+repquota: Fix long variant for -C option in usage and manual
+repquota: Add -a, --all options to usage
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+Signed-off-by: Jan Kara <jack at suse.cz>
+---
+ quota.c    | 2 +-
+ repquota.8 | 4 ++--
+ repquota.c | 5 +++--
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/quota.c b/quota.c
+index 56e71a8..1befbde 100644
+--- a/quota.c
++++ b/quota.c
+@@ -102,7 +102,7 @@ static void usage(void)
+ -i, --no-autofs           do not query autofs mountpoints\n\
+ -F, --format=formatname   display quota of a specific format\n\
+ -f, --filesystem-list     display quota information only for given filesystems\n\
+--A, --nfs-all             display quota for all NFS mountpoints\n\
++-A, --all-nfs             display quota for all NFS mountpoints\n\
+ -m, --no-mixed-pathnames  trim leading slashes from NFSv4 mountpoints\n\
+     --show-mntpoint       show mount point of the file system in output\n\
+     --hide-device         do not show file system device in output\n\
+diff --git a/repquota.8 b/repquota.8
+index a71cf6b..bb6d7ab 100644
+--- a/repquota.8
++++ b/repquota.8
+@@ -84,11 +84,11 @@ to be read-write with quotas.
+ Report all quotas, even if there is no usage. Be also more verbose about quotafile
+ information.
+ .TP
+-.B -c, --batch-translation
++.B -c, --cache
+ Cache entries to report and translate uids/gids to names in big chunks by scanning
+ all users (default). This is good (fast) behaviour when using /etc/passwd file.
+ .TP
+-.B -C, --no-batch-translation
++.B -C, --no-cache
+ Translate individual entries. This is faster when you have users stored in database.
+ .TP
+ .B -t, --truncate-names
+diff --git a/repquota.c b/repquota.c
+index 43de31d..50683b9 100644
+--- a/repquota.c
++++ b/repquota.c
+@@ -56,9 +56,10 @@ static void usage(void)
+ -p, --raw-grace             print grace time in seconds since epoch\n\
+ -n, --no-names              do not translate uid/gid to name\n\
+ -i, --no-autofs             avoid autofs mountpoints\n\
+--c, --batch-translation     translate big number of ids at once\n\
+--C, --no-batch-translation  translate ids one by one\n\
++-c, --cache                 translate big number of ids at once\n\
++-C, --no-cache              translate ids one by one\n\
+ -F, --format=formatname     report information for specific format\n\
++-a, --all                   report information for all mount points with quotas\n\
+ -h, --help                  display this help message and exit\n\
+ -V, --version               display version information and exit\n\n"), progname);
+ 	fprintf(stderr, _("Bugs to %s\n"), MY_EMAIL);
+-- 
+1.8.1.4
+
diff --git a/quota.spec b/quota.spec
index 9ffb10b..83dc9c9 100644
--- a/quota.spec
+++ b/quota.spec
@@ -5,7 +5,7 @@ Name: quota
 Summary: System administration tools for monitoring users' disk usage
 Epoch: 1
 Version: 4.01
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: BSD and GPLv2+
 URL: http://sourceforge.net/projects/linuxquota/
 Group: System Environment/Base
@@ -32,6 +32,14 @@ Patch5: quota-4.01-define_charset_in_mail.patch
 Patch6: quota-4.01-Do-not-fiddle-with-quota-files-on-XFS-and-GFS.patch
 # In upstream after 4.01, SF#3602777
 Patch7: quota-4.01-quotacheck-Make-sure-d-provides-at-least-as-much-inf.patch
+# In upstream after 4.01, SF#3607034
+Patch8: quota-4.01-Add-quotasync-1-manual-page.patch
+# In upstream after 4.01, SF#3607034
+Patch9: quota-4.01-Complete-quotasync-usage.patch
+# In upstream after 4.01, SF#3607034
+Patch10: quota-4.01-Correct-quotasync-exit-code.patch
+# In upstream after 4.01, SF#3607038
+Patch11: quota-4.01-Fix-various-usage-mistakes.patch
 
 
 %description
@@ -111,6 +119,10 @@ Linux/UNIX environment.
 %patch5 -p1 -b .charset_in_mail
 %patch6 -p1 -b .gfs_files
 %patch7 -p1 -b .quotackeck_debug
+%patch8 -p1 -b .quotasync_manual
+%patch9 -p1 -b .quotasync_usage
+%patch10 -p1 -b .quotasync_exit
+%patch11 -p1 -b .usage
 
 #fix typos/mistakes in localized documentation
 for pofile in $(find ./po/*.p*)
@@ -225,6 +237,10 @@ echo '  systemd-sysv-convert --apply quota_nld'
 
 
 %changelog
+* Thu Mar 14 2013 Petr Pisar <ppisar at redhat.com> - 1:4.01-5
+- Add quotasync(1) manual page
+- Fix quota, repquota, and quotasync usage help
+
 * Tue Feb 05 2013 Petr Pisar <ppisar at redhat.com> - 1:4.01-4
 - Do not fiddle with quota files on XFS and GFS (bug #846296)
 - Make sure option -d at quotacheck provides at least as much information as


More information about the scm-commits mailing list