From 045807092815a70e523112bfea3a1077e2dfc125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 8 May 2021 15:04:48 +0200 Subject: [PATCH] zstreamdump: replace with link to zstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zstreamdump(8) was in quite a bad state, and the wrapper didn't work if invoked without /sbin in $PATH Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12015 --- cmd/Makefile.am | 2 +- cmd/zstream/Makefile.am | 3 ++ cmd/zstream/zstream.c | 5 ++++ cmd/zstreamdump/Makefile.am | 1 - cmd/zstreamdump/zstreamdump | 3 -- configure.ac | 2 +- man/man8/zstream.8 | 8 ++++- man/man8/zstreamdump.8 | 59 +------------------------------------ 8 files changed, 18 insertions(+), 65 deletions(-) delete mode 100644 cmd/zstreamdump/Makefile.am delete mode 100755 cmd/zstreamdump/zstreamdump mode change 100644 => 120000 man/man8/zstreamdump.8 diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 473fcb0e07..a3db316791 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = zfs zpool zdb zhack zinject zstream zstreamdump ztest +SUBDIRS = zfs zpool zdb zhack zinject zstream ztest SUBDIRS += fsck_zfs vdev_id raidz_test zfs_ids_to_path SUBDIRS += zpool_influxdb diff --git a/cmd/zstream/Makefile.am b/cmd/zstream/Makefile.am index 69e1adbcbd..f36e1e364f 100644 --- a/cmd/zstream/Makefile.am +++ b/cmd/zstream/Makefile.am @@ -15,3 +15,6 @@ zstream_LDADD = \ $(abs_top_builddir)/lib/libnvpair/libnvpair.la include $(top_srcdir)/config/CppCheck.am + +install-exec-hook: + $(LN_S) zstream $(DESTDIR)$(sbindir)/zstreamdump diff --git a/cmd/zstream/zstream.c b/cmd/zstream/zstream.c index cbcb560a86..523ae06897 100644 --- a/cmd/zstream/zstream.c +++ b/cmd/zstream/zstream.c @@ -49,6 +49,11 @@ zstream_usage(void) int main(int argc, char *argv[]) { + char *basename = strrchr(argv[0], '/'); + basename = basename ? (basename + 1) : argv[0]; + if (argc >= 1 && strcmp(basename, "zstreamdump") == 0) + return (zstream_do_dump(argc, argv)); + if (argc < 2) zstream_usage(); diff --git a/cmd/zstreamdump/Makefile.am b/cmd/zstreamdump/Makefile.am deleted file mode 100644 index 2c04d85131..0000000000 --- a/cmd/zstreamdump/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -dist_sbin_SCRIPTS = zstreamdump diff --git a/cmd/zstreamdump/zstreamdump b/cmd/zstreamdump/zstreamdump deleted file mode 100755 index 17f1aa4b22..0000000000 --- a/cmd/zstreamdump/zstreamdump +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec zstream dump "$@" diff --git a/configure.ac b/configure.ac index e31d122713..077ad7c43f 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,7 @@ AC_CONFIG_HEADERS([zfs_config.h], [ LT_INIT AC_PROG_INSTALL AC_PROG_CC +AC_PROG_LN_S PKG_PROG_PKG_CONFIG AM_PROG_AS AM_PROG_CC_C_O @@ -83,7 +84,6 @@ AC_CONFIG_FILES([ cmd/zinject/Makefile cmd/zpool/Makefile cmd/zstream/Makefile - cmd/zstreamdump/Makefile cmd/ztest/Makefile cmd/zvol_id/Makefile cmd/zvol_wait/Makefile diff --git a/man/man8/zstream.8 b/man/man8/zstream.8 index 2912f10c69..0536a23f04 100644 --- a/man/man8/zstream.8 +++ b/man/man8/zstream.8 @@ -20,7 +20,7 @@ .\" .\" .\" Copyright (c) 2020 by Delphix. All rights reserved. -.Dd March 25, 2020 +.Dd May 8, 2021 .Dt ZSTREAM 8 .Os .Sh NAME @@ -67,6 +67,12 @@ Print metadata for each record. Dump data contained in each record. Implies verbose. .El +.Pp +The +.Nm zstreamdump +alias is provided for compatibility and is equivalent to running +.Nm +.Cm dump . .It Xo .Nm .Cm token diff --git a/man/man8/zstreamdump.8 b/man/man8/zstreamdump.8 deleted file mode 100644 index f499be442a..0000000000 --- a/man/man8/zstreamdump.8 +++ /dev/null @@ -1,58 +0,0 @@ -'\" te -.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with -.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH ZSTREAMDUMP 8 "Aug 24, 2020" OpenZFS -.SH NAME -zstreamdump \- filter data in zfs send stream -.SH SYNOPSIS -.LP -.nf -\fBzstreamdump\fR [\fB-C\fR] [\fB-v\fR] [\fB-d\fR] -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBzstreamdump\fR utility reads from the output of the \fBzfs send\fR -command, then displays headers and some statistics from that output. See -\fBzfs\fR(8). -.SH OPTIONS -.sp -.LP -The following options are supported: -.sp -.ne 2 -.na -\fB-C\fR -.ad -.sp .6 -.RS 4n -Suppress the validation of checksums. -.RE - -.sp -.ne 2 -.na -\fB-v\fR -.ad -.sp .6 -.RS 4n -Verbose. Dump all headers, not only begin and end headers. -.RE - -.sp -.ne 2 -.na -\fB-d\fR -.ad -.sp .6 -.RS 4n -Dump contents of blocks modified. Implies verbose. -.RE - -.SH SEE ALSO -.sp -.LP -\fBzfs\fR(8) diff --git a/man/man8/zstreamdump.8 b/man/man8/zstreamdump.8 new file mode 120000 index 0000000000..c6721daf11 --- /dev/null +++ b/man/man8/zstreamdump.8 @@ -0,0 +1 @@ +zstream.8 \ No newline at end of file