diff --git a/Makefile b/Makefile index 6ce9f16..da6aae2 100644 --- a/Makefile +++ b/Makefile @@ -19,12 +19,9 @@ demo: $(BIN) /usr/share/debconf/frontend ./$(BIN) rm -f main-menu.template -# Size optimized and stripped binary target. +# Size optimized binary target. small: CFLAGS:=-Os $(CFLAGS) -DSMALL small: clean $(BIN) -ifndef DEBUG - strip --remove-section=.comment --remove-section=.note $(BIN) -endif ls -l $(BIN) clean: diff --git a/debian/changelog b/debian/changelog index ca5372b..0dfb7b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,11 @@ main-menu (1.22) UNRELEASED; urgency=low * Fix test for new menu items that come before the last successful item. It's ok to jump up the menu to run such new items. Closes: #444462 * Fix NEVERDEFAULT test. Closes: #277743 + * Support DEB_BUILD_OPTIONS=nostrip. Closes: #437554 + * Add a (lame) guard against infinite recursion in di_config_package. + Closes: #437323 - -- Joey Hess Fri, 28 Sep 2007 21:12:56 -0400 + -- Joey Hess Fri, 28 Sep 2007 23:45:20 -0400 main-menu (1.21) unstable; urgency=low diff --git a/debian/rules b/debian/rules index d3172cf..a1ee198 100755 --- a/debian/rules +++ b/debian/rules @@ -27,6 +27,7 @@ binary-arch: build install dh_installdebconf dh_compress dh_fixperms + dh_strip dh_installdeb dh_shlibdeps dh_gencontrol diff --git a/main-menu.c b/main-menu.c index 34c86ae..42e835f 100644 --- a/main-menu.c +++ b/main-menu.c @@ -680,6 +680,8 @@ int main (int argc __attribute__ ((unused)), char **argv) { return EXIT_FAILURE; } +int di_config_package_depth=0; + /* * Configure all dependencies, special case for virtual packages. * This is done depth-first. @@ -691,10 +693,10 @@ static int di_config_package(di_system_package *p, di_slist_node *node; di_system_package *dep; - //di_log(DI_LOG_LEVEL_DEBUG, "configure %s, status: %d\n", p->p.package, p->p.status); + //di_log(DI_LOG_LEVEL_DEBUG, "configure %s, status: %d", p->p.package, p->p.status); if (p->p.type == di_package_type_virtual_package) { - //di_log(DI_LOG_LEVEL_DEBUG, "virtual package %s\n", p->p.package); + //di_log(DI_LOG_LEVEL_DEBUG, "virtual package %s", p->p.package); if (virtfunc) return virtfunc(p); else @@ -711,7 +713,14 @@ static int di_config_package(di_system_package *p, if (d->type != di_package_dependency_type_depends) continue; /* Recursively configure this package */ - switch (di_config_package(dep, virtfunc)) { + di_config_package_depth++; + if (di_config_package_depth > 1000) { + di_log(DI_LOG_LEVEL_WARNING, "Deep recursion configuring package %s (dep loop?)", p->p.package); + return -1; + } + ret = di_config_package(dep, virtfunc); + di_config_package_depth--; + switch (ret) { case -1: return -1; case EXIT_BACKUP: