rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

lib/poptQV.c
Go to the documentation of this file.

    00001
    00006 #include "system.h"
    00007
    00008 #include <rpmio.h>
    00009 #include <rpmiotypes.h>
    00010 #include <rpmcb.h>
    00011
    00012 #include <rpmtag.h>
    00013 #include <rpmcli.h>
    00014 #include <rpmgi.h>              /* XXX for giFlags */
    00015
    00016 #include "debug.h"
    00017
    00018 /*@unchecked@*/
    00019 struct rpmQVKArguments_s rpmQVKArgs;
    00020
    00021 /*@unchecked@*/
    00022 int specedit = 0;
    00023
    00024 #define POPT_QUERYFORMAT        -1000
    00025 #define POPT_WHATREQUIRES       -1001
    00026 #define POPT_WHATPROVIDES       -1002
    00027 #define POPT_QUERYBYNUMBER      -1003
    00028 #define POPT_TRIGGEREDBY        -1004
    00029 #define POPT_DUMP               -1005
    00030 #define POPT_SPECFILE           -1006
    00031 #define POPT_QUERYBYPKGID       -1007
    00032 #define POPT_QUERYBYHDRID       -1008
    00033 #define POPT_QUERYBYFILEID      -1009
    00034 #define POPT_QUERYBYTID         -1010
    00035 #define POPT_HDLIST             -1011
    00036 #define POPT_FTSWALK            -1012
    00037
    00038 /* -1025 thrugh -1033 are common in rpmcli.h. */
    00039 #define POPT_TRUST              -1037
    00040 #define POPT_WHATNEEDS          -1038
    00041 #define POPT_SPECSRPM           -1039
    00042 #define POPT_QUERYBYSOURCEPKGID -1040
    00043 #define POPT_WHATCONFLICTS      -1041
    00044 #define POPT_WHATOBSOLETES      -1042
    00045 #define POPT_NOPASSWORD         -1043
    00046
    00047 /* ========== Query/Verify/Signature source args */
    00048 static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
    00049                 /*@unused@*/ enum poptCallbackReason reason,
    00050                 const struct poptOption * opt,
    00051                 /*@unused@*/ const char * arg,
    00052                 /*@unused@*/ const void * data)
    00053         /*@globals rpmQVKArgs @*/
    00054         /*@modifies rpmQVKArgs @*/
    00055 {
    00056     QVA_t qva = &rpmQVKArgs;
    00057
    00058     switch (opt->val) {
    00059     case 'q':   /* from --query, -q */
    00060     case 'Q':   /* from --querytags (handled by poptALL) */
    00061     case 'V':   /* from --verify, -V */
    00062     case 'A':   /* from --addsign */
    00063     case 'D':   /* from --delsign */
    00064     case 'I':   /* from --import */
    00065     case 'K':   /* from --checksig, -K */
    00066     case 'R':   /* from --resign */
    00067         if (qva->qva_mode == '\0' || strchr("qQ ", qva->qva_mode)) {
    00068             qva->qva_mode = opt->val;
    00069             qva->qva_char = ' ';
    00070         }
    00071         break;
    00072     case 'a': qva->qva_source |= RPMQV_ALL; qva->qva_sourceCount++; break;
    00073     case 'f': qva->qva_source |= RPMQV_PATH; qva->qva_sourceCount++; break;
    00074     case 'g': qva->qva_source |= RPMQV_GROUP; qva->qva_sourceCount++; break;
    00075     case 'p': qva->qva_source |= RPMQV_RPM; qva->qva_sourceCount++; break;
    00076     case POPT_WHATNEEDS: qva->qva_source |= RPMQV_WHATNEEDS;
    00077                                 qva->qva_sourceCount++; break;
    00078     case POPT_WHATPROVIDES: qva->qva_source |= RPMQV_WHATPROVIDES;
    00079                                 qva->qva_sourceCount++; break;
    00080     case POPT_WHATREQUIRES: qva->qva_source |= RPMQV_WHATREQUIRES;
    00081                                 qva->qva_sourceCount++; break;
    00082     case POPT_WHATCONFLICTS: qva->qva_source |= RPMQV_WHATCONFLICTS;
    00083                                 qva->qva_sourceCount++; break;
    00084     case POPT_WHATOBSOLETES: qva->qva_source |= RPMQV_WHATOBSOLETES;
    00085                                 qva->qva_sourceCount++; break;
    00086     case POPT_TRIGGEREDBY: qva->qva_source |= RPMQV_TRIGGEREDBY;
    00087                                 qva->qva_sourceCount++; break;
    00088     case POPT_QUERYBYSOURCEPKGID: qva->qva_source |= RPMQV_SOURCEPKGID;
    00089                                 qva->qva_sourceCount++; break;
    00090     case POPT_QUERYBYPKGID: qva->qva_source |= RPMQV_PKGID;
    00091                                 qva->qva_sourceCount++; break;
    00092     case POPT_QUERYBYHDRID: qva->qva_source |= RPMQV_HDRID;
    00093                                 qva->qva_sourceCount++; break;
    00094     case POPT_QUERYBYFILEID: qva->qva_source |= RPMQV_FILEID;
    00095                                 qva->qva_sourceCount++; break;
    00096     case POPT_QUERYBYTID: qva->qva_source |= RPMQV_TID;
    00097                                 qva->qva_sourceCount++; break;
    00098     case POPT_HDLIST: qva->qva_source |= RPMQV_HDLIST;
    00099                                 qva->qva_sourceCount++; break;
    00100     case POPT_FTSWALK:qva->qva_source |= RPMQV_FTSWALK;
    00101                                 qva->qva_sourceCount++; break;
    00102
    00103 /* XXX SPECFILE is not verify sources */
    00104     case POPT_SPECFILE:
    00105         qva->qva_source |= RPMQV_SPECFILE;
    00106         qva->qva_sourceCount++;
    00107         break;
    00108 /* XXX SPECSRPM is not verify sources */
    00109     case POPT_SPECSRPM:
    00110         qva->qva_source |= RPMQV_SPECSRPM;
    00111         qva->qva_sourceCount++;
    00112         break;
    00113     case POPT_QUERYBYNUMBER:
    00114         qva->qva_source |= RPMQV_DBOFFSET;
    00115         qva->qva_sourceCount++;
    00116         break;
    00117
    00118     case POPT_NOPASSWORD:
    00119         qva->nopassword = 1;
    00120         break;
    00121
    00122     }
    00123 }
    00124
    00128 /*@unchecked@*/
    00129 struct poptOption rpmQVSourcePoptTable[] = {
    00130 /*@-type@*/ /* FIX: cast? */
    00131  { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
    00132         rpmQVSourceArgCallback, 0, NULL, NULL },
    00133 /*@=type@*/
    00134  { "all", 'a', 0, NULL, 'a',
    00135         N_("query/verify all packages"), NULL },
    00136  { "checksig", 'K', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'K',
    00137         N_("rpm checksig mode"), NULL },
    00138  { "file", 'f', 0, NULL, 'f',
    00139         N_("query/verify package(s) owning file"), "FILE" },
    00140  { "group", 'g', 0, NULL, 'g',
    00141         N_("query/verify package(s) in group"), "GROUP" },
    00142  { "package", 'p', 0, NULL, 'p',
    00143         N_("query/verify a package file"), NULL },
    00144
    00145  { "ftswalk", 'W', 0, NULL, POPT_FTSWALK,
    00146         N_("query/verify package(s) from TOP file tree walk"), "TOP" },
    00147  { "hdlist", 'H', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_HDLIST,
    00148         N_("query/verify package(s) from system HDLIST"), "HDLIST" },
    00149
    00150  { "sourcepkgid", '\0', 0, NULL, POPT_QUERYBYSOURCEPKGID,
    00151         N_("query/verify package(s) with source package identifier"), "MD5" },
    00152  { "pkgid", '\0', 0, NULL, POPT_QUERYBYPKGID,
    00153         N_("query/verify package(s) with package identifier"), "MD5" },
    00154  { "hdrid", '\0', 0, NULL, POPT_QUERYBYHDRID,
    00155         N_("query/verify package(s) with header identifier"), "SHA1" },
    00156  { "fileid", '\0', 0, NULL, POPT_QUERYBYFILEID,
    00157         N_("query/verify package(s) with file identifier"), "MD5" },
    00158
    00159  { "query", 'q', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'q',
    00160         N_("rpm query mode"), NULL },
    00161  { "querybynumber", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYNUMBER,
    00162         N_("query/verify a header instance"), "HDRNUM" },
    00163  { "specfile", '\0', 0, NULL, POPT_SPECFILE,
    00164         N_("query a spec file"), N_("<spec>") },
    00165  { "specsrpm", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_SPECSRPM,
    00166         N_("query source metadata from spec file parse"), N_("<spec>") },
    00167  { "tid", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYTID,
    00168         N_("query/verify package(s) from install transaction"), "TID" },
    00169  { "triggeredby", '\0', 0, NULL, POPT_TRIGGEREDBY,
    00170         N_("query the package(s) triggered by the package"), "PACKAGE" },
    00171  { "verify", 'V', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'V',
    00172         N_("rpm verify mode"), NULL },
    00173  { "whatrequires", '\0', 0, NULL, POPT_WHATREQUIRES,
    00174         N_("query/verify the package(s) which require a dependency"), "CAPABILITY" },
    00175  { "whatneeds", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_WHATNEEDS,
    00176         N_("query/verify the package(s) which require any contained provide"),
    00177         "CAPABILITY" },
    00178
    00179  { "whatprovides", '\0', 0, NULL, POPT_WHATPROVIDES,
    00180         N_("query/verify the package(s) which provide a dependency"), "CAPABILITY" },
    00181  { "whatconflicts", '\0', 0, NULL, POPT_WHATCONFLICTS,
    00182         N_("query/verify the package(s) which conflict with a dependency"), "CAPABILITY" },
    00183  { "whatobsoletes", '\0', 0, NULL, POPT_WHATOBSOLETES,
    00184         N_("query/verify the package(s) which obsolete a dependency"), "CAPABILITY" },
    00185
    00186  { "transaction", 'T', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, (RPMGI_TSADD|RPMGI_TSORDER),
    00187         N_("create transaction set"), NULL},
    00188  { "noorder", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_TSORDER,
    00189         N_("do not order transaction set"), NULL},
    00190  { "noglob", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOGLOB,
    00191         N_("do not glob arguments"), NULL},
    00192  { "nomanifest", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOMANIFEST,
    00193         N_("do not process non-package files as manifests"), NULL},
    00194  { "noheader", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOHEADER,
    00195         N_("do not read headers"), NULL},
    00196
    00197
    00198    POPT_TABLEEND
    00199 };
    00200
    00201 /* ========== Query specific popt args */
    00202
    00203 static void queryArgCallback(poptContext con,
    00204                 /*@unused@*/ enum poptCallbackReason reason,
    00205                 const struct poptOption * opt, const char * arg,
    00206                 /*@unused@*/ const void * data)
    00207         /*@globals rpmQVKArgs @*/
    00208         /*@modifies con, rpmQVKArgs @*/
    00209 {
    00210     QVA_t qva = &rpmQVKArgs;
    00211
    00212     /* XXX avoid accidental collisions with POPT_BIT_SET for flags */
    00213     if (opt->arg == NULL)
    00214     switch (opt->val) {
    00215     case 'c': qva->qva_flags |= QUERY_FOR_CONFIG | QUERY_FOR_LIST; break;
    00216     case 'd': qva->qva_flags |= QUERY_FOR_DOCS | QUERY_FOR_LIST; break;
    00217     case 'l': qva->qva_flags |= QUERY_FOR_LIST; break;
    00218     case 's': qva->qva_flags |= QUERY_FOR_STATE | QUERY_FOR_LIST;
    00219         break;
    00220     case POPT_DUMP: qva->qva_flags |= QUERY_FOR_DUMPFILES | QUERY_FOR_LIST;
    00221         break;
    00222
    00223     case POPT_QUERYFORMAT:
    00224         if (arg) {
    00225             char * qf = (char *)qva->qva_queryFormat;
    00226             char * b = NULL;
    00227             size_t nb = 0;
    00228
    00229             /* Read queryformat from file. */
    00230             if (arg[0] == '/') {
    00231                 const char * fn = arg;
    00232                 int rc;
    00233
    00234                 rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES);
    00235                 if (rc != 0)
    00236                     goto _qfexit;
    00237                 if (b == NULL || nb == 0)       /* XXX can't happen */
    00238                     goto _qfexit;
    00239                 /* XXX trim double quotes */
    00240                 if (*b == '"') {
    00241                     while (nb > 0 && b[nb] != '"')
    00242                         b[nb--] = '\0';
    00243                     b[nb] = '\0';
    00244                     arg = b + 1;
    00245                 } else
    00246                     arg = b;
    00247             }
    00248
    00249             /* Append to existing queryformat. */
    00250             if (qf) {
    00251                 size_t len = strlen(qf) + strlen(arg) + 1;
    00252                 qf = xrealloc(qf, len);
    00253                 strcat(qf, arg);
    00254             } else {
    00255                 qf = xmalloc(strlen(arg) + 1);
    00256                 strcpy(qf, arg);
    00257             }
    00258             qva->qva_queryFormat = qf;
    00259
    00260         _qfexit:
    00261             b = _free(b);
    00262         }
    00263         break;
    00264
    00265     case 'i':
    00266         if (qva->qva_mode == 'q') {
    00267             /*@-nullassign -readonlytrans@*/
    00268             const char * infoCommand[] = { "--info", NULL };
    00269             /*@=nullassign =readonlytrans@*/
    00270             (void) poptStuffArgs(con, infoCommand);
    00271         }
    00272         break;
    00273
    00274     case RPMCLI_POPT_NODIGEST:
    00275         qva->qva_flags |= VERIFY_DIGEST;
    00276         break;
    00277
    00278     case RPMCLI_POPT_NOSIGNATURE:
    00279         qva->qva_flags |= VERIFY_SIGNATURE;
    00280         break;
    00281
    00282     case RPMCLI_POPT_NOHDRCHK:
    00283         qva->qva_flags |= VERIFY_HDRCHK;
    00284         break;
    00285
    00286     case RPMCLI_POPT_NODEPS:
    00287         qva->qva_flags |= VERIFY_DEPS;
    00288         break;
    00289
    00290     case RPMCLI_POPT_NOFDIGESTS:
    00291         qva->qva_flags |= VERIFY_FDIGEST;
    00292         break;
    00293
    00294     case RPMCLI_POPT_NOCONTEXTS:
    00295         qva->qva_flags |= VERIFY_CONTEXTS;
    00296         break;
    00297
    00298     case RPMCLI_POPT_NOSCRIPTS:
    00299         qva->qva_flags |= VERIFY_SCRIPT;
    00300         break;
    00301
    00302     /* XXX perhaps POPT_ARG_INT instead of callback. */
    00303     case POPT_TRUST:
    00304     {   char * end = NULL;
    00305         long trust = (int) strtol(arg, &end, 0);
    00306         /* XXX range checks on trust. */
    00307         /* XXX if (end && *end) argerror(_("non-numeric trust metric.")); */
    00308         qva->trust = trust;
    00309     }   break;
    00310     }
    00311 }
    00312
    00316 /*@unchecked@*/
    00317 struct poptOption rpmQueryPoptTable[] = {
    00318 /*@-type@*/ /* FIX: cast? */
    00319  { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
    00320         queryArgCallback, 0, NULL, NULL },
    00321 /*@=type@*/
    00322  { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
    00323         NULL, NULL },
    00324  { "configfiles", 'c', 0, 0, 'c',
    00325         N_("list all configuration files"), NULL },
    00326  { "docfiles", 'd', 0, 0, 'd',
    00327         N_("list all documentation files"), NULL },
    00328  { "dump", '\0', 0, 0, POPT_DUMP,
    00329         N_("dump basic file information"), NULL },
    00330  { NULL, 'i', POPT_ARGFLAG_DOC_HIDDEN, 0, 'i',
    00331         NULL, NULL },
    00332  { "list", 'l', 0, 0, 'l',
    00333         N_("list files in package"), NULL },
    00334
    00335  { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00336         &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS,
    00337         N_("add suggested packages to transaction"), NULL },
    00338
    00339  /* Duplicate file attr flags from packages into command line options. */
    00340  { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00341         &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG,
    00342         N_("skip %%config files"), NULL },
    00343  { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00344         &rpmQVKArgs.qva_fflags, RPMFILE_DOC,
    00345         N_("skip %%doc files"), NULL },
    00346  { "noghost", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00347         &rpmQVKArgs.qva_fflags, RPMFILE_GHOST,
    00348         N_("skip %%ghost files"), NULL },
    00349 #ifdef  NOTEVER         /* XXX there's hardly a need for these */
    00350  { "nolicense", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00351         &rpmQVKArgs.qva_fflags, RPMFILE_LICENSE,
    00352         N_("skip %%license files"), NULL },
    00353  { "noreadme", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00354         &rpmQVKArgs.qva_fflags, RPMFILE_README,
    00355         N_("skip %%readme files"), NULL },
    00356 #endif
    00357
    00358  { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0,
    00359         POPT_QUERYFORMAT, NULL, NULL },
    00360  { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT,
    00361         N_("use the following query format"), N_("QUERYFORMAT") },
    00362  { "specedit", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &specedit, -1,
    00363         N_("substitute i18n sections into spec file"), NULL },
    00364  { "state", 's', 0, 0, 's',
    00365         N_("display the states of the listed files"), NULL },
    00366  { "target", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0,  RPMCLI_POPT_TARGETPLATFORM,
    00367         N_("specify target platform"), N_("CPU-VENDOR-OS") },
    00368    POPT_TABLEEND
    00369 };
    00370
    00374 struct poptOption rpmVerifyPoptTable[] = {
    00375 /*@-type@*/ /* FIX: cast? */
    00376  { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
    00377         queryArgCallback, 0, NULL, NULL },
    00378 /*@=type@*/
    00379  { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
    00380         NULL, NULL },
    00381
    00382  { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
    00383         &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS,
    00384         N_("add suggested packages to transaction"), NULL },
    00385
    00386  /* Duplicate file attr flags from packages into command line options. */
    00387  { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00388         &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG,
    00389         N_("skip %%config files"), NULL },
    00390  { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00391         &rpmQVKArgs.qva_fflags, RPMFILE_DOC,
    00392         N_("skip %%doc files"), NULL },
    00393
    00394  /* Duplicate file verify flags from packages into command line options. */
    00396 #ifdef  DYING
    00397  { "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FDIGEST,
    00398         N_("don't verify file digests"), NULL },
    00399 #else
    00400  { "nomd5", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOFDIGESTS,
    00401         N_("don't verify file digests"), NULL },
    00402  { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS,
    00403         N_("don't verify file digests"), NULL },
    00404 #endif
    00405  { "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00406         &rpmQVKArgs.qva_flags, VERIFY_SIZE,
    00407         N_("don't verify size of files"), NULL },
    00408  { "nolinkto", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00409         &rpmQVKArgs.qva_flags, VERIFY_LINKTO,
    00410         N_("don't verify symlink path of files"), NULL },
    00411  { "nouser", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00412         &rpmQVKArgs.qva_flags, VERIFY_USER,
    00413         N_("don't verify owner of files"), NULL },
    00414  { "nogroup", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00415         &rpmQVKArgs.qva_flags, VERIFY_GROUP,
    00416         N_("don't verify group of files"), NULL },
    00417  { "nomtime", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00418         &rpmQVKArgs.qva_flags, VERIFY_MTIME,
    00419         N_("don't verify modification time of files"), NULL },
    00420  { "nomode", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00421         &rpmQVKArgs.qva_flags, VERIFY_MODE,
    00422         N_("don't verify mode of files"), NULL },
    00423  { "nordev", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00424         &rpmQVKArgs.qva_flags, VERIFY_RDEV,
    00425         N_("don't verify mode of files"), NULL },
    00426
    00427  { "nocontexts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOCONTEXTS,
    00428         N_("don't verify file security contexts"), NULL },
    00429  { "nofiles", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FILES,
    00430         N_("don't verify files in package"), NULL},
    00431 #ifdef  DYING
    00432  { "nodeps", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DEPS,
    00433         N_("don't verify package dependencies"), NULL },
    00434 #else
    00435  { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
    00436         N_("don't verify package dependencies"), NULL },
    00437 #endif
    00438
    00439 #ifdef  DYING
    00440  { "noscript", '\0', POPT_BIT_SET,&rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
    00441         N_("don't execute verify script(s)"), NULL },
    00442  /* XXX legacy had a trailing s on --noscript */
    00443  { "noscripts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00444         &rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
    00445         N_("don't execute verify script(s)"), NULL },
    00446 #else
    00447  { "noscript", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS,
    00448         N_("don't execute verify script(s)"), NULL },
    00449  /* XXX legacy had a trailing s on --noscript */
    00450  { "noscripts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSCRIPTS,
    00451         N_("don't execute verify script(s)"), NULL },
    00452 #endif
    00453
    00454 #ifdef  DYING
    00455  { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
    00456         N_("don't verify package digest(s)"), NULL },
    00457  { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00458         &rpmQVKArgs.qva_flags, VERIFY_HDRCHK,
    00459         N_("don't verify database header(s) when retrieved"), NULL },
    00460  { "nosignature", '\0', POPT_BIT_SET,
    00461         &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
    00462         N_("don't verify package signature(s)"), NULL },
    00463 #else
    00464  { "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NODIGEST,
    00465         N_("don't verify package digest(s)"), NULL },
    00466  { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK,
    00467         N_("don't verify database header(s) when retrieved"), NULL },
    00468  { "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOSIGNATURE,
    00469         N_("don't verify package signature(s)"), NULL },
    00470 #endif
    00471
    00472     POPT_TABLEEND
    00473 };
    00474
    00478 /*@unchecked@*/
    00479 struct poptOption rpmSignPoptTable[] = {
    00480 /*@-type@*/ /* FIX: cast? */
    00481  { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
    00482         rpmQVSourceArgCallback, 0, NULL, NULL },
    00483 /*@=type@*/
    00484  { "addsign", '\0', 0, NULL, 'A',
    00485         N_("sign package(s) (identical to --resign)"), NULL },
    00486  { "checksig", 'K', 0, NULL, 'K',
    00487         N_("verify package signature(s)"), NULL },
    00488  { "delsign", '\0', 0, NULL, 'D',
    00489         N_("delete package signatures"), NULL },
    00490  { "import", '\0', 0, NULL, 'I',
    00491         N_("import an armored public key"), NULL },
    00492  { "resign", '\0', 0, NULL, 'R',
    00493         N_("sign package(s) (identical to --addsign)"), NULL },
    00494  { "sign", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmQVKArgs.sign, 0,
    00495         N_("generate signature"), NULL },
    00496
    00497  { "trust", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0,  POPT_TRUST,
    00498         N_("specify trust metric"), N_("TRUST") },
    00499  { "trusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
    00500         &rpmQVKArgs.trust, 1,
    00501         N_("set ultimate trust when importing pubkey(s)"), NULL },
    00502  { "untrusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
    00503         &rpmQVKArgs.trust, -1,
    00504         N_("unset ultimate trust when importing pubkey(s)"), NULL },
    00505  { "nopassword", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0,  POPT_NOPASSWORD,
    00506         N_("disable password challenge"), NULL },
    00507  /* XXX perhaps POPT_ARG_INT instead of callback. */
    00508
    00509  { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
    00510         N_("don't verify package digest(s)"), NULL },
    00511  { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
    00512         &rpmQVKArgs.qva_flags, VERIFY_HDRCHK,
    00513         N_("don't verify database header(s) when retrieved"), NULL },
    00514  { "nosignature", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
    00515         N_("don't verify package signature(s)"), NULL },
    00516
    00517    POPT_TABLEEND
    00518 };