cdebconf/0000755000000000000000000000000012265027370007513 5ustar cdebconf/man/0000755000000000000000000000000011531204640010256 5ustar cdebconf/man/dpkg-preconfigure.pod0000644000000000000000000000256011531204640014400 0ustar =head1 NAME dpkg-preconfigure - let packages ask questions prior to their installation =head1 SYNOPSIS dpkg-preconfigure [options] package.deb dpkg-preconfigure --apt =head1 DESCRIPTION B lets packages ask questions before they are installed. It operates on a set of debian packages, and all packages that use cdebconf will have their config script run so they can examine the system and ask questions. =head1 OPTIONS =over 4 =item B<-f>I, B<--frontend=>I Select the frontend to use. =item B<-p>I, B<--priority=>I Set the lowest priority of questions you are interested in. Any questions with a priority below the selected priority will be ignored and their default answers will be used. =item B<--apt> Run in apt mode. It will expect to read a set of package filenames from stdin, rather than getting them as parameters. Typically this is used to make apt run dpkg-preconfigure on all packages before they are installed. To do this, add something like this to /etc/apt/apt.conf: // Pre-configure all packages before // they are installed. DPkg::Pre-Install-Pkgs { "dpkg-preconfigure --apt --priority=low"; }; =item B<-h>, B<--help> Display usage help. =back =cut =head1 SEE ALSO L =cut =head1 AUTHOR Joey Hess =cut =head1 HISTORY This manpage was "borrowed" from debconf. =cut cdebconf/man/dpkg-reconfigure.pod0000644000000000000000000000316111531204640014216 0ustar =head1 NAME dpkg-reconfigure - reconfigure an already installed package =head1 SYNOPSIS dpkg-reconfigure [options] packages =head1 DESCRIPTION B reconfigures packages after they have already been installed. Pass it the names of a package or packages to reconfigure. This has the same effect as re-installing the package, basically. I hope one day this will be called by dpkg --reconfigure =head1 OPTIONS =over 4 =item B<-f>I, B<--frontend=>I Select the frontend to use. The default frontend can be permanently changed by: dpkg-reconfigure cdebconf Note that if you normally have cdebconf set to use the noninteractive frontend, dpkg-reconfigure will use the dialog frontend instead, so you actually get to reconfigure the package. =item B<-p>I, B<--priority=>I Specify the minimum priority of question that will be displayed. dpkg-reconfigure normally shows low priority questions no matter what your default priority is. =item B<--all> Reconfigure all installed packages that use cdebconf. Warning: this may take a long time. =item B<-u>, B<--unseen-only> By default, all questions are shown, even if they have already been answered. If this parameter is set though, only questions that have not yet been seen will be asked. =item B<--force> Force dpkg-reconfigure to reconfigure a package even if the package is in an inconsistent or broken state. Use with caution. =item B<-h>, B<--help> Display usage help. =back =cut =head1 SEE ALSO L =cut =head1 AUTHOR Joey Hess =cut =head1 HISTORY This manpage was "borrowed" from debconf. =cut cdebconf/man/debconf.pod0000644000000000000000000000264011531204640012364 0ustar =head1 NAME debconf - run a debconf-using program =cut =head1 SYNOPSIS debconf [options] command [args] =head1 DESCRIPTION Debconf is a configuration system for Debian packages. For a debconf overview and documentation for sysadmins, see L. The B program runs a program under debconf's control, setting it up to talk with debconf on stdio. The program's output is expected to be debconf protocol commands, and it is expected to read result codes on stdin. See L for details about the debconf protocol. =head1 OPTIONS =over 4 =item B<-o>I, B<--owner=>I Tell debconf what package the command it is running is a part of. This is necessary to get ownership of registered questions right, and to support unregister and purge commands properly. =item B<-f>I, B<--frontend=>I Select the frontend to use. =item B<-p>I, B<--priority=>I Specify the minimum priority of question that will be displayed. =item B<-s>, B<--showold> Redisplay old, already seen questions. =back =head1 EXAMPLES To debug a shell script that uses debconf, you might use: DEBCONF_DEBUG=developer debconf my-shell-prog Or, you might use this: debconf --frontend=readline sh -x my-shell-prog =head1 SEE ALSO L, L =cut =head1 AUTHOR Joey Hess =cut =head1 HISTORY This manpage was "borrowed" from debconf. =cut cdebconf/man/Makefile.in0000644000000000000000000000115711531204640012327 0ustar include ../globalmakeflags VPATH = $(srcdir)/man CENTER=Debconf MANPAGES=dpkg-preconfigure.8cdebconf dpkg-reconfigure.8cdebconf debconf.7cdebconf all: $(MANPAGES) $(MANPAGES): SFX=$(subst .,,$(suffix $@)) $(MANPAGES): @$(POD2MAN) --section=$(SFX) --center=$(CENTER) -d$(CENTER) $(srcdir)/man/$(basename $@).pod > $(basename $@).$(SFX) install: $(MANPAGES) install -d -m 755 $(DESTDIR)${mandir}/man7 install -d -m 755 $(DESTDIR)${mandir}/man8 @for m in $(MANPAGES); do \ section=$${m#*.}; \ section=$${section%cdebconf}; \ install -m 644 $$m $(DESTDIR)${mandir}/man$$section/; \ done clean: rm -f *.[0-9] cdebconf/src/0000755000000000000000000000000012244643062010301 5ustar cdebconf/src/cdebconf.conf0000644000000000000000000000223211531204640012703 0ustar // This is a sample debconf configuration file // Comments can be in C or C++ style, blank lines are ignored // This file is in a bind-8 like format. global { module_path { frontend "./modules/frontend"; database "./modules/db"; }; default { frontend "default_fe"; template "templatedb"; config "configdb"; }; }; frontend { instance "default_fe" { driver "text"; }; }; template { instance "templatedb" { driver "rfc822db"; path "/var/cache/debconf/templates.dat"; mode 0644; }; }; config { instance "config_gen_db" { driver "rfc822db"; path "./test/config.dat"; mode 0644; reject_types { "password"; }; }; instance "config_passwd_db" { driver "rfc822db"; path "./test/passwords.dat"; mode 0600; accept_types { "password"; }; }; instance "configdb" { driver "stack"; stack { "config_gen_db"; "config_passwd_db"; }; }; instance "from_db" { driver "rfc822db"; path "/var/cache/debconf/config.dat"; }; instance "to_db2" { driver "rfc822db"; path "/tmp/test.dat"; }; instance "to_db" { driver "textdb"; path "/tmp/questions"; }; }; cdebconf/src/debug.c0000644000000000000000000000211011531204640011516 0ustar #ifndef NODEBUG #include "common.h" #include #include #include #ifdef SYSLOG_LOGGING #include #endif void debug_printf(int level, const char *fmt, ...) { static int loglevel = -1; static FILE *fp = NULL; va_list ap; if (loglevel < 0) { const char *loglevel_env = getenv("DEBCONF_DEBUG"); if (loglevel_env) { /* Allow DEBCONF_DEBUG=. to match everything, to * make it easier to debug cdebconf and debconf * simultaneously. */ if (strcmp(loglevel_env, ".") == 0) loglevel = INFO_VERBOSE; else if (strcmp(loglevel_env, "developer") == 0) loglevel = INFO_DEBUG; else loglevel = atoi(loglevel_env); } else loglevel = 0; if (getenv("DEBCONF_DEBUGFILE") == NULL || (fp = fopen(getenv("DEBCONF_DEBUGFILE"), "a")) == NULL) fp = stderr; } if (level <= loglevel) { #ifndef SYSLOG_LOGGING va_start(ap, fmt); vfprintf(fp, fmt, ap); fputc('\n', fp); va_end(ap); fflush(fp); #else va_start(ap, fmt); vsyslog(LOG_USER | LOG_DEBUG, fmt, ap); va_end(ap); #endif } } #endif /* DEBUG */ cdebconf/src/debconf-loadtemplate.c0000644000000000000000000000615311647120563014525 0ustar /** * @file loadtemplate.c * @brief simple utility to load a template file into the * database */ #include "common.h" #include "configuration.h" #include "database.h" #include "question.h" #include "template.h" #include "debconfclient.h" #include #include #include #include #include static int merge = 0; static struct option options[] = { { "merge", 0, &merge, 'm' }, { "help", 0, 0, 'h' }, { 0, 0, 0, 0 }, }; static void usage(char *progname, int rc) { fprintf(stderr, "Usage: %s [--merge]