Browse Source

Recompile with libdebconfclient

Fix asprintf usage
Prepare for upload

r3155
keep-around/c8703c509368e1805e513d61f98a9d17d2cdd9cc
Martin Sjögren 19 years ago
parent
commit
7d29aaa681
  1. 2
      Makefile
  2. 12
      debian/changelog
  3. 2
      debian/control
  4. 33
      main-menu.c

2
Makefile

@ -1,7 +1,7 @@
CFLAGS=-Wall -g -D_GNU_SOURCE
OBJS=$(subst .c,.o,$(wildcard *.c))
BIN=main-menu
LIBS=-ldebconf -ldebian-installer
LIBS=-ldebconfclient -ldebian-installer
ifdef DEBUG
CFLAGS:=$(CFLAGS) -DDODEBUG=1

12
debian/changelog

@ -1,17 +1,21 @@
main-menu (0.030) UNRELEASED; urgency=low
main-menu (0.030) unstable; urgency=low
* André Luís Lopes :
- Improve the wording of pt_BR translation a bit.
* Thorsten Sauter
- Include german translation (de.po)
* Martin Sjögren
- Recompile with libdebconfclient.
- Apply patch from David Nusinow to add some error handling to the
asprintf calls. (Closes: #193528)
-- Andre Luis Lopes <andrelop@ig.com.br> Sun, 11 May 2003 18:07:21 -0300
-- Martin Sjogren <sjogren@debian.org> Sat, 17 May 2003 19:45:44 +0200
main-menu (0.029) unstable; urgency=low
* Petter Reinholdtsen
- Remove code to signal cdebconf on language change. It is no longer
needed in cdebconf >= 0.36.
* Thorsten Sauter
- Include german translation (de.po)
-- Petter Reinholdtsen <pere@debian.org> Sun, 4 May 2003 11:00:28 +0200

2
debian/control

@ -3,7 +3,7 @@ Section: debian-installer
Priority: standard
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Uploaders: Joey Hess <joeyh@debian.org>, Tollef Fog Heen <tfheen@debian.org>, Martin Sjogren <sjogren@debian.org>
Build-Depends: debhelper (>= 4.1.13), dpkg-dev (>= 1.7.0), libcdebconf-dev, dpkg-dev (>= 1.9), libdebian-installer3-dev (>= 0.10), po-debconf (>= 0.5.0)
Build-Depends: debhelper (>= 4.1.13), dpkg-dev (>= 1.7.0), libdebconfclient-dev, dpkg-dev (>= 1.9), libdebian-installer3-dev (>= 0.10), po-debconf (>= 0.5.0)
Standards-Version: 3.5.9
Package: main-menu

33
main-menu.c

@ -54,9 +54,13 @@ int isdefault(struct package_t *p) {
struct stat statbuf;
int ret;
asprintf(&menutest, DPKGDIR "info/%s.menutest", p->package);
if (asprintf(&menutest, DPKGDIR "info/%s.menutest", p->package) == -1) {
return 0;
}
if (stat(menutest, &statbuf) == 0) {
asprintf(&cmd, "%s >/dev/null 2>&1", menutest);
if (asprintf(&cmd, "%s >/dev/null 2>&1", menutest) == -1) {
return 0;
}
ret = !SYSTEM(cmd);
free(cmd);
}
@ -227,7 +231,9 @@ static int satisfy_virtual(struct package_t *p) {
size_t c_size = 1;
int is_menu_item = 0;
asprintf(&choices, "");
if (asprintf(&choices, "") == -1) {
return 0;
}
/* Compile a list of providing package. The default choice will be the
* package with highest priority. If we have ties, menu items are
* preferred. If we still have ties, the default choice is arbitrary */
@ -254,11 +260,16 @@ static int satisfy_virtual(struct package_t *p) {
* is a menu item */
if (dep->installer_menu_item)
is_menu_item = 1;
if (dep == defpkg)
if (dep == defpkg) {
/* We want the default to be the first item */
asprintf(&tmp, "%s, %s", dep->description, choices);
else
asprintf(&tmp, "%s%s, ", choices, dep->description);
if (asprintf(&tmp, "%s, %s", dep->description, choices) == -1) {
return 0;
}
} else {
if (asprintf(&tmp, "%s%s, ", choices, dep->description) == -1) {
return 0;
}
}
free(choices);
choices = tmp;
}
@ -365,7 +376,9 @@ config_package(struct package_t *p) {
return 0;
}
asprintf(&configcommand, DPKG_CONFIGURE_COMMAND " %s", p->package);
if (asprintf(&configcommand, DPKG_CONFIGURE_COMMAND " %s", p->package) == -1) {
return 0;
}
ret = SYSTEM(configcommand);
free(configcommand);
if (ret == 0) {
@ -394,7 +407,9 @@ int do_menu_item(struct package_t *p) {
if (p->status == installed) {
/* The menu item is already configured, so reconfigure it. */
asprintf(&configcommand, DPKG_CONFIGURE_COMMAND " --force-configure %s", p->package);
if (asprintf(&configcommand, DPKG_CONFIGURE_COMMAND " --force-configure %s", p->package) == -1) {
return 0;
}
ret = SYSTEM(configcommand);
free(configcommand);
check_special(p);

Loading…
Cancel
Save