From f2efc7263e952cef24f2196f92d02ee0b3b9aa1e Mon Sep 17 00:00:00 2001 From: jbj Date: Fri, 1 Sep 2000 21:15:40 +0000 Subject: - unify rpmError and rpmMessge interfaces through rpmlog. - collect and display rpm build error messages at end of build. CVS patchset: 4149 CVS date: 2000/09/01 21:15:40 --- rpmqv.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'rpmqv.c') diff --git a/rpmqv.c b/rpmqv.c index d170cb17a..fccc2e242 100755 --- a/rpmqv.c +++ b/rpmqv.c @@ -61,6 +61,7 @@ static int noPgp = 0; #define GETOPT_SHOWRC 1018 #define GETOPT_DEFINEMACRO 1020 #define GETOPT_EVALMACRO 1021 +#define GETOPT_RCFILE 1022 enum modes { @@ -147,8 +148,10 @@ static struct poptOption optionsTable[] = { { "quiet", '\0', 0, &quiet, 0, NULL, NULL}, { "verbose", 'v', 0, 0, 'v', NULL, NULL}, - { "define", '\0', POPT_ARG_STRING, 0, GETOPT_DEFINEMACRO,NULL, NULL}, - { "eval", '\0', POPT_ARG_STRING, 0, GETOPT_EVALMACRO, NULL, NULL}, + { "define", '\0', POPT_ARG_STRING, 0, GETOPT_DEFINEMACRO, + N_("define macro with value "), N_("' '") }, + { "eval", '\0', POPT_ARG_STRING, 0, GETOPT_EVALMACRO, + N_("print macro expansion to stdout"), N_("+") }, { "nodirtokens", '\0', POPT_ARG_VAL, &_noDirTokens, 1, NULL, NULL}, { "dirtokens", '\0', POPT_ARG_VAL, &_noDirTokens, 0, NULL, NULL}, @@ -172,7 +175,10 @@ static struct poptOption optionsTable[] = { { "pipe", '\0', POPT_ARG_STRING, &pipeOutput, 0, NULL, NULL}, { "root", 'r', POPT_ARG_STRING, &rootdir, 0, NULL, NULL}, - { "rcfile", '\0', POPT_ARG_STRING, &rcfile, 0, NULL, NULL}, + { "macros", '\0', POPT_ARG_STRING, ¯ofiles, 0, + N_("read instead of default macro file(s)"), + N_("") }, + { "rcfile", '\0', 0, 0, GETOPT_RCFILE, NULL, NULL}, { "showrc", '\0', 0, &showrc, GETOPT_SHOWRC, NULL, NULL}, #if defined(IAM_RPMQV) || defined(IAM_RPMK) @@ -286,14 +292,14 @@ static void printUsage(void) { #ifdef IAM_RPMDB fprintf(fp, _(" %s {--initdb} [--dbpath ]\n"), __progname); - fprintf(fp, _(" %s {--rebuilddb} [--rcfile ] [--dbpath ]\n"), __progname); + fprintf(fp, _(" %s {--rebuilddb} [--macros ] [--dbpath ]\n"), __progname); #endif #ifdef IAM_RPMEIU fprintf(fp, _(" %s {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]\n"), __progname); puts(_(" [--replacepkgs] [--replacefiles] [--root ]")); puts(_(" [--excludedocs] [--includedocs] [--noscripts]")); - puts(_(" [--rcfile ] [--ignorearch] [--dbpath ]")); + puts(_(" [--macros ] [--ignorearch] [--dbpath ]")); puts(_(" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]")); puts(_(" [--ftpproxy ] [--ftpport ]")); puts(_(" [--httpproxy ] [--httpport ]")); @@ -302,7 +308,7 @@ static void printUsage(void) { puts(_(" [--ignoresize] file1.rpm ... fileN.rpm")); fprintf(fp, (" %s {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]\n"), __progname); puts(_(" [--oldpackage] [--root ] [--noscripts]")); - puts(_(" [--excludedocs] [--includedocs] [--rcfile ]")); + puts(_(" [--excludedocs] [--includedocs] [--macros ]")); puts(_(" [--ignorearch] [--dbpath ] [--prefix ] ")); puts(_(" [--ftpproxy ] [--ftpport ]")); puts(_(" [--httpproxy ] [--httpport ]")); @@ -310,21 +316,21 @@ static void printUsage(void) { puts(_(" [--noorder] [--relocate oldpath=newpath]")); puts(_(" [--badreloc] [--excludepath ] [--ignoresize]")); puts(_(" file1.rpm ... fileN.rpm")); - fprintf(fp, _(" %s {--erase -e} [--root ] [--noscripts] [--rcfile ]\n"), __progname); + fprintf(fp, _(" %s {--erase -e} [--root ] [--noscripts] [--macros ]\n"), __progname); puts(_(" [--dbpath ] [--nodeps] [--allmatches]")); puts(_(" [--justdb] [--notriggers] package1 ... packageN")); #endif /* IAM_RPMEIU */ #ifdef IAM_RPMQV fprintf(fp, (" %s {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]\n"), __progname); - puts(_(" [--scripts] [--root ] [--rcfile ]")); + puts(_(" [--scripts] [--root ] [--macros ]")); puts(_(" [--whatprovides] [--whatrequires] [--requires]")); puts(_(" [--triggeredby]")); puts(_(" [--ftpproxy ] [--ftpport ]")); puts(_(" [--httpproxy ] [--httpport ]")); puts(_(" [--provides] [--triggers] [--dump]")); puts(_(" [--changelog] [--dbpath ] [targets]")); - fprintf(fp, _(" %s {--verify -V -y} [-afpg] [--root ] [--rcfile ]\n"), __progname); + fprintf(fp, _(" %s {--verify -V -y} [-afpg] [--root ] [--macros ]\n"), __progname); puts(_(" [--dbpath ] [--nodeps] [--nofiles] [--noscripts]")); puts(_(" [--nomd5] [targets]")); fprintf(fp, (" %s {--querytags}\n"), __progname); @@ -333,20 +339,20 @@ static void printUsage(void) { #endif /* IAM_RPMQV */ #ifdef IAM_RPMBT - fprintf(fp, _(" %s {-b|t}[plcibas] [-v] [--short-circuit] [--clean] [--rcfile ]\n"), __progname); + fprintf(fp, _(" %s {-b|t}[plcibas] [-v] [--short-circuit] [--clean] [--macros ]\n"), __progname); puts( (" [--sign] [--nobuild] ]")); puts(_(" [--target=platform1[,platform2...]]")); puts(_(" [--rmsource] [--rmspec] specfile")); - fprintf(fp, _(" %s {--rmsource} [--rcfile ] [-v] specfile\n"), __progname); - fprintf(fp, _(" %s {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm\n"), __progname); - fprintf(fp, _(" %s {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm\n"), __progname); + fprintf(fp, _(" %s {--rmsource} [--macros ] [-v] specfile\n"), __progname); + fprintf(fp, _(" %s {--rebuild} [--macros ] [-v] source1.rpm ... sourceN.rpm\n"), __progname); + fprintf(fp, _(" %s {--recompile} [--macros ] [-v] source1.rpm ... sourceN.rpm\n"), __progname); fprintf(fp, _(" %s {--freshen -F} file1.rpm ... fileN.rpm\n"), __progname); #endif /* IAM_RPMBT */ #ifdef IAM_RPMK - fprintf(fp, _(" %s {--resign} [--rcfile ] package1 package2 ... packageN\n"), __progname); - fprintf(fp, _(" %s {--addsign} [--rcfile ] package1 package2 ... packageN"), __progname); - fprintf(fp, _(" %s {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile ]\n"), __progname); + fprintf(fp, _(" %s {--resign} [--macros ] package1 package2 ... packageN\n"), __progname); + fprintf(fp, _(" %s {--addsign} [--macros ] package1 package2 ... packageN"), __progname); + fprintf(fp, _(" %s {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--macros ]\n"), __progname); puts(_(" package1 ... packageN")); #endif /* IAM_RPMK */ @@ -393,12 +399,12 @@ static void printHelp(void) { puts( _(" All modes support the following options:")); printHelpLine(_(" --define ' '"), _("define macro with value ")); - printHelpLine(_(" --eval '+' "), - _("print the expansion of macro to stdout")); + printHelpLine(_(" --eval '+' "), + _("print the expansion of macro to stdout")); printHelpLine(_(" --pipe "), _("send stdout to ")); - printHelpLine(_(" --rcfile "), - _("use instead of /etc/rpmrc and $HOME/.rpmrc")); + printHelpLine(_(" --macros "), + _("use instead of default list of macro files")); printHelpLine( " --showrc ", _("display final rpmrc and macro configuration")); #if defined(IAM_RPMBT) || defined(IAM_RPMDB) || defined(IAM_RPMEIU) || defined(IAM_RPMQV) @@ -913,6 +919,12 @@ int main(int argc, const char ** argv) noUsageMsg = 1; } break; + case GETOPT_RCFILE: + fprintf(stderr, _("The --rcfile option has been eliminated.\n")); + fprintf(stderr, _("Use \"--macros \" instead..\n")); + exit(EXIT_FAILURE); + /*@notreached@*/ break; + default: fprintf(stderr, _("Internal error in argument processing (%d) :-(\n"), arg); exit(EXIT_FAILURE); -- cgit v1.2.3