4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 2017 Peter Tribble.
27 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
31 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
32 /* All Rights Reserved */
35 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
54 static void usage(void);
55 static void trap(int signo
);
58 main(int argc
, char *argv
[])
65 (void) setlocale(LC_ALL
, "");
67 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
68 #define TEXT_DOMAIN "SYS_TEST"
70 (void) textdomain(TEXT_DOMAIN
);
72 (void) set_prog_name(argv
[0]);
74 while ((c
= getopt(argc
, argv
, "snio?")) != EOF
) {
81 options
|= PT_INFO_ONLY
;
85 options
|= PT_OVERWRITE
;
89 options
|= PT_ODTSTREAM
;
97 func
= signal(SIGINT
, trap
);
99 (void) signal(SIGINT
, func
);
100 (void) signal(SIGHUP
, trap
);
101 (void) signal(SIGQUIT
, trap
);
102 (void) signal(SIGTERM
, trap
);
103 (void) signal(SIGPIPE
, trap
);
104 (void) signal(SIGPWR
, trap
);
106 if ((argc
-optind
) < 2) {
111 ret
= pkgtrans(flex_device(argv
[optind
], 1),
112 flex_device(argv
[optind
+1], 1), &argv
[optind
+2], options
);
121 (void) signal(SIGINT
, SIG_IGN
);
122 (void) signal(SIGHUP
, SIG_IGN
);
124 (void) pkghead(NULL
);
131 (void) signal(SIGINT
, SIG_IGN
);
132 (void) signal(SIGHUP
, SIG_IGN
);
134 if (signo
== SIGINT
) {
135 progerr(gettext("aborted at user request.\n"));
138 progerr(gettext("aborted by signal %d\n"), signo
);
145 (void) fprintf(stderr
,
146 gettext("usage: %s [-ions] srcdev dstdev [pkg [pkg...]]\n"),