/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <locale.h>
#include <libintl.h>
#include <errno.h>
#include "pkglib.h"
#include "install.h"
#include "libadm.h"
#include "libinst.h"
#include "pkginstall.h"
#include "messages.h"
extern char saveSpoolInstallDir[];
extern char pkgsav[]; /* pkginstall/main.c */
static char *infoloc;
/*
* flag definitions for each entry in table
*/
typedef unsigned int TBL_FLAG_T;
/* no flag set */
/* exclude this attribute if found */
/* this attribute must not change if found */
/*
* macro to generate an entry in the table:
* TBL_ENTRY("PKGINFO_ATTRIBUTE=", FLAG_XXX)
* where:
* "PKGINFO_ATTRIBUTE=" is the attribute to look for
* FLAG_XXX is the action to perform when the attribute is found
*/
/*
* table containing attributes that require special handling
*/
struct _namelist {
};
/*
* These are attributes to be acted on in some way when a pkginfo file is
* merged. This table MUST be in alphabetical order because it is searched
* using a binary search algorithm.
*/
};
/*
* While pkgsav has to be set up with reference to the server for package
* scripts, it has to be client-relative in the pkginfo file. This function
* is used to set the client-relative value for use in the pkginfo file.
*/
void
{
if (is_an_inst_root()) {
/* Strip the server portion of the path. */
} else {
}
}
}
void
{
int i;
int nc;
int out;
/* remove savelog from previous attempts */
/*
* create path to appropriate pkginfo file for the package that is
* already installed - is_spool_create() will be set (!= 0) if the
* -t option is presented to pkginstall - the -t option is used to
* disable save spool area creation; do not spool any partial package
* contents, that is, suppress the creation and population of the
* option is set only when a non-global zone is being created.
*/
if (is_spool_create() == 0) {
/*
* normal package install (not a non-global zone install);
* use the standard installed pkginfo file for this package:
* as the source pkginfo file to scan.
*/
((get_inst_root()) &&
PKGINFO);
if (i > sizeof (pkginfoPath)) {
((get_inst_root()) &&
get_inst_root() : "/",
pkginst);
quit(1);
}
} else {
/*
* non-global zone installation - use the "saved" pspool
* pkginfo file in the global zone for this package:
* as the source pkginfo file to scan.
*/
if (i > sizeof (pkginfoPath)) {
quit(1);
}
}
if (i > PATH_MAX) {
quit(1);
}
/* entry debugging info */
((get_inst_root()) &&
get_inst_root() : "??",
pkginfoPath, path);
/*
* open the pkginfo file:
* if the source pkginfo file to check is the same as the merged one
* pkginfo file to "verify"
*/
} else {
}
}
/*
* output packaging environment to create a pkginfo file in pkgloc[]
*/
quit(99);
}
/*
* output CLASSES attribute
*/
out = 0;
if (pclass) {
out++;
for (i = 1; pclass[i]; i++) {
out++;
}
}
for (i = 0; i < nc; i++) {
int found = 0;
if (pclass) {
int j;
for (j = 0; pclass[j]; ++j) {
found++;
break;
}
}
}
if (!found) {
if (out > 0) {
}
out++;
}
}
/*
* NOTE : BASEDIR below is relative to the machine that
* *runs* the package. If there's an install root, this
* is actually the CLIENT_BASEDIR wrt the machine
* doing the pkgadd'ing here. -- JST
*/
if (is_a_basedir()) {
} else {
}
/*
* output all other environment attributes except those which
* are relevant only to install.
*/
/*
* find this attribute in the table - accept the attribute if it
* is outside of the bounds of the table; otherwise, do a binary
* search looking for this attribute.
*/
/* entry < first entry in attribute table */
/* entry > last entry in attribute table */
} else {
/* first entry < entry < last entry in table: search */
while (incr > 0) { /* while possible to divide */
int r;
/* compare current attr with this table entry */
/* break out of loop if match */
if (r == 0) {
break;
}
continue;
}
}
/* handle excluded attribute found */
/* attribute is excluded */
continue;
}
/* handle fixed attribute found */
/* attribute must not change */
char *trg;
/* isolate attribute name only without '=' at end */
/* lookup attribute in installed package pkginfo file */
/* if target not found attribute is being added */
quit(1);
}
/* error if two values are not the same */
quit(1);
}
}
continue;
}
install_from_pspool != 0 &&
!isUpdate()) {
continue;
}
}
/*
* copy all packaging scripts to appropriate directory
*/
if (i > PATH_MAX) {
quit(1);
}
continue;
if (i > PATH_MAX) {
quit(1);
}
if (i > PATH_MAX) {
quit(1);
}
quit(99);
}
}
}
/*
* copy all packaging scripts to the partial spool directory
*/
if (!is_spool_create()) {
if (i > PATH_MAX) {
quit(1);
}
continue;
/*
* Don't copy i.none since if it exists it
* contains Class Archive Format procedure
* for installing archives. Only Directory
* Format packages can exist
* in a global spooled area.
*/
continue;
if (i > PATH_MAX) {
quit(1);
}
if (i > PATH_MAX) {
quit(1);
}
quit(99);
}
}
}
/*
* Now copy the original pkginfo and pkgmap files from the
* installing package to the spooled directory.
*/
if (i > sizeof (path)) {
quit(1);
}
if (i > sizeof (temp)) {
PKGINFO);
quit(1);
}
quit(99);
}
if (i > sizeof (path)) {
quit(1);
}
if (i > sizeof (path)) {
"pkgmap");
quit(1);
}
quit(99);
}
}
/*
* If we are installing from a spool directory
* copy the save directory from it, it may have
* been patched. Duplicate it only if this
* installation isn't an update and is not to
* an alternate root.
*/
if (i > sizeof (path)) {
quit(1);
}
if (i > sizeof (cmd)) {
quit(1);
}
quit(99);
}
}
}
}