5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * CDDL HEADER START
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * The contents of this file are subject to the terms of the
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Common Development and Distribution License (the "License").
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * You may not use this file except in compliance with the License.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * or http://www.opensolaris.org/os/licensing.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * See the License for the specific language governing permissions
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * and limitations under the License.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * When distributing Covered Code, include this CDDL HEADER in each
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * If applicable, add the following below this CDDL HEADER, with the
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * fields enclosed by brackets "[]" replaced with your own identifying
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * information: Portions Copyright [yyyy] [name of copyright owner]
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * CDDL HEADER END
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Use is subject to license terms.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland/* All Rights Reserved */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#define ERR_ROOT_SET "Could not set install root from the environment."
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#define ERR_ROOT_CMD "Command line install root contends with environment."
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#define ERR_MESG "unable to locate parameter information for \"%s\""
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#define ERR_FLT "parsing error in parameter file"
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland "\t%s [-v] [-d device] pkginst [param [param ...]]\n" \
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland "\t%s [-v] -f file [param [param ...]]\n"
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterlandstatic void print_entry(char *, char *);
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland (void) fprintf(stderr, gettext(ERR_USAGE), prog, prog);
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* initialize locale mechanism */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* determine program name */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* establish installation root directory */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland if (!set_inst_root(getenv("PKG_INSTALL_ROOT"))) {
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland while ((c = getopt(argc, argv, "R:vd:f:?")) != EOF) {
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* -f could specify filename to get parameters from */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* -d could specify stream or mountable device */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland return (1); /* couldn't obtain info about device */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* If a filename was specified or install db does not exist */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * some other error besides no value for this
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * particular parameter
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland } while (!argv[optind] || (++optind < argc));
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland (void) pkgparam(NULL, NULL); /* close open FDs so umount won't fail */