/*
* 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.
*/
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <dirent.h>
#include <ctype.h>
#include "list.h"
#include "protodir.h"
#include "arch.h"
int
{
int bucket;
return (1);
}
return (0);
}
void
{
int bucket;
}
static pkg_list *
{
/* easy case */
if (dependlist == NULL)
return (pkg);
/* insert at end, since the order matters */
/* NULL */
}
return (dependlist);
}
static void
{
while (dependlist) {
tmp = dependlist;
}
}
#ifdef DEBUG
void
{
}
#endif
static char *suffix_list[] = {
#if defined(__i386)
".i",
".c",
".d",
".m",
".u",
".v",
#else
#error "Unknown architecture."
#endif
NULL,
};
static pkg_list *
{
char **suffixes;
/*
* depend won't exist in ON packages until a build
* has been done, but it would be nice if you didn't have
* to do that. So try the generic depend file that those
* packages would copy in during the build.
*/
return (NULL);
}
continue;
/* we only care about prerequisites */
if (buf[0] != 'P')
continue;
/*
* We have to be careful with some of the packages that are
* listed as dependencies but exist under a different name -
* SUNWcar is good, because it's actually SUNWcar.{c,d,i,m,u}.
* What do we do there? We can't just go for all the '.'
* packages, since on x86 we only want the .i one, and on sparc
* we want everything _but_ .i. Maybe
*
* I think perhaps what we do is, if we don't find a package
* dependency, on intel we append '.i' and try for that, and on
* sparc we try the other extensions. Any we find get added.
*
* Note also we're quiet on failures. This is because you might
* be dependant on some outside package.
*/
continue;
}
suffixes++) {
*suffixes);
archpkg);
continue;
}
continue;
}
/* found one */
archpkg);
}
}
continue;
}
}
return (dependlist);
}
int
{
int count = 0;
/*
* print_dependencies(pkgname, dependlist);
*/
if (dependlist == NULL)
return (0);
verbose);
}
return (count);
}