Browse Source

Use libd-i2 with multiple provides

r1140
keep-around/c8703c509368e1805e513d61f98a9d17d2cdd9cc
Martin Sjögren 21 years ago
parent
commit
e30ed2d58d
  1. 8
      debian/changelog
  2. 2
      debian/control
  3. 16
      main-menu.c
  4. 8
      status.c

8
debian/changelog

@ -1,3 +1,11 @@
main-menu (0.016) unstable; urgency=low
* NOT RELEASED YET
* Martin Sjögren
- Use libd-i2 with multiple provides
-- Tollef Fog Heen <tfheen@debian.org> Mon, 28 Oct 2002 17:54:00 +0100
main-menu (0.015) unstable; urgency=low
* Redirect menutests' standard output to /dev/null.

2
debian/control

@ -2,7 +2,7 @@ Source: main-menu
Section: debian-installer
Priority: standard
Maintainer: Joey Hess <joeyh@debian.org>
Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.7.0), libcdebconf-dev, dpkg-dev (>= 1.9), libdebian-installer1-dev (>= 0.04)
Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.7.0), libcdebconf-dev, dpkg-dev (>= 1.9), libdebian-installer2-dev (>= 0.06)
Standards-Version: 3.5.6.1
Package: main-menu

16
main-menu.c

@ -214,6 +214,16 @@ struct package_t *show_main_menu(struct package_t *packages) {
static int config_package(struct package_t *);
static int provides(struct package_t *p, const char *what)
{
int i;
for (i = 0; p->provides[i] != 0; i++)
if (strcmp(p->provides[i], what) == 0)
return 1;
return 0;
}
/*
* Satisfy the dependencies of a virtual package. Its dependencies that actually
* provide the package are presented in a debconf select question for the user
@ -234,7 +244,7 @@ static int satisfy_virtual(struct package_t *p) {
for (i = 0; p->depends[i] != 0; i++) {
if ((dep = tree_find(p->depends[i])) == NULL)
continue;
if (dep->provides == NULL || strstr(dep->provides, p->package) == NULL) {
if (!provides(dep, p->package)) {
/* Non-providing dependency */
if (dep->status != installed && !config_package(dep))
return 0;
@ -280,7 +290,7 @@ static int satisfy_virtual(struct package_t *p) {
for (i = 0; p->depends[i] != 0; i++) {
if ((dep = tree_find(p->depends[i])) == NULL)
continue;
if (strstr(dep->provides, p->package) == NULL)
if (!provides(dep, p->package))
continue;
if (!is_menu_item || strcmp(debconf->value, dep->description) == 0) {
/* Ick. If we have a menu item it has to match the
@ -312,7 +322,7 @@ static int is_virtual(struct package_t *p) {
for (i = 0; p->depends[i] != 0; i++) {
if ((dep = tree_find(p->depends[i])) == NULL)
continue;
if (dep->provides != NULL && strstr(dep->provides, p->package) != NULL)
if (provides(dep, p->package))
return 1;
}
return 0;

8
status.c

@ -15,7 +15,7 @@
*/
struct package_t *status_read(void) {
FILE *f;
int i;
int i, k;
struct package_t *found, *plist, *p;
tree_clear();
@ -34,14 +34,14 @@ struct package_t *status_read(void) {
for (p = plist; p != NULL; p = p->next)
{
if (p->provides != NULL)
for (k = 0; p->provides[k] != 0; k++)
{
found = tree_find(p->provides);
found = tree_find(p->provides[k]);
if (found == NULL)
{
found = (struct package_t *)malloc(sizeof(struct package_t));
memset(found, 0, sizeof(struct package_t));
found->package = strdup(p->provides);
found->package = strdup(p->provides[k]);
tree_add(found);
/* TODO: Do we want the virtual packages in the list
* or just the tree? */

Loading…
Cancel
Save