rpm 5.2.1

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

- File List
- Globals

poptQV.c
Go to the documentation of this file.
1
6 #include "system.h"
7
8 #include <rpmio.h>
9 #include <rpmiotypes.h>
10 #include <rpmcb.h>
11
12 #include <rpmtag.h>
13 #include <rpmcli.h>
14 #include <rpmgi.h> /* XXX for giFlags */
15
16 #include "debug.h"
17
18 /*@unchecked@*/
19 struct rpmQVKArguments_s rpmQVKArgs;
20
21 /*@unchecked@*/
22 int specedit = 0;
23
24 #define POPT_QUERYFORMAT -1000
25 #define POPT_WHATREQUIRES -1001
26 #define POPT_WHATPROVIDES -1002
27 #define POPT_QUERYBYNUMBER -1003
28 #define POPT_TRIGGEREDBY -1004
29 #define POPT_DUMP -1005
30 #define POPT_SPECFILE -1006
31 #define POPT_QUERYBYPKGID -1007
32 #define POPT_QUERYBYHDRID -1008
33 #define POPT_QUERYBYFILEID -1009
34 #define POPT_QUERYBYTID -1010
35 #define POPT_HDLIST -1011
36 #define POPT_FTSWALK -1012
37
38 /* -1025 thrugh -1033 are common in rpmcli.h. */
39 #define POPT_TRUST -1037
40 #define POPT_WHATNEEDS -1038
41 #define POPT_SPECSRPM -1039
42 #define POPT_QUERYBYSOURCEPKGID -1040
43 #define POPT_WHATCONFLICTS -1041
44 #define POPT_WHATOBSOLETES -1042
45 #define POPT_NOPASSWORD -1043
46
47 /* ========== Query/Verify/Signature source args */
48 static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
49 /*@unused@*/ enum poptCallbackReason reason,
50 const struct poptOption * opt,
51 /*@unused@*/ const char * arg,
52 /*@unused@*/ const void * data)
53 /*@globals rpmQVKArgs @*/
54 /*@modifies rpmQVKArgs @*/
55 {
56 QVA_t qva = &rpmQVKArgs;
57
58 switch (opt->val) {
59 case 'q': /* from --query, -q */
60 case 'Q': /* from --querytags (handled by poptALL) */
61 case 'V': /* from --verify, -V */
62 case 'A': /* from --addsign */
63 case 'D': /* from --delsign */
64 case 'I': /* from --import */
65 case 'K': /* from --checksig, -K */
66 case 'R': /* from --resign */
67 if (qva->qva_mode == '\0' || strchr("qQ ", qva->qva_mode)) {
68 qva->qva_mode = opt->val;
69 qva->qva_char = ' ';
70 }
71 break;
72 case 'a': qva->qva_source |= RPMQV_ALL; qva->qva_sourceCount++; break;
73 case 'f': qva->qva_source |= RPMQV_PATH; qva->qva_sourceCount++; break;
74 case 'g': qva->qva_source |= RPMQV_GROUP; qva->qva_sourceCount++; break;
75 case 'p': qva->qva_source |= RPMQV_RPM; qva->qva_sourceCount++; break;
76 case POPT_WHATNEEDS: qva->qva_source |= RPMQV_WHATNEEDS;
77 qva->qva_sourceCount++; break;
78 case POPT_WHATPROVIDES: qva->qva_source |= RPMQV_WHATPROVIDES;
79 qva->qva_sourceCount++; break;
80 case POPT_WHATREQUIRES: qva->qva_source |= RPMQV_WHATREQUIRES;
81 qva->qva_sourceCount++; break;
82 case POPT_WHATCONFLICTS: qva->qva_source |= RPMQV_WHATCONFLICTS;
83 qva->qva_sourceCount++; break;
84 case POPT_WHATOBSOLETES: qva->qva_source |= RPMQV_WHATOBSOLETES;
85 qva->qva_sourceCount++; break;
86 case POPT_TRIGGEREDBY: qva->qva_source |= RPMQV_TRIGGEREDBY;
87 qva->qva_sourceCount++; break;
88 case POPT_QUERYBYSOURCEPKGID: qva->qva_source |= RPMQV_SOURCEPKGID;
89 qva->qva_sourceCount++; break;
90 case POPT_QUERYBYPKGID: qva->qva_source |= RPMQV_PKGID;
91 qva->qva_sourceCount++; break;
92 case POPT_QUERYBYHDRID: qva->qva_source |= RPMQV_HDRID;
93 qva->qva_sourceCount++; break;
94 case POPT_QUERYBYFILEID: qva->qva_source |= RPMQV_FILEID;
95 qva->qva_sourceCount++; break;
96 case POPT_QUERYBYTID: qva->qva_source |= RPMQV_TID;
97 qva->qva_sourceCount++; break;
98 case POPT_HDLIST: qva->qva_source |= RPMQV_HDLIST;
99 qva->qva_sourceCount++; break;
100 case POPT_FTSWALK:qva->qva_source |= RPMQV_FTSWALK;
101 qva->qva_sourceCount++; break;
102
103 /* XXX SPECFILE is not verify sources */
104 case POPT_SPECFILE:
105 qva->qva_source |= RPMQV_SPECFILE;
106 qva->qva_sourceCount++;
107 break;
108 /* XXX SPECSRPM is not verify sources */
109 case POPT_SPECSRPM:
110 qva->qva_source |= RPMQV_SPECSRPM;
111 qva->qva_sourceCount++;
112 break;
113 case POPT_QUERYBYNUMBER:
114 qva->qva_source |= RPMQV_DBOFFSET;
115 qva->qva_sourceCount++;
116 break;
117
118 case POPT_NOPASSWORD:
119 qva->nopassword = 1;
120 break;
121
122 }
123 }
124
128 /*@unchecked@*/
129 struct poptOption rpmQVSourcePoptTable[] = {
130 /*@-type@*/ /* FIX: cast? */
131 { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
132 rpmQVSourceArgCallback, 0, NULL, NULL },
133 /*@=type@*/
134 { "all", 'a', 0, NULL, 'a',
135 N_("query/verify all packages"), NULL },
136 { "checksig", 'K', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'K',
137 N_("rpm checksig mode"), NULL },
138 { "file", 'f', 0, NULL, 'f',
139 N_("query/verify package(s) owning file"), "FILE" },
140 { "group", 'g', 0, NULL, 'g',
141 N_("query/verify package(s) in group"), "GROUP" },
142 { "package", 'p', 0, NULL, 'p',
143 N_("query/verify a package file"), NULL },
144
145 { "ftswalk", 'W', 0, NULL, POPT_FTSWALK,
146 N_("query/verify package(s) from TOP file tree walk"), "TOP" },
147 { "hdlist", 'H', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_HDLIST,
148 N_("query/verify package(s) from system HDLIST"), "HDLIST" },
149
150 { "sourcepkgid", '\0', 0, NULL, POPT_QUERYBYSOURCEPKGID,
151 N_("query/verify package(s) with source package identifier"), "MD5" },
152 { "pkgid", '\0', 0, NULL, POPT_QUERYBYPKGID,
153 N_("query/verify package(s) with package identifier"), "MD5" },
154 { "hdrid", '\0', 0, NULL, POPT_QUERYBYHDRID,
155 N_("query/verify package(s) with header identifier"), "SHA1" },
156 { "fileid", '\0', 0, NULL, POPT_QUERYBYFILEID,
157 N_("query/verify package(s) with file identifier"), "MD5" },
158
159 { "query", 'q', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'q',
160 N_("rpm query mode"), NULL },
161 { "querybynumber", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYNUMBER,
162 N_("query/verify a header instance"), "HDRNUM" },
163 { "specfile", '\0', 0, NULL, POPT_SPECFILE,
164 N_("query a spec file"), N_("<spec>") },
165 { "specsrpm", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_SPECSRPM,
166 N_("query source metadata from spec file parse"), N_("<spec>") },
167 { "tid", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYTID,
168 N_("query/verify package(s) from install transaction"), "TID" },
169 { "triggeredby", '\0', 0, NULL, POPT_TRIGGEREDBY,
170 N_("query the package(s) triggered by the package"), "PACKAGE" },
171 { "verify", 'V', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'V',
172 N_("rpm verify mode"), NULL },
173 { "whatrequires", '\0', 0, NULL, POPT_WHATREQUIRES,
174 N_("query/verify the package(s) which require a dependency"), "CAPABILITY" },
175 { "whatneeds", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_WHATNEEDS,
176 N_("query/verify the package(s) which require any contained provide"),
177 "CAPABILITY" },
178
179 { "whatprovides", '\0', 0, NULL, POPT_WHATPROVIDES,
180 N_("query/verify the package(s) which provide a dependency"), "CAPABILITY" },
181 { "whatconflicts", '\0', 0, NULL, POPT_WHATCONFLICTS,
182 N_("query/verify the package(s) which conflict with a dependency"), "CAPABILITY" },
183 { "whatobsoletes", '\0', 0, NULL, POPT_WHATOBSOLETES,
184 N_("query/verify the package(s) which obsolete a dependency"), "CAPABILITY" },
185
186 { "transaction", 'T', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, (RPMGI_TSADD|RPMGI_TSORDER),
187 N_("create transaction set"), NULL},
188 { "noorder", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_TSORDER,
189 N_("do not order transaction set"), NULL},
190 { "noglob", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOGLOB,
191 N_("do not glob arguments"), NULL},
192 { "nomanifest", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOMANIFEST,
193 N_("do not process non-package files as manifests"), NULL},
194 { "noheader", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOHEADER,
195 N_("do not read headers"), NULL},
196
197
198 POPT_TABLEEND
199 };
200
201 /* ========== Query specific popt args */
202
203 static void queryArgCallback(poptContext con,
204 /*@unused@*/ enum poptCallbackReason reason,
205 const struct poptOption * opt, const char * arg,
206 /*@unused@*/ const void * data)
207 /*@globals rpmQVKArgs @*/
208 /*@modifies con, rpmQVKArgs @*/
209 {
210 QVA_t qva = &rpmQVKArgs;
211
212 /* XXX avoid accidental collisions with POPT_BIT_SET for flags */
213 if (opt->arg == NULL)
214 switch (opt->val) {
215 case 'c': qva->qva_flags |= QUERY_FOR_CONFIG | QUERY_FOR_LIST; break;
216 case 'd': qva->qva_flags |= QUERY_FOR_DOCS | QUERY_FOR_LIST; break;
217 case 'l': qva->qva_flags |= QUERY_FOR_LIST; break;
218 case 's': qva->qva_flags |= QUERY_FOR_STATE | QUERY_FOR_LIST;
219 break;
220 case POPT_DUMP: qva->qva_flags |= QUERY_FOR_DUMPFILES | QUERY_FOR_LIST;
221 break;
222
223 case POPT_QUERYFORMAT:
224 if (arg) {
225 char * qf = (char *)qva->qva_queryFormat;
226 char * b = NULL;
227 size_t nb = 0;
228
229 /* Read queryformat from file. */
230 if (arg[0] == '/') {
231 const char * fn = arg;
232 int rc;
233
234 rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES);
235 if (rc != 0)
236 goto _qfexit;
237 if (b == NULL || nb == 0) /* XXX can't happen */
238 goto _qfexit;
239 /* XXX trim double quotes */
240 if (*b == '"') {
241 while (nb > 0 && b[nb] != '"')
242 b[nb--] = '\0';
243 b[nb] = '\0';
244 arg = b + 1;
245 } else
246 arg = b;
247 }
248
249 /* Append to existing queryformat. */
250 if (qf) {
251 size_t len = strlen(qf) + strlen(arg) + 1;
252 qf = xrealloc(qf, len);
253 strcat(qf, arg);
254 } else {
255 qf = xmalloc(strlen(arg) + 1);
256 strcpy(qf, arg);
257 }
258 qva->qva_queryFormat = qf;
259
260 _qfexit:
261 b = _free(b);
262 }
263 break;
264
265 case 'i':
266 if (qva->qva_mode == 'q') {
267 /*@-nullassign -readonlytrans@*/
268 const char * infoCommand[] = { "--info", NULL };
269 /*@=nullassign =readonlytrans@*/
270 (void) poptStuffArgs(con, infoCommand);
271 }
272 break;
273
274 case RPMCLI_POPT_NODIGEST:
275 qva->qva_flags |= VERIFY_DIGEST;
276 break;
277
278 case RPMCLI_POPT_NOSIGNATURE:
279 qva->qva_flags |= VERIFY_SIGNATURE;
280 break;
281
282 case RPMCLI_POPT_NOHDRCHK:
283 qva->qva_flags |= VERIFY_HDRCHK;
284 break;
285
286 case RPMCLI_POPT_NODEPS:
287 qva->qva_flags |= VERIFY_DEPS;
288 break;
289
290 case RPMCLI_POPT_NOFDIGESTS:
291 qva->qva_flags |= VERIFY_FDIGEST;
292 break;
293
294 case RPMCLI_POPT_NOCONTEXTS:
295 qva->qva_flags |= VERIFY_CONTEXTS;
296 break;
297
298 case RPMCLI_POPT_NOSCRIPTS:
299 qva->qva_flags |= VERIFY_SCRIPT;
300 break;
301
302 /* XXX perhaps POPT_ARG_INT instead of callback. */
303 case POPT_TRUST:
304 { char * end = NULL;
305 long trust = (int) strtol(arg, &end, 0);
306 /* XXX range checks on trust. */
307 /* XXX if (end && *end) argerror(_("non-numeric trust metric.")); */
308 qva->trust = trust;
309 } break;
310 }
311 }
312
316 /*@unchecked@*/
317 struct poptOption rpmQueryPoptTable[] = {
318 /*@-type@*/ /* FIX: cast? */
319 { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
320 queryArgCallback, 0, NULL, NULL },
321 /*@=type@*/
322 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
323 NULL, NULL },
324 { "configfiles", 'c', 0, 0, 'c',
325 N_("list all configuration files"), NULL },
326 { "docfiles", 'd', 0, 0, 'd',
327 N_("list all documentation files"), NULL },
328 { "dump", '\0', 0, 0, POPT_DUMP,
329 N_("dump basic file information"), NULL },
330 { NULL, 'i', POPT_ARGFLAG_DOC_HIDDEN, 0, 'i',
331 NULL, NULL },
332 { "list", 'l', 0, 0, 'l',
333 N_("list files in package"), NULL },
334
335 { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
336 &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS,
337 N_("add suggested packages to transaction"), NULL },
338
339 /* Duplicate file attr flags from packages into command line options. */
340 { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
341 &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG,
342 N_("skip %%config files"), NULL },
343 { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
344 &rpmQVKArgs.qva_fflags, RPMFILE_DOC,
345 N_("skip %%doc files"), NULL },
346 { "noghost", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
347 &rpmQVKArgs.qva_fflags, RPMFILE_GHOST,
348 N_("skip %%ghost files"), NULL },
349 #ifdef NOTEVER /* XXX there's hardly a need for these */
350 { "nolicense", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
351 &rpmQVKArgs.qva_fflags, RPMFILE_LICENSE,
352 N_("skip %%license files"), NULL },
353 { "noreadme", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
354 &rpmQVKArgs.qva_fflags, RPMFILE_README,
355 N_("skip %%readme files"), NULL },
356 #endif
357
358 { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0,
359 POPT_QUERYFORMAT, NULL, NULL },
360 { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT,
361 N_("use the following query format"), N_("QUERYFORMAT") },
362 { "specedit", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &specedit, -1,
363 N_("substitute i18n sections into spec file"), NULL },
364 { "state", 's', 0, 0, 's',
365 N_("display the states of the listed files"), NULL },
366 { "target", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_TARGETPLATFORM,
367 N_("specify target platform"), N_("CPU-VENDOR-OS") },
368 POPT_TABLEEND
369 };
370
374 struct poptOption rpmVerifyPoptTable[] = {
375 /*@-type@*/ /* FIX: cast? */
376 { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
377 queryArgCallback, 0, NULL, NULL },
378 /*@=type@*/
379 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
380 NULL, NULL },
381
382 { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN,
383 &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS,
384 N_("add suggested packages to transaction"), NULL },
385
386 /* Duplicate file attr flags from packages into command line options. */
387 { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
388 &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG,
389 N_("skip %%config files"), NULL },
390 { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
391 &rpmQVKArgs.qva_fflags, RPMFILE_DOC,
392 N_("skip %%doc files"), NULL },
393
394 /* Duplicate file verify flags from packages into command line options. */
396 #ifdef DYING
397 { "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FDIGEST,
398 N_("don't verify file digests"), NULL },
399 #else
400 { "nomd5", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOFDIGESTS,
401 N_("don't verify file digests"), NULL },
402 { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS,
403 N_("don't verify file digests"), NULL },
404 #endif
405 { "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
406 &rpmQVKArgs.qva_flags, VERIFY_SIZE,
407 N_("don't verify size of files"), NULL },
408 { "nolinkto", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
409 &rpmQVKArgs.qva_flags, VERIFY_LINKTO,
410 N_("don't verify symlink path of files"), NULL },
411 { "nouser", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
412 &rpmQVKArgs.qva_flags, VERIFY_USER,
413 N_("don't verify owner of files"), NULL },
414 { "nogroup", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
415 &rpmQVKArgs.qva_flags, VERIFY_GROUP,
416 N_("don't verify group of files"), NULL },
417 { "nomtime", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
418 &rpmQVKArgs.qva_flags, VERIFY_MTIME,
419 N_("don't verify modification time of files"), NULL },
420 { "nomode", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
421 &rpmQVKArgs.qva_flags, VERIFY_MODE,
422 N_("don't verify mode of files"), NULL },
423 { "nordev", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
424 &rpmQVKArgs.qva_flags, VERIFY_RDEV,
425 N_("don't verify mode of files"), NULL },
426
427 { "nocontexts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOCONTEXTS,
428 N_("don't verify file security contexts"), NULL },
429 { "nofiles", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FILES,
430 N_("don't verify files in package"), NULL},
431 #ifdef DYING
432 { "nodeps", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DEPS,
433 N_("don't verify package dependencies"), NULL },
434 #else
435 { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
436 N_("don't verify package dependencies"), NULL },
437 #endif
438
439 #ifdef DYING
440 { "noscript", '\0', POPT_BIT_SET,&rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
441 N_("don't execute verify script(s)"), NULL },
442 /* XXX legacy had a trailing s on --noscript */
443 { "noscripts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
444 &rpmQVKArgs.qva_flags, VERIFY_SCRIPT,
445 N_("don't execute verify script(s)"), NULL },
446 #else
447 { "noscript", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS,
448 N_("don't execute verify script(s)"), NULL },
449 /* XXX legacy had a trailing s on --noscript */
450 { "noscripts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSCRIPTS,
451 N_("don't execute verify script(s)"), NULL },
452 #endif
453
454 #ifdef DYING
455 { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
456 N_("don't verify package digest(s)"), NULL },
457 { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
458 &rpmQVKArgs.qva_flags, VERIFY_HDRCHK,
459 N_("don't verify database header(s) when retrieved"), NULL },
460 { "nosignature", '\0', POPT_BIT_SET,
461 &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
462 N_("don't verify package signature(s)"), NULL },
463 #else
464 { "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NODIGEST,
465 N_("don't verify package digest(s)"), NULL },
466 { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK,
467 N_("don't verify database header(s) when retrieved"), NULL },
468 { "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOSIGNATURE,
469 N_("don't verify package signature(s)"), NULL },
470 #endif
471
472 POPT_TABLEEND
473 };
474
478 /*@unchecked@*/
479 struct poptOption rpmSignPoptTable[] = {
480 /*@-type@*/ /* FIX: cast? */
481 { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
482 rpmQVSourceArgCallback, 0, NULL, NULL },
483 /*@=type@*/
484 { "addsign", '\0', 0, NULL, 'A',
485 N_("sign package(s) (identical to --resign)"), NULL },
486 { "checksig", 'K', 0, NULL, 'K',
487 N_("verify package signature(s)"), NULL },
488 { "delsign", '\0', 0, NULL, 'D',
489 N_("delete package signatures"), NULL },
490 { "import", '\0', 0, NULL, 'I',
491 N_("import an armored public key"), NULL },
492 { "resign", '\0', 0, NULL, 'R',
493 N_("sign package(s) (identical to --addsign)"), NULL },
494 { "sign", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmQVKArgs.sign, 0,
495 N_("generate signature"), NULL },
496
497 { "trust", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_TRUST,
498 N_("specify trust metric"), N_("TRUST") },
499 { "trusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
500 &rpmQVKArgs.trust, 1,
501 N_("set ultimate trust when importing pubkey(s)"), NULL },
502 { "untrusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
503 &rpmQVKArgs.trust, -1,
504 N_("unset ultimate trust when importing pubkey(s)"), NULL },
505 { "nopassword", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NOPASSWORD,
506 N_("disable password challenge"), NULL },
507 /* XXX perhaps POPT_ARG_INT instead of callback. */
508
509 { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
510 N_("don't verify package digest(s)"), NULL },
511 { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
512 &rpmQVKArgs.qva_flags, VERIFY_HDRCHK,
513 N_("don't verify database header(s) when retrieved"), NULL },
514 { "nosignature", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
515 N_("don't verify package signature(s)"), NULL },
516
517 POPT_TABLEEND
518 };