Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/vndcompress Rename block size option from `-s' to `-b'.
details: https://anonhg.NetBSD.org/src/rev/b702737a3140
branches: trunk
changeset: 792951:b702737a3140
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jan 22 06:17:25 2014 +0000
description:
Rename block size option from `-s' to `-b'.
Makes more sense and makes it consistent with other utilities such as
pax and pigz. This vndcompress has never gone out in a release, so
changing the name of the option shouldn't cause too many problems...
diffstat:
usr.bin/vndcompress/Makefile | 8 ++++----
usr.bin/vndcompress/common.h | 4 ++--
usr.bin/vndcompress/main.c | 38 +++++++++++++++++++-------------------
usr.bin/vndcompress/vndcompress.c | 10 +++++-----
4 files changed, 30 insertions(+), 30 deletions(-)
diffs (171 lines):
diff -r 93a1ebb4b11b -r b702737a3140 usr.bin/vndcompress/Makefile
--- a/usr.bin/vndcompress/Makefile Wed Jan 22 06:17:16 2014 +0000
+++ b/usr.bin/vndcompress/Makefile Wed Jan 22 06:17:25 2014 +0000
@@ -106,10 +106,10 @@
cmp part.orig part.out
part.cl2: part.orig part.cl2part vndcompress
cp part.cl2part ${.TARGET}.tmp \
- && ./vndcompress -s 512 -rR part.orig ${.TARGET}.tmp \
+ && ./vndcompress -b 512 -rR part.orig ${.TARGET}.tmp \
&& mv -f ${.TARGET}.tmp ${.TARGET}
part.cl2part: part.orig vndcompress
- ./vndcompress -s 512 -p 10 part.orig ${.TARGET}.tmp \
+ ./vndcompress -b 512 -p 10 part.orig ${.TARGET}.tmp \
&& mv -f ${.TARGET}.tmp ${.TARGET}
part.orig:
head -c 12345 < /usr/share/dict/words > ${.TARGET}.tmp \
@@ -161,7 +161,7 @@
# @echo '# expecting failure...'
# if head -c $$((64 * 1024 * 1024)) < /dev/zero \
# | (ulimit -v $$((139 * 1024)) && \
-# ./vndcompress -l 64m -s 512 /dev/stdin /dev/null); then \
+# ./vndcompress -l 64m -b 512 /dev/stdin /dev/null); then \
# echo 'unexpected pass!' && exit 1; \
# fi
#
@@ -169,7 +169,7 @@
#check-ulimit-window:
# head -c $$((64 * 1024 * 1024)) < /dev/zero \
# | (ulimit -v $$((139 * 1024)) && \
-# ./vndcompress -w 8192 -l 64m -s 512 /dev/stdin /dev/null)
+# ./vndcompress -w 8192 -l 64m -b 512 /dev/stdin /dev/null)
TESTSUFFIXES+= in cl2 cl2x out outx
diff -r 93a1ebb4b11b -r b702737a3140 usr.bin/vndcompress/common.h
--- a/usr.bin/vndcompress/common.h Wed Jan 22 06:17:16 2014 +0000
+++ b/usr.bin/vndcompress/common.h Wed Jan 22 06:17:25 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.4 2014/01/22 06:15:57 riastradh Exp $ */
+/* $NetBSD: common.h,v 1.5 2014/01/22 06:17:25 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
#define FLAG_d 0x0002 /* Decompress */
#define FLAG_p 0x0004 /* Partial */
#define FLAG_r 0x0008 /* Restart */
-#define FLAG_s 0x0010 /* block Size */
+#define FLAG_b 0x0010 /* Block size */
#define FLAG_R 0x0020 /* abort on Restart failure */
#define FLAG_k 0x0040 /* checKpoint blocks */
#define FLAG_l 0x0080 /* Length of input */
diff -r 93a1ebb4b11b -r b702737a3140 usr.bin/vndcompress/main.c
--- a/usr.bin/vndcompress/main.c Wed Jan 22 06:17:16 2014 +0000
+++ b/usr.bin/vndcompress/main.c Wed Jan 22 06:17:25 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.2 2014/01/22 06:15:57 riastradh Exp $ */
+/* $NetBSD: main.c,v 1.3 2014/01/22 06:17:25 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: main.c,v 1.2 2014/01/22 06:15:57 riastradh Exp $");
+__RCSID("$NetBSD: main.c,v 1.3 2014/01/22 06:17:25 riastradh Exp $");
#include <assert.h>
#include <err.h>
@@ -60,8 +60,20 @@
warnx("unknown program name, defaulting to vndcompress: %s",
getprogname());
- while ((ch = getopt(argc, argv, "cdk:l:p:rRs:w:")) != -1) {
+ while ((ch = getopt(argc, argv, "b:cdk:l:p:rRw:")) != -1) {
switch (ch) {
+ case 'b':
+ if (ISSET(O->flags, FLAG_b)) {
+ warnx("-b may be supplied only once");
+ usage();
+ }
+ O->flags |= FLAG_b;
+ __CTASSERT(MIN_BLOCKSIZE <= MAX_BLOCKSIZE);
+ __CTASSERT(MAX_BLOCKSIZE <= LLONG_MAX);
+ O->blocksize = strsuftoll("block size", optarg,
+ MIN_BLOCKSIZE, MAX_BLOCKSIZE);
+ break;
+
case 'c':
if (ISSET(O->flags, FLAG_d)) {
warnx("-c and -d are mutually exclusive");
@@ -116,18 +128,6 @@
O->flags |= FLAG_R;
break;
- case 's':
- if (ISSET(O->flags, FLAG_s)) {
- warnx("-s may be supplied only once");
- usage();
- }
- O->flags |= FLAG_s;
- __CTASSERT(MIN_BLOCKSIZE <= MAX_BLOCKSIZE);
- __CTASSERT(MAX_BLOCKSIZE <= LLONG_MAX);
- O->blocksize = strsuftoll("block size", optarg,
- MIN_BLOCKSIZE, MAX_BLOCKSIZE);
- break;
-
case 'w':
if (ISSET(O->flags, FLAG_w)) {
warnx("-w may be supplied only once");
@@ -152,8 +152,8 @@
usage();
} else {
assert(operation == &vndcompress);
- if (ISSET(O->flags, ~(FLAG_c | FLAG_k | FLAG_l | FLAG_p |
- FLAG_r | FLAG_s | FLAG_R | FLAG_w)))
+ if (ISSET(O->flags, ~(FLAG_b | FLAG_c | FLAG_k | FLAG_l |
+ FLAG_p | FLAG_r | FLAG_R | FLAG_w)))
usage();
if (ISSET(O->flags, FLAG_R) && !ISSET(O->flags, FLAG_r)) {
warnx("-R makes no sense without -r");
@@ -169,8 +169,8 @@
{
(void)fprintf(stderr,
- "Usage: %s -c [-rR] [-k <checkpoint-blocks>] [-l <length>]\n"
- " [-p <partial-offset>] [-s <blocksize>] [-w <winsize>]\n"
+ "Usage: %s -c [-rR] [-b <blocksize>] [-k <checkpoint-blocks>]\n"
+ " [-l <length>] [-p <partial-offset>] [-w <winsize>]\n"
" <image> <compressed-image> [<blocksize>]\n"
" %s -d <compressed-image> <image>\n",
getprogname(), getprogname());
diff -r 93a1ebb4b11b -r b702737a3140 usr.bin/vndcompress/vndcompress.c
--- a/usr.bin/vndcompress/vndcompress.c Wed Jan 22 06:17:16 2014 +0000
+++ b/usr.bin/vndcompress/vndcompress.c Wed Jan 22 06:17:25 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vndcompress.c,v 1.20 2014/01/22 06:16:32 riastradh Exp $ */
+/* $NetBSD: vndcompress.c,v 1.21 2014/01/22 06:17:25 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: vndcompress.c,v 1.20 2014/01/22 06:16:32 riastradh Exp $");
+__RCSID("$NetBSD: vndcompress.c,v 1.21 2014/01/22 06:17:25 riastradh Exp $");
#include <sys/endian.h>
@@ -392,16 +392,16 @@
const char *const image_pathname = argv[0];
const char *const cloop2_pathname = argv[1];
- /* Grab the block size either from `-s' or from the last argument. */
+ /* Grab the block size either from `-b' or from the last argument. */
__CTASSERT(0 < DEV_BSIZE);
__CTASSERT((MIN_BLOCKSIZE % DEV_BSIZE) == 0);
__CTASSERT(MIN_BLOCKSIZE <= DEF_BLOCKSIZE);
__CTASSERT((DEF_BLOCKSIZE % DEV_BSIZE) == 0);
__CTASSERT(DEF_BLOCKSIZE <= MAX_BLOCKSIZE);
__CTASSERT((MAX_BLOCKSIZE % DEV_BSIZE) == 0);
- if (ISSET(O->flags, FLAG_s)) {
+ if (ISSET(O->flags, FLAG_b)) {
if (argc == 3) {
- warnx("use -s or the extra argument, not both");
+ warnx("use -b or the extra argument, not both");
usage();
}
S->blocksize = O->blocksize;
Home |
Main Index |
Thread Index |
Old Index