From: Adam Heath Date: Sun, 14 Jan 2001 08:36:59 +0000 (+0000) Subject: Change --{status,command}-pipe to --{status,command}-fd. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d47d27f84131082b5f5c94b407545f185785d34c;p=dpkg Change --{status,command}-pipe to --{status,command}-fd. --- diff --git a/ChangeLog b/ChangeLog index a1ad944f..7c1294e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 14 02:27:48 CST 2001 Adam Heath + + * main/main.h, main/main.c: Change --{status,command}-pipe to + --{status,command}-fd. + Sun Jan 14 02:19:18 CST 2001 Adam Heath * main/main.c, main/archives.c: Add a --command-pipe. This allows diff --git a/main/main.c b/main/main.c index 46459dc0..6c658e8a 100644 --- a/main/main.c +++ b/main/main.c @@ -67,6 +67,7 @@ Usage: \n\ dpkg --update-avail replace available packages info\n\ dpkg --merge-avail merge with info from file\n\ dpkg --clear-avail erase existing available info\n\ + dpkg --command-fd pass commands in on this file descriptor\n\ dpkg --forget-old-unavail forget uninstalled unavailable pkgs\n\ dpkg -s|--status ... display package status details\n\ dpkg -p|--print-avail ... display available version details\n\ @@ -99,7 +100,7 @@ Options:\n\ --largemem | --smallmem Optimise for large (>4Mb) or small (<4Mb) RAM use\n\ --no-act Just say what we would do - don't do it\n\ -D|--debug= Enable debugging - see -Dhelp or --debug=help\n\ - --status-pipe Send status change updates to file descriptor \n\ + --status-fd Send status change updates to file descriptor \n\ --ignore-depends=,... Ignore dependencies involving \n\ --force-... Override problems - see --force-help\n\ --no-force-...|--refuse-... Stop when problems encountered\n\ @@ -343,7 +344,7 @@ static const char *const passlongopts[]= { static const char passshortopts[]= "bceIfxX"; static const char okpassshortopts[]= "D"; -void commandpipe(const char *const *argv); +void commandfd(const char *const *argv); static const struct cmdinfo cmdinfos[]= { /* This table has both the action entries in it and the normal options. * The action entries are made with the ACTION macro, as they all @@ -382,9 +383,9 @@ static const struct cmdinfo cmdinfos[]= { ACTION( "print-installation-architecture", 0, act_printinstarch, printinstarch ), ACTION( "predep-package", 0, act_predeppackage, predeppackage ), ACTION( "compare-versions", 0, act_cmpversions, cmpversions ), - ACTION( "command-pipe", 'c', act_commandpipe, commandpipe ), + ACTION( "command-fd", 'c', act_commandfd, commandfd ), - { "status-pipe", 0, 1, 0, 0, setstatuspipe }, + { "status-fd", 0, 1, 0, 0, setstatuspipe }, { "pending", 'a', 0, &f_pending, 0, 0, 1 }, { "recursive", 'R', 0, &f_recursive, 0, 0, 1 }, { "no-act", 0, 0, &f_noact, 0, 0, 1 }, @@ -415,7 +416,7 @@ static void execbackend(int argc, const char *const *argv) { execvp(BACKEND, (char* const*) argv); ohshite(_("failed to exec dpkg-deb")); } -void commandpipe(const char *const *argv) { +void commandfd(const char *const *argv) { jmp_buf ejbuf; struct varbuf linevb; const char * pipein; @@ -425,10 +426,10 @@ void commandpipe(const char *const *argv) { int argc= 1, mode= 0, c, lno= 0, infd, i; static void (*actionfunction)(const char *const *argv); - if ((pipein= *argv++) == NULL) badusage(_("--command-pipe takes 1 argument, not 0")); - if (*argv) badusage(_("--command-pipe only takes 1 argument")); + if ((pipein= *argv++) == NULL) badusage(_("--command-fd takes 1 argument, not 0")); + if (*argv) badusage(_("--command-fd only takes 1 argument")); if ((infd= strtol(pipein, (char **)NULL, 10)) == -1) - ohshite(_("invalid number for --command-pipe")); + ohshite(_("invalid number for --command-fd")); if ((in= fdopen(infd, "r")) == NULL) ohshite(_("couldn't open `%i' for stream"), infd); diff --git a/main/main.h b/main/main.h index 24ee4c69..5e954ca5 100644 --- a/main/main.h +++ b/main/main.h @@ -54,7 +54,8 @@ enum action { act_unset, act_install, act_unpack, act_avail, act_configure, act_assertpredep, act_printarch, act_predeppackage, act_cmpversions, act_printinstarch, act_compareversions, act_printavail, act_avclear, act_forgetold, act_getselections, act_setselections, act_printgnuarch, - act_assertepoch, act_assertlongfilenames, act_assertmulticonrep }; + act_assertepoch, act_assertlongfilenames, act_assertmulticonrep, + act_commandfd }; enum conffopt { cfof_prompt = 001, @@ -182,7 +183,8 @@ struct filenamenode *namenodetouse(struct filenamenode*, struct pkginfo*); /* all ...'s are const char*'s ... */ int maintainer_script_installed(struct pkginfo *pkg, const char *scriptname, const char *description, ...); -int maintainer_script_new(const char *scriptname, const char *description, +int maintainer_script_new(const char *pkgname, + const char *scriptname, const char *description, const char *cidir, char *cidirrest, ...); int maintainer_script_alternative(struct pkginfo *pkg, const char *scriptname, const char *description,