gpkglist.c revision 4656d4747c8743290bfbe910c64cd75eb4e4af8d
/*
* 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 2009 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 <ctype.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <stdlib.h>
#include <valtools.h>
#include "pkginfo.h"
#include "pkglib.h"
#include "pkglibmsgs.h"
#include "pkgstrct.h"
#include "pkglocale.h"
extern char *pkgdir; /* WHERE? */
/* libadm.a */
int presvr4flg);
#define CMDSIZ 512
#define LSIZE 256
#define MAXSIZE 128
#define MALLOCSIZ 128
#define MAX_CAT_ARGS 64
#define MAX_CAT_LEN 16
static int cont_in_list = 0; /* live continuation */
/*
* Allocate memory for the next package name. This function attempts the
* allocation and if that succeeds, returns a pointer to the new memory
* location and increments "n". Otherwise, it returens NULL and n is
* unchanged.
*/
static char **
{
int loc_n = *n;
return (NULL);
}
}
*n = loc_n;
return (nwpkg);
}
/*
* This informs gpkglist() to put a keyword at the head of the pkglist. This
* was originally intended for live continue, but it may have other
* applications as well.
*/
void
pkglist_cont(char *keyword)
{
cont_in_list = 1;
}
/*
* This function constructs the list of packages that the user wants managed.
* It may be a list on the command line, it may be some or all of the
* packages in a directory or it may be a continuation from a previous
* dryrun. It may also be a list of pkgs gathered from the CATEGORY parameter
* in a spooled or installed pkginfo file.
*/
char **
{
char *inst;
int i, n;
return (NULL);
}
/*
* If no explicit list was provided and this is not a continuation
* (implying a certain level of direction on the caller's part)
* present a menu of available packages for installation.
*/
return (NULL);
}
do {
/* bug id 1087404 */
continue;
return (NULL);
}
/* clear memory usage by pkginfo */
if (n) {
return (NULL);
}
for (n = 0; chp; /* void */) {
}
} else {
for (n = 0; nwpkg[n]; n++)
}
return (nwpkg);
}
/* clear memory usage by pkginfo */
/*
* pkg array contains the instance identifiers to
* be selected, or possibly wildcard definitions
*/
i = n = 0;
do {
if (cont_in_list) { /* This is a live continuation. */
cont_in_list = 0; /* handled */
break;
}
/* wildcard specification */
break;
}
do {
if (!is_same_CATEGORY(catg,
continue;
}
} else {
break;
}
}
} while (pkg[++i]);
/*
* No pkgs in the spooled directory matched the
* category specified by the user.
*/
return (NULL);
}
}
return (nwpkg);
}
/*
* Check category passed in on the command line to see if it is valid.
*
* returns 0 if the category is valid
* returns 1 if the category is invalid
*/
int
{
return (1);
}
return (0);
}
/*
* Check category length
*
* returns 0 if the category length is valid
* returns 1 if a category has length > 16 chars as defined by the SVr4 ABI
*/
int
is_not_valid_length(char **category)
{
int i;
return (1);
}
return (0);
}
/*
* Check category passed in on the command line against the CATEGORY in the
* spooled or installed packages pkginfo file.
*
* returns 0 if categories match
* returns 1 if categories don't match
*/
int
{
int i, j, n = 0;
char *pers_catg, **pers_catgs;
n++;
for (j = 0; j < n; j++) {
return (1);
}
}
}
return (0);
}
/*
* Given a string of categories, construct a null-terminated array of
* categories.
*
* returns the array of categories or NULL
*/
char **
get_categories(char *catg_arg)
{
int n = 0;
char *tmp_catg;
char **catgs;
n++;
return (NULL);
else
return (catgs);
}