- popt: display sub-table options only once on --usage.

- wire --nosignatures et al as common options, rework CLI options.

CVS patchset: 5575
CVS date: 2002/07/28 00:41:15
This commit is contained in:
jbj 2002-07-28 00:41:15 +00:00
parent c33342be5f
commit 670ab1c845
78 changed files with 9162 additions and 9598 deletions

View File

@ -187,6 +187,8 @@
- popt: fix --usage (#62234).
- fix: --repackage repaired (#67217).
- fix: rpm2cpio disables signature checks (i.e. same behavior).
- popt: display sub-table options only once on --usage.
- wire --nosignatures et al as common options, rework CLI options.
4.0.3 -> 4.0.4:
- solaris: translate i86pc to i386 (#57182).

View File

@ -24,9 +24,7 @@ struct rpmBuildArguments_s rpmBTArgs;
#define POPT_NOBUILD -1008
#define POPT_SHORTCIRCUIT -1009
#define POPT_RMSPEC -1010
#define POPT_NODEPS -1011
#define POPT_SIGN -1012
#define POPT_FORCE -1013
#define POPT_REBUILD 0x4220
#define POPT_RECOMPILE 0x4320
@ -50,9 +48,6 @@ struct rpmBuildArguments_s rpmBTArgs;
extern int _fsm_debug;
/*@=redecl@*/
/*@unchecked@*/
static int force = 0;
/*@-exportlocal@*/
/*@unchecked@*/
int noLang = 0;
@ -61,9 +56,6 @@ int noLang = 0;
/*@unchecked@*/
static int noBuild = 0;
/*@unchecked@*/
static int noDeps = 0;
/*@unchecked@*/
static int signIt = 0;
@ -102,9 +94,8 @@ static void buildArgCallback( /*@unused@*/ poptContext con,
rba->buildChar = (opt->val ) & 0xff;
}
break;
case POPT_FORCE: rba->force = 1; break;
case POPT_NOBUILD: rba->noBuild = 1; break;
case POPT_NODEPS: rba->noDeps = 1; break;
case POPT_NOLANG: rba->noLang = 1; break;
case POPT_SHORTCIRCUIT: rba->shortCircuit = 1; break;
case POPT_SIGN: rba->sign = 1; break;
@ -130,6 +121,15 @@ static void buildArgCallback( /*@unused@*/ poptContext con,
}
strcat(rba->targets, arg);
break;
case RPMCLI_POPT_NODEPS:
rba->noDeps = 1;
break;
case RPMCLI_POPT_FORCE:
rba->force = 1;
break;
}
}
/*@=boundswrite@*/
@ -140,7 +140,7 @@ static void buildArgCallback( /*@unused@*/ poptContext con,
/*@unchecked@*/
struct poptOption rpmBuildPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
buildArgCallback, 0, NULL, NULL },
/*@=type@*/
@ -201,13 +201,13 @@ struct poptOption rpmBuildPoptTable[] = {
N_("remove build tree when done"), NULL},
{ "dirtokens", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_noDirTokens, 0,
N_("generate headers compatible with rpm4 packaging"), NULL},
{ "force", '\0', POPT_ARGFLAG_DOC_HIDDEN, &force, POPT_FORCE,
{ "force", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmBTArgs.force, RPMCLI_POPT_FORCE,
N_("ignore ExcludeArch: directives from spec file"), NULL},
{ "fsmdebug", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN), &_fsm_debug, -1,
N_("debug file state machine"), NULL},
{ "nobuild", '\0', 0, &noBuild, POPT_NOBUILD,
N_("do not execute any stages of the build"), NULL },
{ "nodeps", '\0', 0, &noDeps, POPT_NODEPS,
{ "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
N_("do not verify build dependencies"), NULL },
{ "nodirtokens", '\0', POPT_ARG_VAL, &_noDirTokens, 1,
N_("generate package header(s) compatible with (legacy) rpm[23] packaging"),

2
db3/configure vendored
View File

@ -26,7 +26,7 @@ listobjs:\
\
distdir install check:\
\
db3_install: all install_setip \\' > Makefile
db3_install: all install_setip' > Makefile
mv db.h db.h.orig
cat db.h.orig | sed \

View File

@ -26,7 +26,7 @@
/*@access rpmts @*/
/*@access Header @*/ /* XXX compared with NULL */
/*@access entryInfo @*/ /* XXX headerCheck */
/*@access indexEntry @*/ /* XXX headerCheck */
/*@access indexEntry @*/ /* XXX headerCheck */
/*@access FD_t @*/ /* XXX stealing digests */
/*@unchecked@*/

View File

@ -18,14 +18,22 @@
/*@unchecked@*/
static int _debug = 0;
/*@-exportheadervar@*/
/*@unchecked@*/
/*@observer@*/ /*@null@*/
static const char * pipeOutput = NULL;
extern int noLibio;
/*@=exportheadervar@*/
/*@unchecked@*/
/*@observer@*/ /*@null@*/
static const char * rcfile = NULL;
/*@unchecked@*/ /*@observer@*/
static const char * rootdir = "/";
const char * rpmcliPipeOutput = NULL;
/*@unchecked@*/
const char * rpmcliRcfile = NULL;
/*@unchecked@*/
const char * rpmcliRootDir = "/";
/*@unchecked@*/
rpmQueryFlags rpmcliQueryFlags;
/*@-exportheadervar@*/
/*@unchecked@*/
@ -39,11 +47,11 @@ extern int _rpmio_debug;
/**
* Display rpm version.
*/
static void printVersion(void)
static void printVersion(FILE * fp)
/*@globals rpmEVR, fileSystem @*/
/*@modifies fileSystem @*/
{
fprintf(stdout, _("RPM version %s\n"), rpmEVR);
fprintf(fp, _("RPM version %s\n"), rpmEVR);
}
/**
@ -51,7 +59,7 @@ static void printVersion(void)
* @warning Options like --rcfile and --verbose must precede callers option.
*/
/*@mayexit@*/
static void rpmcliConfigured(void)
void rpmcliConfigured(void)
/*@globals rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
@ -60,7 +68,7 @@ static void rpmcliConfigured(void)
static int initted = -1;
if (initted < 0)
initted = rpmReadConfigFiles(rcfile, NULL);
initted = rpmReadConfigFiles(rpmcliRcfile, NULL);
if (initted)
exit(EXIT_FAILURE);
}
@ -77,11 +85,6 @@ static void rpmcliAllArgCallback( /*@unused@*/ poptContext con,
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
#if 0
/*@observer@*/
static const char *cbreasonstr[] = { "PRE", "POST", "OPTION", "?WTFO?" };
fprintf(stderr, "*** rpmcliALL: -%c,--%s %s %s opt %p arg %p val %d\n", opt->shortName, opt->longName, arg, cbreasonstr[reason&0x3], opt, opt->arg, opt->val);
#endif
/* XXX avoid accidental collisions with POPT_BIT_SET for flags */
/*@-branchstate@*/
@ -108,7 +111,7 @@ fprintf(stderr, "*** rpmcliALL: -%c,--%s %s %s opt %p arg %p val %d\n", opt->sho
}
break;
case POPT_SHOWVERSION:
printVersion();
printVersion(stdout);
exit(EXIT_SUCCESS);
/*@notreached@*/ break;
case POPT_SHOWRC:
@ -120,6 +123,17 @@ fprintf(stderr, "*** rpmcliALL: -%c,--%s %s %s opt %p arg %p val %d\n", opt->sho
case POPT_RCFILE: /* XXX FIXME: noop for now */
break;
#endif
case RPMCLI_POPT_NODIGEST:
rpmcliQueryFlags |= VERIFY_DIGEST;
break;
case RPMCLI_POPT_NOSIGNATURE:
rpmcliQueryFlags |= VERIFY_SIGNATURE;
break;
case RPMCLI_POPT_NOHDRCHK:
rpmcliQueryFlags |= VERIFY_HDRCHK;
break;
}
/*@=branchstate@*/
}
@ -128,18 +142,12 @@ fprintf(stderr, "*** rpmcliALL: -%c,--%s %s %s opt %p arg %p val %d\n", opt->sho
/*@unchecked@*/
struct poptOption rpmcliAllPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
rpmcliAllArgCallback, 0, NULL, NULL },
/*@=type@*/
{ "debug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_debug, -1,
NULL, NULL },
{ "quiet", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'q',
N_("provide less detailed output"), NULL},
{ "verbose", 'v', 0, 0, 'v',
N_("provide more detailed output"), NULL},
{ "version", '\0', 0, 0, POPT_SHOWVERSION,
N_("print the version of rpm being used"), NULL },
{ "define", 'D', POPT_ARG_STRING, 0, 'D',
N_("define MACRO with value EXPR"),
@ -147,35 +155,58 @@ struct poptOption rpmcliAllPoptTable[] = {
{ "eval", 'E', POPT_ARG_STRING, 0, 'E',
N_("print macro expansion of EXPR"),
N_("'EXPR'") },
{ "pipe", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, &pipeOutput, 0,
N_("send stdout to <cmd>"),
N_("<cmd>") },
{ "root", 'r', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT | POPT_ARGFLAG_DOC_HIDDEN, &rootdir, 0,
N_("use <dir> as the top level directory"),
N_("<dir>") },
{ "macros", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, &macrofiles, 0,
{ "macros", '\0', POPT_ARG_STRING, &macrofiles, 0,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
#if !defined(POPT_RCFILE)
{ "rcfile", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, &rcfile, 0,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
#else
{ "rcfile", '\0', 0, 0, POPT_RCFILE|POPT_ARGFLAG_DOC_HIDDEN,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
#endif
{ "showrc", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_SHOWRC,
N_("display final rpmrc and macro configuration"),
NULL },
{ "nodigest", '\0', 0, 0, RPMCLI_POPT_NODIGEST,
N_("don't verify package digest(s)"), NULL },
{ "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK,
N_("don't verify database header(s) when retrieved"), NULL },
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
{ "nolibio", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noLibio, 1,
N_("disable use of libio(3) API"), NULL},
#endif
{ "nosignature", '\0', 0, 0, RPMCLI_POPT_NOSIGNATURE,
N_("don't verify package signature(s)"), NULL },
{ "pipe", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, &rpmcliPipeOutput, 0,
N_("send stdout to CMD"),
N_("CMD") },
#if !defined(POPT_RCFILE)
{ "rcfile", '\0', POPT_ARG_STRING, &rpmcliRcfile, 0,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
#else
{ "rcfile", '\0', 0, NULL, POPT_RCFILE,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
#endif
{ "root", 'r', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &rpmcliRootDir, 0,
N_("use ROOT as top level directory"),
N_("ROOT") },
{ "showrc", '\0', 0, NULL, POPT_SHOWRC,
N_("display final rpmrc and macro configuration"),
NULL },
{ "quiet", '\0', 0, NULL, 'q',
N_("provide less detailed output"), NULL},
{ "verbose", 'v', 0, NULL, 'v',
N_("provide more detailed output"), NULL},
{ "version", '\0', 0, NULL, POPT_SHOWVERSION,
N_("print the version of rpm being used"), NULL },
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
{ "nolibio", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noLibio, 1,
N_("disable use of libio(3) API"), NULL},
#endif
{ "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
N_("debug protocol data stream"), NULL},
#ifdef DYING
{ "poptdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_popt_debug, -1,
N_("debug option/argument processing"), NULL},
#endif
{ "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
N_("debug rpmio I/O"), NULL},
{ "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,

View File

@ -78,6 +78,7 @@ static void installArgCallback( /*@unused@*/ poptContext con,
/*@=kepttrans =usereleased @*/
ia->numRelocations++;
} break;
case POPT_ROLLBACK:
{ time_t tid;
if (arg == NULL)
@ -91,6 +92,39 @@ static void installArgCallback( /*@unused@*/ poptContext con,
argerror(_("malformed rollback time/date stamp argument"));
ia->rbtid = tid;
} break;
case RPMCLI_POPT_NODIGEST:
ia->qva_flags |= VERIFY_DIGEST;
break;
case RPMCLI_POPT_NOSIGNATURE:
ia->qva_flags |= VERIFY_SIGNATURE;
break;
case RPMCLI_POPT_NOHDRCHK:
ia->qva_flags |= VERIFY_HDRCHK;
break;
case RPMCLI_POPT_NODEPS:
ia->noDeps = 1;
break;
case RPMCLI_POPT_NOMD5:
ia->transFlags |= RPMTRANS_FLAG_NOMD5;
break;
case RPMCLI_POPT_FORCE:
ia->probFilter |=
( RPMPROB_FILTER_REPLACEPKG
| RPMPROB_FILTER_REPLACEOLDFILES
| RPMPROB_FILTER_REPLACENEWFILES
| RPMPROB_FILTER_OLDPACKAGE );
break;
case RPMCLI_POPT_NOSCRIPTS:
ia->transFlags |= (_noTransScripts | _noTransTriggers);
break;
}
/*@=branchstate@*/
}
@ -102,7 +136,7 @@ static void installArgCallback( /*@unused@*/ poptContext con,
/*@unchecked@*/
struct poptOption rpmInstallPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
installArgCallback, 0, NULL, NULL },
/*@=type@*/
@ -135,9 +169,16 @@ struct poptOption rpmInstallPoptTable[] = {
{ "excludepath", '\0', POPT_ARG_STRING, 0, POPT_EXCLUDEPATH,
N_("skip files with leading component <path> "),
N_("<path>") },
#ifdef DYING
{ "force", '\0', POPT_BIT_SET, &rpmIArgs.probFilter,
(RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES | RPMPROB_FILTER_OLDPACKAGE),
N_("short hand for --replacepkgs --replacefiles"), NULL},
#else
{ "force", '\0', 0, NULL, RPMCLI_POPT_FORCE,
N_("short hand for --replacepkgs --replacefiles"), NULL},
#endif
{ "freshen", 'F', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags,
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL),
N_("upgrade package(s) if already installed"),
@ -160,8 +201,15 @@ struct poptOption rpmInstallPoptTable[] = {
N_("install package(s)"), N_("<packagefile>+") },
{ "justdb", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_JUSTDB,
N_("update the database, but do not modify the filesystem"), NULL},
#ifdef DYING
{ "nodeps", '\0', 0, &rpmIArgs.noDeps, 0,
N_("do not verify package dependencies"), NULL },
#else
{ "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
N_("do not verify package dependencies"), NULL },
#endif
{ "nomd5", '\0', 0, NULL, RPMCLI_POPT_NOMD5,
N_("don't verify MD5 digest of files"), NULL },
{ "noorder", '\0', POPT_BIT_SET,
&rpmIArgs.installInterfaceFlags, INSTALL_NOORDER,
N_("do not reorder package installation to satisfy dependencies"),
@ -171,9 +219,14 @@ struct poptOption rpmInstallPoptTable[] = {
RPMTRANS_FLAG_NOSUGGEST,
N_("do not suggest missing dependency resolution(s)"), NULL},
#ifdef DYING
{ "noscripts", '\0', POPT_BIT_SET, &rpmIArgs.transFlags,
(_noTransScripts|_noTransTriggers),
N_("do not execute package scriptlet(s)"), NULL },
#else
{ "noscripts", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS,
N_("do not execute package scriptlet(s)"), NULL },
#endif
{ "nopre", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
RPMTRANS_FLAG_NOPRE,
N_("do not execute %%pre scriptlet (if any)"), NULL },
@ -187,15 +240,23 @@ struct poptOption rpmInstallPoptTable[] = {
RPMTRANS_FLAG_NOPOSTUN,
N_("do not execute %%postun scriptlet (if any)"), NULL },
#ifdef DYING
{ "nodigest", '\0', POPT_BIT_SET, &rpmIArgs.qva_flags, VERIFY_DIGEST,
N_("don't verify package digest(s)"), NULL },
{ "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.qva_flags, VERIFY_HDRCHK,
N_("don't verify database header(s) when retrieved"), NULL },
{ "nosignature", '\0', POPT_BIT_SET, &rpmIArgs.qva_flags, VERIFY_SIGNATURE,
N_("don't verify package signature(s)"), NULL },
#else
{ "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NODIGEST,
N_("don't verify package digest(s)"), NULL },
{ "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK,
N_("don't verify database header(s) when retrieved"), NULL },
{ "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOSIGNATURE,
N_("don't verify package signature(s)"), NULL },
#endif
{ "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags,
_noTransTriggers,
{ "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, _noTransTriggers,
N_("do not execute any scriptlet(s) triggered by this package"), NULL},
{ "notriggerprein", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmIArgs.transFlags, RPMTRANS_FLAG_NOTRIGGERPREIN,

View File

@ -104,7 +104,7 @@ struct poptOption rpmQVSourcePoptTable[] = {
{ "hdrid", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_QUERYBYHDRID,
N_("query/verify package(s) with header identifier"), "SHA1" },
{ "package", 'p', 0, 0, 'p',
N_("query/verify a package file (i.e. a binary *.rpm file)"), NULL },
N_("query/verify a package file"), NULL },
{ "pkgid", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_QUERYBYPKGID,
N_("query/verify package(s) with package identifier"), "MD5" },
{ "query", 'q', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'q',
@ -147,11 +147,6 @@ static void queryArgCallback(/*@unused@*/poptContext con,
break;
case POPT_DUMP: qva->qva_flags |= QUERY_FOR_DUMPFILES | QUERY_FOR_LIST;
break;
case 'v':
/*@-internalglobs@*/ /* FIX: shrug */
rpmIncreaseVerbosity();
/*@=internalglobs@*/
break;
case POPT_QUERYFORMAT:
if (arg) {
@ -171,6 +166,41 @@ static void queryArgCallback(/*@unused@*/poptContext con,
qva->qva_queryFormat = qf;
}
break;
case RPMCLI_POPT_NODIGEST:
qva->qva_flags |= VERIFY_DIGEST;
break;
case RPMCLI_POPT_NOSIGNATURE:
qva->qva_flags |= VERIFY_SIGNATURE;
break;
case RPMCLI_POPT_NOHDRCHK:
qva->qva_flags |= VERIFY_HDRCHK;
break;
case RPMCLI_POPT_NODEPS:
qva->qva_flags |= VERIFY_DEPS;
break;
case RPMCLI_POPT_NOMD5:
qva->qva_flags |= VERIFY_MD5;
break;
#ifdef NOTYET
case RPMCLI_POPT_FORCE:
ia->probFilter |=
( RPMPROB_FILTER_REPLACEPKG
| RPMPROB_FILTER_REPLACEOLDFILES
| RPMPROB_FILTER_REPLACENEWFILES
| RPMPROB_FILTER_OLDPACKAGE );
break;
#endif
case RPMCLI_POPT_NOSCRIPTS:
qva->qva_flags |= VERIFY_SCRIPT;
break;
}
}
@ -180,7 +210,7 @@ static void queryArgCallback(/*@unused@*/poptContext con,
/*@unchecked@*/
struct poptOption rpmQueryPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
queryArgCallback, 0, NULL, NULL },
/*@=type@*/
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
@ -215,8 +245,6 @@ struct poptOption rpmQueryPoptTable[] = {
N_("substitute i18n sections into spec file"), NULL },
{ "state", 's', 0, 0, 's',
N_("display the states of the listed files"), NULL },
{ "verbose", 'v', 0, 0, 'v',
N_("display a verbose file listing"), NULL },
POPT_TABLEEND
};
@ -224,13 +252,22 @@ struct poptOption rpmQueryPoptTable[] = {
* Verify mode options.
*/
struct poptOption rpmVerifyPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
queryArgCallback, 0, NULL, NULL },
/*@=type@*/
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
NULL, NULL },
/* Duplicate file verify flags from packages into command line options. */
/** @todo Add --nomd5 alias to rpmpopt, eliminate. */
#ifdef DYING
{ "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_MD5,
N_("don't verify MD5 digest of files"), NULL },
#else
{ "nomd5", '\0', 0, NULL, RPMCLI_POPT_NOMD5,
N_("don't verify MD5 digest of files"), NULL },
#endif
{ "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmQVKArgs.qva_flags, VERIFY_SIZE,
N_("don't verify size of files"), NULL },
@ -255,16 +292,31 @@ struct poptOption rpmVerifyPoptTable[] = {
{ "nofiles", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FILES,
N_("don't verify files in package"), NULL},
#ifdef DYING
{ "nodeps", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DEPS,
N_("don't verify package dependencies"), NULL },
#else
{ "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
N_("don't verify package dependencies"), NULL },
#endif
#ifdef DYING
{ "noscript", '\0', POPT_BIT_SET,&rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
N_("don't execute verify script(s)"), NULL },
/* XXX legacy had a trailing s on --noscript */
{ "noscripts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
N_("don't execute verify script(s)"), NULL },
{ "nodigest", '\0', POPT_BIT_SET,
&rpmQVKArgs.qva_flags, VERIFY_DIGEST,
#else
{ "noscript", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS,
N_("don't execute verify script(s)"), NULL },
/* XXX legacy had a trailing s on --noscript */
{ "noscripts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSCRIPTS,
N_("don't execute verify script(s)"), NULL },
#endif
#ifdef DYING
{ "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
N_("don't verify package digest(s)"), NULL },
{ "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmQVKArgs.qva_flags, VERIFY_HDRCHK,
@ -272,6 +324,14 @@ struct poptOption rpmVerifyPoptTable[] = {
{ "nosignature", '\0', POPT_BIT_SET,
&rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
N_("don't verify package signature(s)"), NULL },
#else
{ "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NODIGEST,
N_("don't verify package digest(s)"), NULL },
{ "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK,
N_("don't verify database header(s) when retrieved"), NULL },
{ "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOSIGNATURE,
N_("don't verify package signature(s)"), NULL },
#endif
/** @todo Add --nogpg/--nopgp aliases to rpmpopt, eliminate. */
{ "nogpg", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
@ -290,7 +350,7 @@ struct poptOption rpmVerifyPoptTable[] = {
/*@unchecked@*/
struct poptOption rpmSignPoptTable[] = {
/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
rpmQVSourceArgCallback, 0, NULL, NULL },
/*@=type@*/
{ "addsign", '\0', 0, NULL, 'A',

View File

@ -27,6 +27,15 @@ extern "C" {
/*@unchecked@*/
extern struct poptOption rpmcliAllPoptTable[];
/*@unchecked@*/ /*@observer@*/ /*@null@*/
extern const char * rpmcliPipeOutput;
/*@unchecked@*/ /*@observer@*/ /*@null@*/
extern const char * rpmcliRcfile;
/*@unchecked@*/ /*@observer@*/ /*@null@*/
extern const char * rpmcliRootDir;
/**
* Initialize most everything needed by an rpm CLI executable context.
* @param argc no. of args
@ -42,6 +51,17 @@ rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable)
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, stderr,
fileSystem, internalState @*/;
/**
* Make sure that rpm configuration has been read.
* @warning Options like --rcfile and --verbose must precede callers option.
*/
/*@mayexit@*/
void rpmcliConfigured(void)
/*@globals rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/**
* Destroy most everything needed by an rpm CLI executable context.
* @param optCon popt context
@ -51,6 +71,17 @@ poptContext
rpmcliFini(/*@only@*/ /*@null@*/ poptContext optCon)
/*@modifies optCon @*/;
/**
* Common/global popt tokens used for command line option tables.
*/
#define RPMCLI_POPT_NODEPS -1025
#define RPMCLI_POPT_FORCE -1026
#define RPMCLI_POPT_NOMD5 -1027
#define RPMCLI_POPT_NOSCRIPTS -1028
#define RPMCLI_POPT_NOSIGNATURE -1029
#define RPMCLI_POPT_NODIGEST -1030
#define RPMCLI_POPT_NOHDRCHK -1031
/* ==================================================================== */
/** \name RPMBT */
/*@{*/
@ -180,6 +211,12 @@ typedef enum rpmQueryFlags_e {
(QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
QUERY_FOR_DUMPFILES)
/** \ingroup rpmcli
* Bit(s) from common command line options.
*/
/*@unchecked@*/
extern rpmQueryFlags rpmcliQueryFlags;
/** \ingroup rpmcli
* Bit(s) to control rpmVerify() operation, stored in qva_flags.
* @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?.
@ -472,17 +509,17 @@ struct rpmInstallArguments_s {
rpmprobFilterFlags probFilter;
rpmInstallInterfaceFlags installInterfaceFlags;
rpmEraseInterfaceFlags eraseInterfaceFlags;
/*@owned@*/ /*@null@*/
rpmRelocation * relocations;
rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */
uint_32 rbtid; /*!< from --rollback */
int numRelocations;
int noDeps;
int incldocs;
rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */
/*@owned@*/ /*@null@*/
rpmRelocation * relocations;
/*@null@*/
const char * prefix;
/*@observer@*/ /*@null@*/
const char * rootdir;
uint_32 rbtid; /*!< from --rollback */
};
/** \ingroup rpmcli

View File

@ -357,10 +357,6 @@ rpmfi rpmfiInit(rpmfi fi, int fx)
fi->i = fx - 1;
fi->j = -1;
}
#ifdef DYING
else
fi = NULL;
#endif
}
/*@-refcounttrans@*/

View File

@ -444,7 +444,8 @@ rpmtsi XrpmtsiInit(rpmts ts, const char * fn, unsigned int ln)
tsi = xcalloc(1, sizeof(*tsi));
tsi->ts = rpmtsLink(ts, "rpmtsi");
tsi->reverse = ((rpmtsFlags(ts) & RPMTRANS_FLAG_REVERSE) ? 1 : 0);
tsi->oc = (tsi->reverse ? (rpmtsNElements(ts) - 1) : 0);
tsi->ocmax = rpmtsNElements(ts);
tsi->oc = (tsi->reverse ? (tsi->ocmax - 1) : 0);
tsi->ocsave = tsi->oc;
/*@-modfilesys@*/
if (_rpmte_debug)
@ -465,13 +466,13 @@ rpmte rpmtsiNextElement(rpmtsi tsi)
rpmte te = NULL;
int oc = -1;
if (tsi == NULL || tsi->ts == NULL || rpmtsNElements(tsi->ts) <= 0)
if (tsi == NULL || tsi->ts == NULL || tsi->ocmax <= 0)
return te;
if (tsi->reverse) {
if (tsi->oc >= 0) oc = tsi->oc--;
if (tsi->oc >= 0) oc = tsi->oc--;
} else {
if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++;
if (tsi->oc < tsi->ocmax) oc = tsi->oc++;
}
tsi->ocsave = oc;
/*@-branchstate@*/

View File

@ -128,6 +128,7 @@ struct rpmtsi_s {
rpmts ts; /*!< transaction set. */
int reverse; /*!< reversed traversal? */
int ocsave; /*!< last returned iterator index. */
int ocmax; /*!< iterator max index. */
int oc; /*!< iterator index. */
};

View File

@ -7,6 +7,7 @@
#include <rpmmacro.h> /* XXX for rpmExpand */
#include "fsm.h"
#include "psm.h"
#include "rpmdb.h"
@ -111,9 +112,9 @@ static fileAction decideFileFate(const rpmts ts,
}
}
diskWhat = whatis(sb.st_mode);
dbWhat = whatis(ofi->fmodes[ofi->i]);
newWhat = whatis(nfi->fmodes[nfi->i]);
diskWhat = whatis((int_16)sb.st_mode);
dbWhat = whatis(rpmfiFMode(ofi));
newWhat = whatis(rpmfiFMode(nfi));
/*
* RPM >= 2.3.10 shouldn't create config directories -- we'll ignore
@ -136,36 +137,25 @@ static fileAction decideFileFate(const rpmts ts,
* possible in case something else (like the timestamp) has changed.
*/
if (dbWhat == REG) {
#ifdef DYING
if (ofi->md5s != NULL && nfi->md5s != NULL) {
#endif
const unsigned char * omd5 = ofi->md5s + (16 * ofi->i);
const unsigned char * nmd5 = nfi->md5s + (16 * nfi->i);
if (domd5(fn, buffer, 0, NULL))
return FA_CREATE; /* assume file has been removed */
if (!memcmp(omd5, buffer, 16))
return FA_CREATE; /* unmodified config file, replace. */
if (!memcmp(omd5, nmd5, 16))
return FA_SKIP; /* identical file, don't bother. */
#ifdef DYING
} else {
const char * omd5 = ofi->fmd5s[ofi->i];
const char * nmd5 = nfi->fmd5s[nfi->i];
if (domd5(fn, buffer, 1, NULL))
return FA_CREATE; /* assume file has been removed */
if (!strcmp(omd5, buffer))
return FA_CREATE; /* unmodified config file, replace. */
if (!strcmp(omd5, nmd5))
return FA_SKIP; /* identical file, don't bother. */
}
#endif
const unsigned char * omd5, * nmd5;
if (domd5(fn, buffer, 0, NULL))
return FA_CREATE; /* assume file has been removed */
omd5 = rpmfiMD5(ofi);
if (!memcmp(omd5, buffer, 16))
return FA_CREATE; /* unmodified config file, replace. */
nmd5 = rpmfiMD5(nfi);
if (!memcmp(omd5, nmd5, 16))
return FA_SKIP; /* identical file, don't bother. */
} else /* dbWhat == LINK */ {
const char * oFLink, * nFLink;
memset(buffer, 0, sizeof(buffer));
if (readlink(fn, buffer, sizeof(buffer) - 1) == -1)
return FA_CREATE; /* assume file has been removed */
if (!strcmp(ofi->flinks[ofi->i], buffer))
oFLink = rpmfiFLink(ofi);
if (!strcmp(oFLink, buffer))
return FA_CREATE; /* unmodified config file, replace. */
if (!strcmp(ofi->flinks[ofi->i], nfi->flinks[nfi->i]))
nFLink = rpmfiFLink(nfi);
if (!strcmp(oFLink, nFLink))
return FA_SKIP; /* identical file, don't bother. */
}
@ -185,29 +175,19 @@ static fileAction decideFileFate(const rpmts ts,
static int filecmp(rpmfi afi, rpmfi bfi)
/*@*/
{
fileTypes awhat = whatis(afi->fmodes[afi->i]);
fileTypes bwhat = whatis(bfi->fmodes[bfi->i]);
fileTypes awhat = whatis(rpmfiFMode(afi));
fileTypes bwhat = whatis(rpmfiFMode(bfi));
if (awhat != bwhat) return 1;
if (awhat == LINK) {
const char * alink = afi->flinks[afi->i];
const char * blink = bfi->flinks[bfi->i];
const char * alink = rpmfiFLink(afi);
const char * blink = rpmfiFLink(bfi);
return strcmp(alink, blink);
} else if (awhat == REG) {
#ifdef DYING
if (afi->md5s != NULL && bfi->md5s != NULL) {
#endif
const unsigned char * amd5 = afi->md5s + (16 * afi->i);
const unsigned char * bmd5 = bfi->md5s + (16 * bfi->i);
return memcmp(amd5, bmd5, 16);
#ifdef DYING
} else {
const char * amd5 = afi->fmd5s[afi->i];
const char * bmd5 = bfi->fmd5s[bfi->i];
return strcmp(amd5, bmd5);
}
#endif
const unsigned char * amd5 = rpmfiMD5(afi);
const unsigned char * bmd5 = rpmfiMD5(bfi);
return memcmp(amd5, bmd5, 16);
}
return 0;
@ -253,6 +233,7 @@ static int handleInstInstalledFiles(const rpmts ts,
ps = rpmtsProblems(ts);
for (i = 0; i < sharedCount; i++, shared++) {
int otherFileNum, fileNum;
int isCfgFile;
otherFileNum = shared->otherFileNum;
(void) rpmfiSetFX(otherFi, otherFileNum);
@ -260,6 +241,8 @@ static int handleInstInstalledFiles(const rpmts ts,
fileNum = shared->pkgFileNum;
(void) rpmfiSetFX(fi, fileNum);
isCfgFile = ((rpmfiFFlags(otherFi) | rpmfiFFlags(fi)) & RPMFILE_CONFIG);
#ifdef DYING
/* XXX another tedious segfault, assume file state normal. */
if (otherStates && otherStates[otherFileNum] != RPMFILE_STATE_NORMAL)
@ -277,7 +260,7 @@ static int handleInstInstalledFiles(const rpmts ts,
altNEVR,
0);
}
if (!(rpmfiFFlags(otherFi) | rpmfiFFlags(fi)) & RPMFILE_CONFIG) {
if (!isCfgFile) {
/*@-assignexpose@*/ /* FIX: p->replaced, not fi */
if (!shared->isRemoved)
fi->replaced[numReplaced++] = *shared;
@ -285,13 +268,12 @@ static int handleInstInstalledFiles(const rpmts ts,
}
}
if ((rpmfiFFlags(otherFi) | rpmfiFFlags(fi)) & RPMFILE_CONFIG) {
if (isCfgFile) {
fileAction action;
action = decideFileFate(ts, otherFi, fi);
fi->actions[fileNum] = action;
}
fi->replacedSizes[fileNum] = otherFi->fsizes[otherFi->i];
fi->replacedSizes[fileNum] = rpmfiFSize(otherFi);
}
ps = rpmpsFree(ps);
@ -451,7 +433,7 @@ otherFps->baseName);
if (otherFileNum == otherFc) {
/*@-modfilesys@*/
if (_fps_debug)
fprintf(stderr, "*** NULL %s/%s%s\n",
fprintf(stderr, "*** FP_EQUAL NULL %s/%s%s\n",
ISROOT(fiFps->entry->dirName),
(fiFps->subDir ? fiFps->subDir : ""),
fiFps->baseName);
@ -469,7 +451,8 @@ fiFps->baseName);
/*@=boundswrite@*/
if (bingoFps == NULL) {
/*@-modfilesys@*/
fprintf(stderr, "*** NULL %s/%s%s\n",
if (_fps_debug)
fprintf(stderr, "*** bingoFps NULL %s/%s%s\n",
ISROOT(fiFps->entry->dirName),
(fiFps->subDir ? fiFps->subDir : ""),
fiFps->baseName);
@ -481,6 +464,7 @@ fiFps->baseName);
/*@-nullpass@*/ /* LCL: looks good to me */
if (!(fiFps == bingoFps || FP_EQUAL((*fiFps), (*bingoFps)))) {
/*@-modfilesys@*/
if (_fps_debug)
fprintf(stderr, "*** BAD %s/%s%s\n",
ISROOT(bingoFps->entry->dirName),
(bingoFps->subDir ? bingoFps->subDir : ""),
@ -517,6 +501,8 @@ static void handleOverlappedFiles(const rpmts ts,
struct fingerPrint_s * fiFps;
int otherPkgNum, otherFileNum;
rpmfi otherFi;
int_32 FFlags;
int_16 FMode;
const rpmfi * recs;
int numRecs;
@ -525,6 +511,8 @@ static void handleOverlappedFiles(const rpmts ts,
fn = rpmfiFN(fi);
fiFps = fi->fps + i;
FFlags = rpmfiFFlags(fi);
FMode = rpmfiFMode(fi);
fixupSize = 0;
@ -594,10 +582,9 @@ static void handleOverlappedFiles(const rpmts ts,
/* XXX is this test still necessary? */
if (fi->actions[i] != FA_UNKNOWN)
/*@switchbreak@*/ break;
if ((rpmfiFFlags(fi) & RPMFILE_CONFIG) &&
!lstat(fn, &sb)) {
if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) {
/* Here is a non-overlapped pre-existing config file. */
fi->actions[i] = (rpmfiFFlags(fi) & RPMFILE_NOREPLACE)
fi->actions[i] = (FFlags & RPMFILE_NOREPLACE)
? FA_ALTNAME : FA_BACKUP;
} else {
fi->actions[i] = FA_CREATE;
@ -618,11 +605,11 @@ assert(otherFi != NULL);
}
/* Try to get the disk accounting correct even if a conflict. */
fixupSize = otherFi->fsizes[otherFileNum];
fixupSize = rpmfiFSize(otherFi);
if ((rpmfiFFlags(fi) & RPMFILE_CONFIG) && !lstat(fn, &sb)) {
if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) {
/* Here is an overlapped pre-existing config file. */
fi->actions[i] = (rpmfiFFlags(fi) & RPMFILE_NOREPLACE)
fi->actions[i] = (FFlags & RPMFILE_NOREPLACE)
? FA_ALTNAME : FA_SKIP;
} else {
fi->actions[i] = FA_CREATE;
@ -643,16 +630,16 @@ assert(otherFi != NULL);
}
if (XFA_SKIPPING(fi->actions[i]))
/*@switchbreak@*/ break;
if (fi->fstates && fi->fstates[i] != RPMFILE_STATE_NORMAL)
if (rpmfiFState(fi) != RPMFILE_STATE_NORMAL)
/*@switchbreak@*/ break;
if (!(S_ISREG(fi->fmodes[i]) && (rpmfiFFlags(fi) & RPMFILE_CONFIG))) {
if (!(S_ISREG(FMode) && (FFlags & RPMFILE_CONFIG))) {
fi->actions[i] = FA_ERASE;
/*@switchbreak@*/ break;
}
/* Here is a pre-existing modified config file that needs saving. */
{ char md5sum[50];
const unsigned char * MD5 = fi->md5s + (16 * i);
const unsigned char * MD5 = rpmfiMD5(fi);
if (!domd5(fn, md5sum, 0, NULL) && memcmp(MD5, md5sum, 16)) {
fi->actions[i] = FA_BACKUP;
/*@switchbreak@*/ break;
@ -664,8 +651,8 @@ assert(otherFi != NULL);
/*@=boundswrite@*/
/* Update disk space info for a file. */
rpmtsUpdateDSI(ts, fi->fps[i].entry->dev,
fi->fsizes[i], fi->replacedSizes[i], fixupSize, fi->actions[i]);
rpmtsUpdateDSI(ts, fiFps->entry->dev,
rpmfiFSize(fi), fi->replacedSizes[i], fixupSize, fi->actions[i]);
}
ps = rpmpsFree(ps);
@ -892,20 +879,25 @@ static void skipFiles(const rpmts ts, rpmfi fi)
fi = rpmfiInit(fi, 0);
if (fi != NULL) /* XXX lclint */
while ((i = rpmfiNext(fi)) >= 0) {
const char * dir;
const char * fdn, * fbn;
int_16 fFMode;
if (XFA_SKIPPING(fi->actions[i]))
/*@innercontinue@*/ continue;
if (whatis(fi->fmodes[i]) != XDIR)
fFMode = rpmfiFMode(fi);
if (whatis(fFMode) != XDIR)
/*@innercontinue@*/ continue;
dir = fi->dnl[fi->dil[i]];
if (strlen(dir) != dnlen)
fdn = rpmfiDN(fi);
if (strlen(fdn) != dnlen)
/*@innercontinue@*/ continue;
if (strncmp(dir, dn, dnlen))
if (strncmp(fdn, dn, dnlen))
/*@innercontinue@*/ continue;
if (strlen(fi->bnl[i]) != bnlen)
fbn = rpmfiBN(fi);
if (strlen(fbn) != bnlen)
/*@innercontinue@*/ continue;
if (strncmp(fi->bnl[i], bn, bnlen))
if (strncmp(fbn, bn, bnlen))
/*@innercontinue@*/ continue;
rpmMessage(RPMMESS_DEBUG, _("excluding directory %s\n"), dn);
fi->actions[i] = FA_SKIPNSTATE;
@ -1107,11 +1099,6 @@ rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount)
continue; /* XXX can't happen */
fc = rpmfiFC(fi);
#ifdef DYING /* XXX W2DO? this is now done in rpmtsiFi, okay ??? */
fi->magic = RPMFIMAGIC;
fi->te = p;
#endif
/*@-branchstate@*/
switch (rpmteType(p)) {
case TR_ADDED:

600
po/cs.po

File diff suppressed because it is too large Load Diff

602
po/da.po

File diff suppressed because it is too large Load Diff

589
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

545
po/es.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

588
po/fi.po

File diff suppressed because it is too large Load Diff

588
po/fr.po

File diff suppressed because it is too large Load Diff

545
po/gl.po

File diff suppressed because it is too large Load Diff

545
po/hu.po

File diff suppressed because it is too large Load Diff

545
po/id.po

File diff suppressed because it is too large Load Diff

568
po/is.po

File diff suppressed because it is too large Load Diff

545
po/it.po

File diff suppressed because it is too large Load Diff

591
po/ja.po

File diff suppressed because it is too large Load Diff

600
po/ko.po

File diff suppressed because it is too large Load Diff

594
po/no.po

File diff suppressed because it is too large Load Diff

589
po/pl.po

File diff suppressed because it is too large Load Diff

603
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

545
po/ro.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

600
po/ru.po

File diff suppressed because it is too large Load Diff

589
po/sk.po

File diff suppressed because it is too large Load Diff

591
po/sl.po

File diff suppressed because it is too large Load Diff

588
po/sr.po

File diff suppressed because it is too large Load Diff

591
po/sv.po

File diff suppressed because it is too large Load Diff

604
po/tr.po

File diff suppressed because it is too large Load Diff

545
po/uk.po

File diff suppressed because it is too large Load Diff

545
po/wa.po

File diff suppressed because it is too large Load Diff

545
po/zh.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-07-24 00:03+0100\n"
"Last-Translator: Milan Kerslager <kerslage@linux.cz>\n"
"Language-Team: Czech <cs@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: Sun Jan 21 2001 04:30:32+0200\n"
"Last-Translator: Martin Hansen <mah@k64.dk>\n"
"Language-Team: Dansk <dansk@klid.dk>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Leandro Lucarella <luca@linuxmendoza.org.ar>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-01-17 01:01+0100\n"
"Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2000-08-03 23:26+0200\n"
"Last-Translator: László Németh <nemeth@qwertynet.hu>\n"
"Language-Team: Hungarian\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-06-08 01:35+0000\n"
"Last-Translator: Richard Allen <ra@hp.is>\n"
"Language-Team: is <kde-isl@mmedia.is>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-09-06 20:06+0900\n"
"Last-Translator: Jong-Hoon Ryu <redhat4u@netian.com>\n"
"Language-Team: GNU Translation project <ko@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-06-27 11:05+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@online.no>\n"
"Language-Team: Norwegian <no@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2002-02-13 18:32+0000\n"
"Last-Translator: Pedro Morais <morais@kde.org>\n"
"Language-Team: pt <morais@kde.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2000-06-14 23:23+EST\n"
"Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
"Language-Team: Romanian <ro@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-07-05 21:00-0500\n"
"Last-Translator: Eugene Kanter <eugene@blackcatlinux.com>\n"
"Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 1999-08-04 21:40+0200\n"
"Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2000-09-05 12:30+0200\n"
"Last-Translator: Roman Maurer <roman.maurer@hermes.si>\n"
"Language-Team: Slovenian <sl@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2001-07-12 22:26+0100\n"
"Last-Translator: Christian Rose <menthos@menthos.com>\n"
"Language-Team: Swedish <sv@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 2000-02-11 13:01+0200\n"
"Last-Translator: Nilgun Belma Buguner <nilgun@technologist.com>\n"
"Language-Team: Turkish <tr@li.org>\n"

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 1999-09-30 16:54+0200\n"
"Last-Translator: Yuri Syrota <rasta@renome.rovno.ua>\n"
"Language-Team: Ukrainian <uk@li.org>\n"

View File

@ -9,7 +9,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 1999-03-18 23:11+0100\n"
"Last-Translator: Nobody yet\n"
"Language-Team: walon <linux-wa@chanae.alphanet.ch>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
"POT-Creation-Date: 2002-07-25 14:27-0400\n"
"POT-Creation-Date: 2002-07-27 20:40-0400\n"
"PO-Revision-Date: 1999-11-11 05:04+0800\n"
"Last-Translator: Dillion Chen <dillon.chen@turbolinux.com.cn>\n"
"Language-Team: TLDN\n"

View File

@ -101,7 +101,11 @@ getArgDescrip(const struct poptOption * opt,
switch (opt->argInfo & POPT_ARG_MASK) {
case POPT_ARG_NONE: return POPT_("NONE");
#ifdef DYING
case POPT_ARG_VAL: return POPT_("VAL");
#else
case POPT_ARG_VAL: return NULL;
#endif
case POPT_ARG_INT: return POPT_("INT");
case POPT_ARG_LONG: return POPT_("LONG");
case POPT_ARG_STRING: return POPT_("STRING");
@ -599,6 +603,16 @@ static int itemUsage(FILE * fp, int cursor, poptItem item, int nitems,
return cursor;
}
/**
* Keep track of option tables already processed.
*/
typedef struct poptDone_s {
int nopts;
int maxopts;
/*@observer@*/
const void ** opts;
} * poptDone;
/**
* Display usage text for a table of options.
* @param con context
@ -606,10 +620,13 @@ static int itemUsage(FILE * fp, int cursor, poptItem item, int nitems,
* @param cursor
* @param opt option(s)
* @param translation_domain translation domain
* @param done tables already processed
* @return
*/
static int singleTableUsage(poptContext con, FILE * fp,
int cursor, const struct poptOption * opt,
/*@null@*/ const char * translation_domain)
/*@null@*/ const char * translation_domain,
poptDone done)
/*@globals fileSystem @*/
/*@modifies *fp, fileSystem @*/
{
@ -619,9 +636,21 @@ static int singleTableUsage(poptContext con, FILE * fp,
if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) {
translation_domain = (const char *)opt->arg;
} else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) {
if (opt->arg) /* XXX program error */
int i = 0;
if (done)
for (i = 0; i < done->nopts; i++) {
const void * that = done->opts[i];
if (that == NULL || that != opt->arg)
continue;
break;
}
/* Skip if this table has already been processed. */
if (opt->arg == NULL || i < done->nopts)
continue;
if (done->nopts < done->maxopts)
done->opts[done->nopts++] = (const void *) opt->arg;
cursor = singleTableUsage(con, fp, cursor, opt->arg,
translation_domain);
translation_domain, done);
} else if ((opt->longName || opt->shortName) &&
!(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) {
cursor = singleOptionUsage(fp, cursor, opt, translation_domain);
@ -634,6 +663,7 @@ static int singleTableUsage(poptContext con, FILE * fp,
/**
* Return concatenated short options for display.
* @todo Sub-tables should be recursed.
* @param opt option(s)
* @param fp output file handle
* @retval str concatenation of short options
@ -674,13 +704,20 @@ static int showShortOptions(const struct poptOption * opt, FILE * fp,
void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ int flags)
{
poptDone done = memset(alloca(sizeof(*done)), 0, sizeof(*done));
int cursor;
done->nopts = 0;
done->maxopts = 64;
cursor = done->maxopts * sizeof(*done->opts);
done->opts = memset(alloca(cursor), 0, cursor);
done->opts[done->nopts++] = (const void *) con->options;
cursor = showHelpIntro(con, fp);
cursor += showShortOptions(con->options, fp, NULL);
(void) singleTableUsage(con, fp, cursor, con->options, NULL);
(void) itemUsage(fp, cursor, con->aliases, con->numAliases, NULL);
(void) itemUsage(fp, cursor, con->execs, con->numExecs, NULL);
cursor = singleTableUsage(con, fp, cursor, con->options, NULL, done);
cursor = itemUsage(fp, cursor, con->aliases, con->numAliases, NULL);
cursor = itemUsage(fp, cursor, con->execs, con->numExecs, NULL);
if (con->otherHelp) {
cursor += strlen(con->otherHelp) + 1;

View File

@ -17,7 +17,7 @@ Name: rpm
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
Release: 0.57
Release: 0.58
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
@ -26,6 +26,7 @@ Conflicts: patch < 2.5
Prereq: gawk fileutils textutils mktemp shadow-utils
%endif
Requires: popt = 1.7
Obsoletes: rpm-perl < %{version}
%if !%{with_internal_db}
BuildRequires: db3-devel
@ -514,6 +515,10 @@ fi
%{__prefix}/include/popt.h
%changelog
* Sat Jul 27 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.58
- popt: display sub-table options only once on --usage.
- wire --nosignatures et al as common options, rework CLI options.
* Thu Jul 25 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.57
- python: remove the old initdb/rebuilddb methods, use ts.fooDB().
- python: 1st crack at backport to 1.5.2.

382
rpmqv.c
View File

@ -17,11 +17,6 @@
#include "rpmps.h"
#include "rpmts.h"
#define POPT_NODEPS 1025
#define POPT_FORCE 1026
#define POPT_NOMD5 1027
#define POPT_NOSCRIPTS 1028
#ifdef IAM_RPMBT
#include "build.h"
#define GETOPT_REBUILD 1003
@ -34,13 +29,6 @@
#include "debug.h"
#define GETOPT_SHOWRC 1018
#define GETOPT_DEFINEMACRO 1020
#define GETOPT_EVALMACRO 1021
#ifdef NOTYET
#define GETOPT_RCFILE 1022
#endif
enum modes {
MODE_QUERY = (1 << 0),
@ -76,96 +64,13 @@ enum modes {
#define MODES_FOR_TEST (MODES_BT | MODES_IE)
#define MODES_FOR_ROOT (MODES_BT | MODES_IE | MODES_QV | MODES_DB | MODES_K)
/*@-exportheadervar@*/
/*@unchecked@*/
extern int _ftp_debug;
/*@unchecked@*/
extern int noLibio;
/*@unchecked@*/
extern int _rpmio_debug;
/*@=exportheadervar@*/
/* options for all executables */
/*@unchecked@*/
static int help = 0;
/*@unchecked@*/
static int noUsageMsg = 0;
/*@unchecked@*/
/*@observer@*/ /*@null@*/
static const char * pipeOutput = NULL;
/*@unchecked@*/
static int quiet = 0;
/*@unchecked@*/
/*@observer@*/ /*@null@*/
static const char * rcfile = NULL;
/*@unchecked@*/
/*@observer@*/ /*@null@*/
static char * rootdir = "/";
/*@unchecked@*/
static int showrc = 0;
/*@unchecked@*/
static int showVersion = 0;
/*@unchecked@*/
static struct poptOption rpmAllPoptTable[] = {
{ "version", '\0', 0, &showVersion, 0,
N_("print the version of rpm being used"),
NULL },
{ "quiet", '\0', 0, &quiet, 0,
N_("provide less detailed output"), NULL},
{ "verbose", 'v', 0, 0, 'v',
N_("provide more detailed output"), NULL},
{ "define", '\0', POPT_ARG_STRING, 0, GETOPT_DEFINEMACRO,
N_("define MACRO with value EXPR"), N_("'MACRO EXPR'") },
{ "eval", '\0', POPT_ARG_STRING, 0, GETOPT_EVALMACRO,
N_("print macro expansion of EXPR"), N_("'EXPR'") },
{ "pipe", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, &pipeOutput, 0,
N_("send stdout to <cmd>"), N_("<cmd>") },
{ "root", 'r', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &rootdir, 0,
N_("use <dir> as the top level directory"), N_("<dir>") },
{ "macros", '\0', POPT_ARG_STRING, &macrofiles, 0,
N_("read <file:...> instead of default macro file(s)"),
N_("<file:...>") },
#if !defined(GETOPT_RCFILE)
{ "rcfile", '\0', POPT_ARG_STRING, &rcfile, 0,
N_("read <file:...> instead of default rpmrc file(s)"),
N_("<file:...>") },
#else
{ "rcfile", '\0', 0, 0, GETOPT_RCFILE,
N_("read <file:...> instead of default rpmrc file(s)"),
N_("<file:...>") },
#endif
{ "showrc", '\0', 0, &showrc, GETOPT_SHOWRC,
N_("display final rpmrc and macro configuration"),
NULL },
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
{ "nolibio", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noLibio, 1,
N_("disable use of libio(3) API"), NULL},
#endif
{ "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
N_("debug protocol data stream"), NULL},
{ "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
N_("debug rpmio I/O"), NULL},
{ "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
N_("debug URL cache handling"), NULL},
POPT_TABLEEND
};
/* the structure describing the options we take and the defaults */
/*@unchecked@*/
static struct poptOption optionsTable[] = {
/* XXX colliding options */
#if defined(IAM_RPMQV) || defined(IAM_RPMEIU) || defined(IAM_RPMBT)
#if defined(IAM_RPMQV) || defined(IAM_RPMEIU)
{ NULL, 'i', POPT_ARGFLAG_DOC_HIDDEN, 0, 'i', NULL, NULL},
{ "nodeps", 0, POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NODEPS, NULL, NULL},
{ "noscripts", 0, POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NOSCRIPTS, NULL, NULL},
{ "nomd5", 0, POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NOMD5, NULL, NULL},
{ "force", 0, POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_FORCE, NULL, NULL},
#endif
#ifdef IAM_RPMQV
@ -201,7 +106,7 @@ static struct poptOption optionsTable[] = {
NULL },
#endif /* IAM_RPMEIU */
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmAllPoptTable, 0,
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
N_("Common options for all rpm modes:"),
NULL },
@ -223,60 +128,33 @@ long _stksize = 64 * 1024L;
exit(EXIT_FAILURE);
}
static void printVersion(void)
static void printVersion(FILE * fp)
/*@globals rpmEVR, fileSystem @*/
/*@modifies fileSystem @*/
{
fprintf(stdout, _("RPM version %s\n"), rpmEVR);
fprintf(fp, _("RPM version %s\n"), rpmEVR);
}
static void printBanner(void)
static void printBanner(FILE * fp)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/
{
(void) puts(_("Copyright (C) 1998-2002 - Red Hat, Inc."));
(void) puts(_("This program may be freely redistributed under the terms of the GNU GPL"));
fprintf(fp, _("Copyright (C) 1998-2002 - Red Hat, Inc.\n"));
fprintf(fp, _("This program may be freely redistributed under the terms of the GNU GPL\n"));
}
static void printUsage(void)
static void printUsage(poptContext con, FILE * fp, int flags)
/*@globals __assert_program_name, rpmEVR, fileSystem @*/
/*@modifies fileSystem @*/
{
FILE * fp = stdout;
printVersion();
printBanner();
(void) puts("");
fprintf(fp, _("Usage: %s {--help}\n"), __progname);
fprintf(fp, " %s {--version}\n" , __progname);
#ifdef IAM_RPMEIU
#ifdef DYING
--dbpath all
--ftpproxy etc all
--force alias for --replacepkgs --replacefiles
--includedocs handle as option in table
--erase forbids many options
#endif /* DYING */
#endif /* IAM_RPMEIU */
#ifdef IAM_RPMQV
#ifdef DYING /* XXX popt glue needing --help doco. */
--dbpath all
--ftpproxy etc all
-i,--info Q
-R,--requires Q
-P,--provides Q
--scripts Q
--triggeredby Q
--changelog Q
--triggers Q
--querytags !V
--setperms V
--setugids V
#endif /* DYING */
#endif /* IAM_RPMQV */
printVersion(fp);
printBanner(fp);
fprintf(fp, "\n");
if (rpmIsVerbose())
poptPrintHelp(con, fp, flags);
else
poptPrintUsage(con, fp, flags);
}
/*@-bounds@*/ /* LCL: segfault */
@ -320,7 +198,6 @@ int main(int argc, const char ** argv)
#endif
int arg;
int gotDbpath = 0;
const char * optArg;
pid_t pipeChild = 0;
@ -369,18 +246,7 @@ int main(int argc, const char ** argv)
#endif
/*@=nullpass@*/
/* set the defaults for the various command line options */
_ftp_debug = 0;
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
noLibio = 0;
#else
noLibio = 1;
#endif
_rpmio_debug = 0;
/* XXX Eliminate query linkage loop */
specedit = 0;
/*@-type@*/ /* FIX: casts? */
parseSpecVec = parseSpec;
freeSpecVec = freeSpec;
@ -406,146 +272,14 @@ int main(int argc, const char ** argv)
(void) poptReadDefaultConfig(optCon, 1);
poptSetExecPath(optCon, RPMCONFIGDIR, 1);
/* reading rcfile early makes it easy to override */
/* XXX only --rcfile (and --showrc) need this pre-parse */
while ((arg = poptGetNextOpt(optCon)) > 0) {
switch(arg) {
case 'v':
rpmIncreaseVerbosity(); /* XXX silly use by showrc */
/*@switchbreak@*/ break;
default:
/*@switchbreak@*/ break;
}
}
if (rpmReadConfigFiles(rcfile, NULL))
exit(EXIT_FAILURE);
if (showrc) {
(void) rpmShowRC(stdout);
exit(EXIT_SUCCESS);
}
rpmSetVerbosity(RPMMESS_NORMAL); /* XXX silly use by showrc */
poptResetContext(optCon);
#ifdef IAM_RPMQV
qva->qva_queryFormat = _free(qva->qva_queryFormat);
memset(qva, 0, sizeof(*qva));
qva->qva_source = RPMQV_PACKAGE;
qva->qva_fflags = RPMFILE_ALL;
qva->qva_mode = ' ';
qva->qva_char = ' ';
#endif
#ifdef IAM_RPMBT
ba->buildRootOverride = _free(ba->buildRootOverride);
ba->targets = _free(ba->targets);
memset(ba, 0, sizeof(*ba));
ba->buildMode = ' ';
ba->buildChar = ' ';
#endif
#ifdef IAM_RPMDB
memset(da, 0, sizeof(*da));
#endif
#ifdef IAM_RPMK
ka->qva_queryFormat = _free(ka->qva_queryFormat);
memset(ka, 0, sizeof(*ka));
ka->qva_source = RPMQV_PACKAGE;
ka->qva_fflags = RPMFILE_ALL;
ka->qva_mode = ' ';
ka->qva_char = ' ';
#endif
#ifdef IAM_RPMEIU
if (ia->relocations != NULL)
for (i = 0; i < ia->numRelocations; i++)
ia->relocations[i].oldPath = _free(ia->relocations[i].oldPath);
ia->relocations = _free(ia->relocations);
memset(ia, 0, sizeof(*ia));
ia->transFlags = RPMTRANS_FLAG_NONE;
ia->probFilter = RPMPROB_FILTER_NONE;
ia->installInterfaceFlags = INSTALL_NONE;
ia->eraseInterfaceFlags = UNINSTALL_NONE;
#endif
while ((arg = poptGetNextOpt(optCon)) > 0) {
optArg = poptGetOptArg(optCon);
switch (arg) {
case 'v':
rpmIncreaseVerbosity();
/*@switchbreak@*/ break;
/* XXX options used in multiple rpm modes */
#if defined(IAM_RPMQV) || defined(IAM_RPMK)
case POPT_NOMD5:
#ifdef IAM_RPMQV
if (bigMode == MODE_VERIFY || qva->qva_mode == 'V')
qva->qva_flags |= VERIFY_MD5;
else
#endif
#ifdef IAM_RPMK
if (bigMode & MODES_K)
ka->qva_flags |= VERIFY_MD5;
else
#endif
#ifdef IAM_RPMEIU
if (bigMode & MODES_IE)
ia->transFlags |= RPMTRANS_FLAG_NOMD5;
else
#endif
{};
/*@switchbreak@*/ break;
#endif /* IAM_RPMQV || IAM_RPMK */
#if defined(IAM_RPMQV) || defined(IAM_RPMEIU) || defined(IAM_RPMBT)
case POPT_NODEPS:
#ifdef IAM_RPMQV
if (bigMode == MODE_VERIFY || qva->qva_mode == 'V')
qva->qva_flags |= VERIFY_DEPS;
else
#endif
#ifdef IAM_RPMEIU
if ((bigMode & MODES_IE) ||
(ia->installInterfaceFlags &
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL|INSTALL_ERASE)))
ia->noDeps = 1;
else
#endif
#ifdef IAM_RPMBT
if ((bigMode & MODES_BT) || ba->buildMode != ' ')
ba->noDeps = 1;
else
#endif
/*@-ifempty@*/ ;
/*@switchbreak@*/ break;
case POPT_FORCE:
#ifdef IAM_RPMEIU
if ((bigMode & MODES_IE) ||
(ia->installInterfaceFlags &
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL|INSTALL_ERASE)))
ia->probFilter |=
( RPMPROB_FILTER_REPLACEPKG
| RPMPROB_FILTER_REPLACEOLDFILES
| RPMPROB_FILTER_REPLACENEWFILES
| RPMPROB_FILTER_OLDPACKAGE);
else
#endif
#ifdef IAM_RPMBT
if ((bigMode & MODES_BT) || ba->buildMode != ' ')
ba->force = 1;
else
#endif
/*@-ifempty@*/ ;
/*@switchbreak@*/ break;
#if defined(IAM_RPMQV) || defined(IAM_RPMEIU)
case 'i':
#ifdef IAM_RPMQV
if (bigMode == MODE_QUERY || qva->qva_mode == 'q') {
@ -569,49 +303,7 @@ int main(int argc, const char ** argv)
#endif
/*@-ifempty@*/ ;
/*@switchbreak@*/ break;
case POPT_NOSCRIPTS:
#ifdef IAM_RPMQV
if (bigMode == MODE_VERIFY || qva->qva_mode == 'V')
qva->qva_flags |= VERIFY_SCRIPT;
else
#endif
#ifdef IAM_RPMEIU
if ((bigMode & MODES_IE) ||
(ia->installInterfaceFlags &
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL|INSTALL_ERASE)))
ia->transFlags |= (_noTransScripts | _noTransTriggers);
else
#endif
/*@-ifempty@*/ ;
/*@switchbreak@*/ break;
#endif /* IAM_RPMQV || IAM_RPMEIU || IAM_RPMBT */
case GETOPT_DEFINEMACRO:
if (optArg) {
(void) rpmDefineMacro(NULL, optArg, RMIL_CMDLINE);
/*@i@*/ (void) rpmDefineMacro(rpmCLIMacroContext, optArg,RMIL_CMDLINE);
}
noUsageMsg = 1;
/*@switchbreak@*/ break;
case GETOPT_EVALMACRO:
if (optArg) {
const char *val = rpmExpand(optArg, NULL);
fprintf(stdout, "%s\n", val);
val = _free(val);
}
noUsageMsg = 1;
/*@switchbreak@*/ break;
#if defined(GETOPT_RCFILE)
case GETOPT_RCFILE:
fprintf(stderr, _("The --rcfile option has been eliminated.\n"));
fprintf(stderr, _("Use \"--macros <file:...>\" instead.\n"));
exit(EXIT_FAILURE);
/*@notreached@*/ break;
#endif
#endif /* IAM_RPMQV || IAM_RPMEIU */
default:
fprintf(stderr, _("Internal error in argument processing (%d) :-(\n"), arg);
@ -619,11 +311,6 @@ int main(int argc, const char ** argv)
}
}
if (quiet)
rpmSetVerbosity(RPMMESS_QUIET);
if (showVersion) printVersion();
if (arg < -1) {
fprintf(stderr, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
@ -631,6 +318,8 @@ int main(int argc, const char ** argv)
exit(EXIT_FAILURE);
}
rpmcliConfigured();
#ifdef IAM_RPMBT
switch (ba->buildMode) {
case 'b': bigMode = MODE_BUILD; break;
@ -733,11 +422,6 @@ int main(int argc, const char ** argv)
}
#endif /* IAM_RPMK */
/* XXX TODO: never happens. */
if (gotDbpath && (bigMode & ~MODES_FOR_DBPATH))
argerror(_("--dbpath given for operation that does not use a "
"database"));
#if defined(IAM_RPMEIU)
if (!( bigMode == MODE_INSTALL ) &&
(ia->probFilter & (RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES | RPMPROB_FILTER_OLDPACKAGE)))
@ -832,19 +516,19 @@ int main(int argc, const char ** argv)
"erasure, and building"));
#endif /* IAM_RPMEIU */
if (rootdir && rootdir[1] && (bigMode & ~MODES_FOR_ROOT))
if (rpmcliRootDir && rpmcliRootDir[1] && (bigMode & ~MODES_FOR_ROOT))
argerror(_("--root (-r) may only be specified during "
"installation, erasure, querying, and "
"database rebuilds"));
if (rootdir) {
switch (urlIsURL(rootdir)) {
if (rpmcliRootDir) {
switch (urlIsURL(rpmcliRootDir)) {
default:
if (bigMode & MODES_FOR_ROOT)
break;
/*@fallthrough@*/
case URL_IS_UNKNOWN:
if (rootdir[0] != '/')
if (rpmcliRootDir[0] != '/')
argerror(_("arguments to --root (-r) must begin with a /"));
break;
}
@ -925,14 +609,14 @@ int main(int argc, const char ** argv)
/*@=branchstate@*/
#endif /* IAM_RPMBT || IAM_RPMK */
if (pipeOutput) {
if (rpmcliPipeOutput) {
(void) pipe(p);
if (!(pipeChild = fork())) {
(void) close(p[1]);
(void) dup2(p[0], STDIN_FILENO);
(void) close(p[0]);
(void) execl("/bin/sh", "/bin/sh", "-c", pipeOutput, NULL);
(void) execl("/bin/sh", "/bin/sh", "-c", rpmcliPipeOutput, NULL);
fprintf(stderr, _("exec failed\n"));
}
@ -942,7 +626,7 @@ int main(int argc, const char ** argv)
}
ts = rpmtsCreate();
(void) rpmtsSetRootDir(ts, rootdir);
(void) rpmtsSetRootDir(ts, rpmcliRootDir);
switch (bigMode) {
#ifdef IAM_RPMDB
case MODE_INITDB:
@ -985,9 +669,9 @@ int main(int argc, const char ** argv)
ba->cookie = NULL;
ec = rpmInstallSource(ts, pkg, &specFile, &ba->cookie);
if (ec == 0) {
ba->rootdir = rootdir;
ba->rootdir = rpmcliRootDir;
ba->passPhrase = passPhrase;
ec = build(ts, specFile, ba, rcfile);
ec = build(ts, specFile, ba, rpmcliRcfile);
}
ba->cookie = _free(ba->cookie);
specFile = _free(specFile);
@ -1042,14 +726,14 @@ int main(int argc, const char ** argv)
}
while ((pkg = poptGetArg(optCon))) {
ba->rootdir = rootdir;
ba->rootdir = rpmcliRootDir;
ba->passPhrase = passPhrase;
ba->cookie = NULL;
ec = build(ts, pkg, ba, rcfile);
ec = build(ts, pkg, ba, rpmcliRcfile);
if (ec)
/*@loopbreak@*/ break;
rpmFreeMacros(NULL);
(void) rpmReadConfigFiles(rcfile, NULL);
(void) rpmReadConfigFiles(rpmcliRcfile, NULL);
}
} break;
#endif /* IAM_RPMBT */
@ -1071,7 +755,6 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
case MODE_INSTALL:
/* RPMTRANS_FLAG_BUILD_PROBS */
/* RPMTRANS_FLAG_KEEPOBSOLETE */
if (!ia->incldocs) {
@ -1187,7 +870,8 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
case MODE_ERASE:
#endif
case MODE_UNKNOWN:
if (!showVersion && !help && !noUsageMsg) printUsage();
if (poptPeekArg(optCon) != NULL || argc <= 1 || rpmIsVerbose())
printUsage(optCon, stdout, 0);
break;
}

View File

@ -513,10 +513,6 @@ static int vsflags = _RPMTS_VSF_VERIFY_LEGACY;
static struct poptOption optionsTable[] = {
{ "nolegacy", '\0', POPT_BIT_CLR, &vsflags, _RPMTS_VSF_VERIFY_LEGACY,
N_("don't verify header+payload signature"), NULL },
{ "nodigest", '\0', POPT_BIT_SET, &vsflags, _RPMTS_VSF_NODIGESTS,
N_("don't verify package digest"), NULL },
{ "nosignature", '\0', POPT_BIT_SET, &vsflags, _RPMTS_VSF_NOSIGNATURES,
N_("don't verify package signature"), NULL },
{ "nocache", '\0', POPT_ARG_VAL, &noCache, -1,
N_("don't update cache database, only print package paths"), NULL },
@ -585,7 +581,15 @@ main(int argc, char *const argv[])
}
ts = rpmtsCreate();
if (rpmcliQueryFlags & VERIFY_DIGEST)
vsflags |= _RPMTS_VSF_NODIGESTS;
if (rpmcliQueryFlags & VERIFY_SIGNATURE)
vsflags |= _RPMTS_VSF_NOSIGNATURES;
if (rpmcliQueryFlags & VERIFY_HDRCHK)
vsflags |= _RPMTS_VSF_NOHDRCHK;
(void) rpmtsSetVerifySigFlags(ts, vsflags);
{ int_32 tid = (int_32) time(NULL);
(void) rpmtsSetTid(ts, tid);
}

View File

@ -274,10 +274,6 @@ static struct poptOption optionsTable[] = {
N_("don't verify package dependencies"), NULL },
{ "nolegacy", '\0', POPT_BIT_CLR, &vsflags, _RPMTS_VSF_VERIFY_LEGACY,
N_("don't verify header+payload signature"), NULL },
{ "nodigest", '\0', POPT_BIT_SET, &vsflags, _RPMTS_VSF_NODIGESTS,
N_("don't verify package digest"), NULL },
{ "nosignature", '\0', POPT_BIT_SET, &vsflags, _RPMTS_VSF_NOSIGNATURES,
N_("don't verify package signature"), NULL },
{ "nochainsaw", '\0', POPT_ARGFLAG_DOC_HIDDEN, &noChainsaw, 0,
NULL, NULL},
@ -304,6 +300,12 @@ main(int argc, char *const argv[])
exit(EXIT_FAILURE);
ts = rpmtsCreate();
if (rpmcliQueryFlags & VERIFY_DIGEST)
vsflags |= _RPMTS_VSF_NODIGESTS;
if (rpmcliQueryFlags & VERIFY_SIGNATURE)
vsflags |= _RPMTS_VSF_NOSIGNATURES;
if (rpmcliQueryFlags & VERIFY_HDRCHK)
vsflags |= _RPMTS_VSF_NOHDRCHK;
(void) rpmtsSetVerifySigFlags(ts, vsflags);
ec = rpmGraph(ts, ia, poptGetArgs(optCon));