Browse Source

killed debugging info, and it deals with half-configured packages now

r302
keep-around/c8703c509368e1805e513d61f98a9d17d2cdd9cc
Joey Hess 22 years ago
parent
commit
4006462fbe
  1. 5
      main-menu.c
  2. 2
      main-menu.h
  3. 3
      status.c

5
main-menu.c

@ -91,7 +91,7 @@ int isdefault(struct package_t *p) {
if (stat(menutest, &statbuf) == 0) {
return ! SYSTEM(menutest);
}
else if (p->status == unpacked) {
else if (p->status == unpacked || p->status == half_configured) {
return 1;
}
return 0;
@ -176,12 +176,11 @@ int do_menu_item(struct package_t *p) {
struct package_t *head = NULL, *tail = NULL;
if (p->status == installed) {
printf("already installed\n");
/* The menu item is already configured, so reconfigure it. */
sprintf(configcommand, "dpkg-reconfigure %s", p->package);
return ! SYSTEM(configcommand);
}
else if (p->status == unpacked) {
else if (p->status == unpacked || p->status == half_configured) {
/*
* The menu item is not yet configured. Make sure everything
* it depends on is configured, then configure it.

2
main-menu.h

@ -18,7 +18,7 @@
#define MAIN_MENU "debian-installer/main-menu"
#define DPKG_CONFIGURE_COMMAND "/usr/bin/udpkg --configure"
typedef enum { unpacked, installed, other } package_status;
typedef enum { unpacked, installed, half_configured, other } package_status;
struct package_t {
char *package;

3
status.c

@ -47,6 +47,9 @@ struct package_t *status_read(void) {
if (strstr(buf, " unpacked")) {
p->status = unpacked;
}
else if (strstr(buf, " half-configured")) {
p->status = half_configured;
}
else if (strstr(buf, " installed")) {
p->status = installed;
}

Loading…
Cancel
Save