summaryrefslogtreecommitdiff
path: root/doc/librpm/html/rpmqv_8c_source.html
blob: 0d5e43795a9a3fc5334e36e825f493511ac0609c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>rpm: rpmqv.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">rpm&#160;<span id="projectnumber">4.9.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">rpmqv.c</div>  </div>
</div>
<div class="contents">
<a href="rpmqv_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="system_8h.html">system.h</a>&quot;</span>
<a name="l00002"></a><a class="code" href="rpmqv_8c.html#ae44e96c1808be0a56730c26b8b3d2c2a">00002</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="system_8h.html#a41c2f9db0a7e23392fbbebb1d1c185ec">__progname</a>;
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;rpm/rpmcli.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;rpm/rpmlib.h&gt;</span>                 <span class="comment">/* RPMSIGTAG, rpmReadPackageFile .. */</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;rpm/rpmlog.h&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;rpm/rpmps.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;rpm/rpmts.h&gt;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="cliutils_8h.html">cliutils.h</a>&quot;</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="debug_8h.html">debug.h</a>&quot;</span>
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="preprocessor">#if defined(IAM_RPMQ) || defined(IAM_RPMV)</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define IAM_RPMQV</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a><a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6">00018</a> <span class="keyword">enum</span> <a class="code" href="rpmbuild_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6">modes</a> {
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">00020</a>     <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>          = (1 &lt;&lt;  0),
<a name="l00021"></a><a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">00021</a>     <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>         = (1 &lt;&lt;  3),
<a name="l00022"></a><a class="code" href="rpmqv_8c.html#ad6f013daede48edb0ac10e4de4080f28">00022</a> <span class="preprocessor">#define MODES_QV (MODE_QUERY | MODE_VERIFY)</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024     MODE_INSTALL        = (1 &lt;&lt;  1),
<a name="l00025"></a>00025     MODE_ERASE          = (1 &lt;&lt;  2),
<a name="l00026"></a><a class="code" href="rpmqv_8c.html#a6d5174de1767038bab2087346d21e05c">00026</a> <span class="preprocessor">#define MODES_IE (MODE_INSTALL | MODE_ERASE)</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028     <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a>        = 0
<a name="l00029"></a>00029 };
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="rpmqv_8c.html#a0301d10fe036ac21c7929d09669f4878">00031</a> <span class="preprocessor">#define MODES_FOR_NODEPS        (MODES_IE | MODE_VERIFY)</span>
<a name="l00032"></a><a class="code" href="rpmqv_8c.html#a05fec941df6d373a436494886188bdc6">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define MODES_FOR_TEST          (MODES_IE)</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a><a class="code" href="rpmqv_8c.html#a55602ca214fb365e8deef9a73c8442e7">00034</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="rpmqv_8c.html#a55602ca214fb365e8deef9a73c8442e7">quiet</a>;
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">/* the structure describing the options we take and the defaults */</span>
<a name="l00037"></a><a class="code" href="rpmqv_8c.html#a779c8fb41edee9b03a02a249606b0e76">00037</a> <span class="keyword">static</span> <span class="keyword">struct </span>poptOption <a class="code" href="rpmqv_8c.html#a779c8fb41edee9b03a02a249606b0e76">optionsTable</a>[] = {
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="preprocessor">#ifdef  IAM_RPMQV</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span> { NULL, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARG_INCLUDE_TABLE, <a class="code" href="group__rpmcli.html#ga82516d1b4448ed3ae34ff857c8c4bc61">rpmQVSourcePoptTable</a>, 0,
<a name="l00041"></a>00041         <a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">N_</a>(<span class="stringliteral">&quot;Query/Verify package selection options:&quot;</span>),
<a name="l00042"></a>00042         NULL },
<a name="l00043"></a>00043 <span class="preprocessor">#endif</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#ifdef IAM_RPMQ</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span> { NULL, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARG_INCLUDE_TABLE, <a class="code" href="group__rpmcli.html#gaf76f120f06fed0a07c9aac2fbbb6575b">rpmQueryPoptTable</a>, 0,
<a name="l00046"></a>00046         <a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">N_</a>(<span class="stringliteral">&quot;Query options (with -q or --query):&quot;</span>),
<a name="l00047"></a>00047         NULL },
<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#ifdef IAM_RPMV</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span> { NULL, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARG_INCLUDE_TABLE, <a class="code" href="group__rpmcli.html#gaccd88fbe9f5bf0a7d6e76887b73f1b8e">rpmVerifyPoptTable</a>, 0,
<a name="l00051"></a>00051         <a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">N_</a>(<span class="stringliteral">&quot;Verify options (with -V or --verify):&quot;</span>),
<a name="l00052"></a>00052         NULL },
<a name="l00053"></a>00053 <span class="preprocessor">#endif</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a>00055 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span> { NULL, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARG_INCLUDE_TABLE, <a class="code" href="group__rpmcli.html#ga9ca5cf6719890041523419268a4d38ee">rpmInstallPoptTable</a>, 0,
<a name="l00057"></a>00057         <a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">N_</a>(<span class="stringliteral">&quot;Install/Upgrade/Erase options:&quot;</span>),
<a name="l00058"></a>00058         NULL },
<a name="l00059"></a>00059 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMEIU */</span>
<a name="l00060"></a>00060 
<a name="l00061"></a>00061  { <span class="stringliteral">&quot;quiet&quot;</span>, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARGFLAG_DOC_HIDDEN, &amp;<a class="code" href="rpmqv_8c.html#a55602ca214fb365e8deef9a73c8442e7">quiet</a>, 0, NULL, NULL},
<a name="l00062"></a>00062 
<a name="l00063"></a>00063  { NULL, <span class="charliteral">&#39;\0&#39;</span>, POPT_ARG_INCLUDE_TABLE, <a class="code" href="group__rpmcli.html#ga60bd8b746df91eb1824a7ad6ffd42cf1" title="Popt option table for options shared by all modes and executables.">rpmcliAllPoptTable</a>, 0,
<a name="l00064"></a>00064         <a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">N_</a>(<span class="stringliteral">&quot;Common options for all rpm modes and executables:&quot;</span>),
<a name="l00065"></a>00065         NULL },
<a name="l00066"></a>00066 
<a name="l00067"></a>00067    POPT_AUTOALIAS
<a name="l00068"></a>00068    POPT_AUTOHELP
<a name="l00069"></a>00069    POPT_TABLEEND
<a name="l00070"></a>00070 };
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="rpmqv_8c.html#a0ddf1224851353fc92bfbff6f499fa97">00072</a> <span class="keywordtype">int</span> <a class="code" href="rpm2cpio_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])
<a name="l00073"></a>00073 {
<a name="l00074"></a>00074     <a class="code" href="group__rpmtypes.html#ga1a512138316a227059ca128597dbd464" title="The main types involved in transaction manipulation.">rpmts</a> ts = NULL;
<a name="l00075"></a>00075     <span class="keyword">enum</span> <a class="code" href="rpmbuild_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6">modes</a> bigMode = <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a>;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 <span class="preprocessor">#if defined(IAM_RPMQV)</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>    <a class="code" href="structrpmQVKArguments__s.html" title="Describe query/verify/signature command line operation.">QVA_t</a> qva = &amp;<a class="code" href="group__rpmcli.html#ga4a1bca7dab71cf6485b7665bcd8ec741">rpmQVKArgs</a>;
<a name="l00079"></a>00079 <span class="preprocessor">#endif</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>
<a name="l00081"></a>00081 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>   <span class="keyword">struct </span><a class="code" href="structrpmInstallArguments__s.html" title="Describe database command line requests.">rpmInstallArguments_s</a> * ia = &amp;<a class="code" href="group__rpmcli.html#ga056fe396700d98060891a04e7a12706d">rpmIArgs</a>;
<a name="l00083"></a>00083 <span class="preprocessor">#endif</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00085"></a>00085     poptContext optCon;
<a name="l00086"></a>00086     <span class="keywordtype">int</span> ec = 0;
<a name="l00087"></a>00087 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span>    <span class="keywordtype">int</span> i;
<a name="l00089"></a>00089 <span class="preprocessor">#endif</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span>
<a name="l00091"></a>00091     optCon = <a class="code" href="group__rpmcli.html#gaf4d555b4c5efcf319fe643d164775eaf" title="Initialize most everything needed by an rpm CLI executable context.">rpmcliInit</a>(argc, argv, optionsTable);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093     <span class="comment">/* Set the major mode based on argv[0] */</span>
<a name="l00094"></a>00094 <span class="preprocessor">#ifdef  IAM_RPMQV</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (<a class="code" href="rpmstring_8h.html#a1e5f8ebc49cc189053eb455e500d7e00" title="Test for string equality.">rstreq</a>(<a class="code" href="system_8h.html#a41c2f9db0a7e23392fbbebb1d1c185ec">__progname</a>, <span class="stringliteral">&quot;rpmquery&quot;</span>)) bigMode = <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>;
<a name="l00096"></a>00096     <span class="keywordflow">if</span> (<a class="code" href="rpmstring_8h.html#a1e5f8ebc49cc189053eb455e500d7e00" title="Test for string equality.">rstreq</a>(<a class="code" href="system_8h.html#a41c2f9db0a7e23392fbbebb1d1c185ec">__progname</a>, <span class="stringliteral">&quot;rpmverify&quot;</span>)) bigMode = <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>;
<a name="l00097"></a>00097 <span class="preprocessor">#endif</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>
<a name="l00099"></a>00099 <span class="preprocessor">#if defined(IAM_RPMQV)</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>    <span class="comment">/* Jumpstart option from argv[0] if necessary. */</span>
<a name="l00101"></a>00101     <span class="keywordflow">switch</span> (bigMode) {
<a name="l00102"></a>00102     <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>:    qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a0c581f555e9ab71fb10b1db3ab6a73a8">qva_mode</a> = <span class="charliteral">&#39;q&#39;</span>;    <span class="keywordflow">break</span>;
<a name="l00103"></a>00103     <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>:   qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a0c581f555e9ab71fb10b1db3ab6a73a8">qva_mode</a> = <span class="charliteral">&#39;V&#39;</span>;    <span class="keywordflow">break</span>;
<a name="l00104"></a>00104     <span class="keywordflow">case</span> MODE_INSTALL:
<a name="l00105"></a>00105     <span class="keywordflow">case</span> MODE_ERASE:
<a name="l00106"></a>00106     <span class="keywordflow">case</span> <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a>:
<a name="l00107"></a>00107     <span class="keywordflow">default</span>:
<a name="l00108"></a>00108         <span class="keywordflow">break</span>;
<a name="l00109"></a>00109     }
<a name="l00110"></a>00110 <span class="preprocessor">#endif</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span>
<a name="l00112"></a>00112 <span class="preprocessor">#ifdef  IAM_RPMQV</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span>  <span class="keywordflow">if</span> (bigMode == <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a> || (bigMode &amp; <a class="code" href="rpmqv_8c.html#ad6f013daede48edb0ac10e4de4080f28">MODES_QV</a>)) {
<a name="l00114"></a>00114     <span class="keywordflow">switch</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a0c581f555e9ab71fb10b1db3ab6a73a8">qva_mode</a>) {
<a name="l00115"></a>00115     <span class="keywordflow">case</span> <span class="charliteral">&#39;q&#39;</span>:   bigMode = <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>;           <span class="keywordflow">break</span>;
<a name="l00116"></a>00116     <span class="keywordflow">case</span> <span class="charliteral">&#39;V&#39;</span>:   bigMode = <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>;          <span class="keywordflow">break</span>;
<a name="l00117"></a>00117     }
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     <span class="keywordflow">if</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a6a629aa49ace28df6c6e2ffb6197ab45">qva_sourceCount</a>) {
<a name="l00120"></a>00120         <span class="keywordflow">if</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a6a629aa49ace28df6c6e2ffb6197ab45">qva_sourceCount</a> &gt; 1)
<a name="l00121"></a>00121             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;one type of query/verify may be performed at a &quot;</span>
<a name="l00122"></a>00122                         <span class="stringliteral">&quot;time&quot;</span>));
<a name="l00123"></a>00123     }
<a name="l00124"></a>00124     <span class="keywordflow">if</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a70e3964c63e618f1a3a92b07d60db712">qva_flags</a> &amp;&amp; (bigMode &amp; ~MODES_QV)) 
<a name="l00125"></a>00125         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;unexpected query flags&quot;</span>));
<a name="l00126"></a>00126 
<a name="l00127"></a>00127     <span class="keywordflow">if</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a5da426be3eafe4553aef972d4ce010e1">qva_queryFormat</a> &amp;&amp; (bigMode &amp; ~MODES_QV)) 
<a name="l00128"></a>00128         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;unexpected query format&quot;</span>));
<a name="l00129"></a>00129 
<a name="l00130"></a>00130     <span class="keywordflow">if</span> (qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#ad62ab6b0e7a75e065b3bd647f36e4c88">qva_source</a> != <a class="code" href="group__rpmcli.html#ggacd3922fd981998d572e1973273e355dda650f033171456bdff9d046caf07c85ab">RPMQV_PACKAGE</a> &amp;&amp; (bigMode &amp; ~MODES_QV)) 
<a name="l00131"></a>00131         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;unexpected query source&quot;</span>));
<a name="l00132"></a>00132   }
<a name="l00133"></a>00133 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMQV */</span>
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span>  <span class="keywordflow">if</span> (bigMode == <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a> || (bigMode &amp; <a class="code" href="rpmqv_8c.html#a6d5174de1767038bab2087346d21e05c">MODES_IE</a>))
<a name="l00137"></a>00137     {   <span class="keywordtype">int</span> iflags = (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> &amp;
<a name="l00138"></a>00138                 (<a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a23a71334e16ee8445b6d3ac255784d96">INSTALL_UPGRADE</a>|<a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a0d15623e73b7cda30d805a36b3a5f391">INSTALL_FRESHEN</a>|<a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a3cd38867a19e668167d82857de30c2e3">INSTALL_INSTALL</a>));
<a name="l00139"></a>00139         <span class="keywordtype">int</span> eflags = (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> &amp; <a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a9b9cb3371388c1c32061cd9003cf04d4">INSTALL_ERASE</a>);
<a name="l00140"></a>00140 
<a name="l00141"></a>00141         <span class="keywordflow">if</span> (iflags &amp; eflags)
<a name="l00142"></a>00142             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;only one major mode may be specified&quot;</span>));
<a name="l00143"></a>00143         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iflags)
<a name="l00144"></a>00144             bigMode = MODE_INSTALL;
<a name="l00145"></a>00145         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (eflags)
<a name="l00146"></a>00146             bigMode = MODE_ERASE;
<a name="l00147"></a>00147     }
<a name="l00148"></a>00148 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMEIU */</span>
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 <span class="preprocessor">#if defined(IAM_RPMEIU)</span>
<a name="l00151"></a>00151 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (!( bigMode == MODE_INSTALL ) &amp;&amp;
<a name="l00152"></a>00152 (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; (<a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65eac284ea14b5b06e684714d6e57243f6b7">RPMPROB_FILTER_REPLACEPKG</a> | <a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65eab25146a99597dde163b18b809b1bc7c2">RPMPROB_FILTER_OLDPACKAGE</a>)))
<a name="l00153"></a>00153         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;only installation and upgrading may be forced&quot;</span>));
<a name="l00154"></a>00154     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; <a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65ea4a27dc1f6d61df96497dc5e47d9d7280">RPMPROB_FILTER_FORCERELOCATE</a>))
<a name="l00155"></a>00155         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;files may only be relocated during package installation&quot;</span>));
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a> &amp;&amp; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a>)
<a name="l00158"></a>00158         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;cannot use --prefix with --relocate or --excludepath&quot;</span>));
<a name="l00159"></a>00159 
<a name="l00160"></a>00160     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>)
<a name="l00161"></a>00161         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--relocate and --excludepath may only be used when installing new packages&quot;</span>));
<a name="l00162"></a>00162 
<a name="l00163"></a>00163     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a>)
<a name="l00164"></a>00164         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--prefix may only be used when installing new packages&quot;</span>));
<a name="l00165"></a>00165 
<a name="l00166"></a>00166     <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a> &amp;&amp; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a>[0] != <span class="charliteral">&#39;/&#39;</span>) 
<a name="l00167"></a>00167         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;arguments to --prefix must begin with a /&quot;</span>));
<a name="l00168"></a>00168 
<a name="l00169"></a>00169     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> &amp; <a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a6b76eaf97826abc1a5f709f8e68069d9">INSTALL_HASH</a>))
<a name="l00170"></a>00170         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--hash (-h) may only be specified during package &quot;</span>
<a name="l00171"></a>00171                         <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00172"></a>00172 
<a name="l00173"></a>00173     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> &amp; <a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a964ed79f961bd3c93e3244f690165aad">INSTALL_PERCENT</a>))
<a name="l00174"></a>00174         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--percent may only be specified during package &quot;</span>
<a name="l00175"></a>00175                         <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00176"></a>00176 
<a name="l00177"></a>00177     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; <a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65eac284ea14b5b06e684714d6e57243f6b7">RPMPROB_FILTER_REPLACEPKG</a>))
<a name="l00178"></a>00178         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--replacepkgs may only be specified during package &quot;</span>
<a name="l00179"></a>00179                         <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00180"></a>00180 
<a name="l00181"></a>00181     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a8a55235b4c4fcbf0f39517a97b4107e1">RPMTRANS_FLAG_NODOCS</a>))
<a name="l00182"></a>00182         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--excludedocs may only be specified during package &quot;</span>
<a name="l00183"></a>00183                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00184"></a>00184 
<a name="l00185"></a>00185     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a7207639a0b2379a99ee8a88147046093">incldocs</a>)
<a name="l00186"></a>00186         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--includedocs may only be specified during package &quot;</span>
<a name="l00187"></a>00187                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a7207639a0b2379a99ee8a88147046093">incldocs</a> &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a8a55235b4c4fcbf0f39517a97b4107e1">RPMTRANS_FLAG_NODOCS</a>))
<a name="l00190"></a>00190         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;only one of --excludedocs and --includedocs may be &quot;</span>
<a name="l00191"></a>00191                  <span class="stringliteral">&quot;specified&quot;</span>));
<a name="l00192"></a>00192   
<a name="l00193"></a>00193     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; <a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65ea473feeaed4eee05ed944809afb222fd0">RPMPROB_FILTER_IGNOREARCH</a>))
<a name="l00194"></a>00194         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--ignorearch may only be specified during package &quot;</span>
<a name="l00195"></a>00195                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00196"></a>00196 
<a name="l00197"></a>00197     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; <a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65eae1fa81b650298dc09197bd322590d976">RPMPROB_FILTER_IGNOREOS</a>))
<a name="l00198"></a>00198         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--ignoreos may only be specified during package &quot;</span>
<a name="l00199"></a>00199                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00200"></a>00200 
<a name="l00201"></a>00201     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; bigMode != MODE_ERASE &amp;&amp;
<a name="l00202"></a>00202         (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a9872d34098f8ac77f1283163bacbcebe">probFilter</a> &amp; (<a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65ea6fdea588481ca5b252cede0174c973f0">RPMPROB_FILTER_DISKSPACE</a>|<a class="code" href="group__rpmprob.html#ggab4ea02ce77eec78f106088cbccd9b65eabba79c40a2f5ac37738c2f9deda26aa1">RPMPROB_FILTER_DISKNODES</a>)))
<a name="l00203"></a>00203         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--ignoresize may only be specified during package &quot;</span>
<a name="l00204"></a>00204                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00205"></a>00205 
<a name="l00206"></a>00206     <span class="keywordflow">if</span> ((ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> &amp; <a class="code" href="group__rpmcli.html#ga1c1bda5bf2ab8a523555bc2cfb59c08c">UNINSTALL_ALLMATCHES</a>) &amp;&amp; bigMode != MODE_ERASE)
<a name="l00207"></a>00207         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--allmatches may only be specified during package &quot;</span>
<a name="l00208"></a>00208                    <span class="stringliteral">&quot;erasure&quot;</span>));
<a name="l00209"></a>00209 
<a name="l00210"></a>00210     <span class="keywordflow">if</span> ((ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4aa64d5e599c417d2d344bb171b41808c6">RPMTRANS_FLAG_ALLFILES</a>) &amp;&amp; bigMode != MODE_INSTALL)
<a name="l00211"></a>00211         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--allfiles may only be specified during package &quot;</span>
<a name="l00212"></a>00212                    <span class="stringliteral">&quot;installation&quot;</span>));
<a name="l00213"></a>00213 
<a name="l00214"></a>00214     <span class="keywordflow">if</span> ((ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a7ef9385f5ecbc714a81aa2fe228f5bca">RPMTRANS_FLAG_JUSTDB</a>) &amp;&amp;
<a name="l00215"></a>00215         bigMode != MODE_INSTALL &amp;&amp; bigMode != MODE_ERASE)
<a name="l00216"></a>00216         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--justdb may only be specified during package &quot;</span>
<a name="l00217"></a>00217                    <span class="stringliteral">&quot;installation and erasure&quot;</span>));
<a name="l00218"></a>00218 
<a name="l00219"></a>00219     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; bigMode != MODE_ERASE &amp;&amp; bigMode != <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a> &amp;&amp;
<a name="l00220"></a>00220         (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; (<a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a6988ca89fe9d797c4ed54838dd39239f">RPMTRANS_FLAG_NOSCRIPTS</a> | <a class="code" href="rpmts_8h.html#a41f277cf4b48e9bdac114680f75ff656">_noTransScripts</a> | <a class="code" href="rpmts_8h.html#a5efbe38f57359f2c0aaae3362eea1941">_noTransTriggers</a>)))
<a name="l00221"></a>00221         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;script disabling options may only be specified during &quot;</span>
<a name="l00222"></a>00222                    <span class="stringliteral">&quot;package installation and erasure&quot;</span>));
<a name="l00223"></a>00223 
<a name="l00224"></a>00224     <span class="keywordflow">if</span> (bigMode != MODE_INSTALL &amp;&amp; bigMode != MODE_ERASE &amp;&amp; bigMode != <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a> &amp;&amp;
<a name="l00225"></a>00225         (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; (<a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4aa099d815220def1f9f839ca7b416e726">RPMTRANS_FLAG_NOTRIGGERS</a> | <a class="code" href="rpmts_8h.html#a5efbe38f57359f2c0aaae3362eea1941">_noTransTriggers</a>)))
<a name="l00226"></a>00226         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;trigger disabling options may only be specified during &quot;</span>
<a name="l00227"></a>00227                    <span class="stringliteral">&quot;package installation and erasure&quot;</span>));
<a name="l00228"></a>00228 
<a name="l00229"></a>00229     <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#aba8a56b0ac9a63e5d2070113f9d97f90">noDeps</a> &amp; (bigMode &amp; ~<a class="code" href="rpmqv_8c.html#a0301d10fe036ac21c7929d09669f4878">MODES_FOR_NODEPS</a>))
<a name="l00230"></a>00230         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--nodeps may only be specified during package &quot;</span>
<a name="l00231"></a>00231                    <span class="stringliteral">&quot;installation, erasure, and verification&quot;</span>));
<a name="l00232"></a>00232 
<a name="l00233"></a>00233     <span class="keywordflow">if</span> ((ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4aae4f59c5196be0e44be7e0f6cd4e8c6e">RPMTRANS_FLAG_TEST</a>) &amp;&amp; (bigMode &amp; ~<a class="code" href="rpmqv_8c.html#a05fec941df6d373a436494886188bdc6">MODES_FOR_TEST</a>))
<a name="l00234"></a>00234         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;--test may only be specified during package installation &quot;</span>
<a name="l00235"></a>00235                  <span class="stringliteral">&quot;and erasure&quot;</span>));
<a name="l00236"></a>00236 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMEIU */</span>
<a name="l00237"></a>00237 
<a name="l00238"></a>00238     <span class="keywordflow">if</span> (<a class="code" href="rpmcli_8h.html#a4a1b016e2d7aaea6937155c21c87a215">rpmcliRootDir</a> &amp;&amp; <a class="code" href="rpmcli_8h.html#a4a1b016e2d7aaea6937155c21c87a215">rpmcliRootDir</a>[0] != <span class="charliteral">&#39;/&#39;</span>) {
<a name="l00239"></a>00239         <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;arguments to --root (-r) must begin with a /&quot;</span>));
<a name="l00240"></a>00240     }
<a name="l00241"></a>00241 
<a name="l00242"></a>00242     <span class="keywordflow">if</span> (quiet)
<a name="l00243"></a>00243         <a class="code" href="rpmlog_8h.html#a8aba89fad1a508955abd6f203ad0a4fc">rpmSetVerbosity</a>(<a class="code" href="group__rpmlog.html#ggacd0c489c508a24a73b39565aaa2658c3a4a8bda88dc45c358f1346b40522ba9f4">RPMLOG_WARNING</a>);
<a name="l00244"></a>00244 
<a name="l00245"></a>00245     <span class="keywordflow">if</span> (<a class="code" href="rpmcli_8h.html#a2f2a17a4befac63f642cca0446d6c302">rpmcliPipeOutput</a> &amp;&amp; <a class="code" href="cliutils_8c.html#acec5fcb5d4ee91d35ef026942f58a218">initPipe</a>())
<a name="l00246"></a>00246         exit(EXIT_FAILURE);
<a name="l00247"></a>00247         
<a name="l00248"></a>00248     ts = <a class="code" href="group__rpmts.html#gace47f4eaebd8be4f0abbcfb7942b3566" title="Create an empty transaction set.">rpmtsCreate</a>();
<a name="l00249"></a>00249     (void) <a class="code" href="group__rpmts.html#ga2cc54aa978a49d0b5cefa64095c8ee41" title="Set transaction rootDir, i.e.">rpmtsSetRootDir</a>(ts, <a class="code" href="rpmcli_8h.html#a4a1b016e2d7aaea6937155c21c87a215">rpmcliRootDir</a>);
<a name="l00250"></a>00250     <span class="keywordflow">switch</span> (bigMode) {
<a name="l00251"></a>00251 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00252"></a>00252 <span class="preprocessor"></span>    <span class="keywordflow">case</span> MODE_ERASE:
<a name="l00253"></a>00253         <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#aba8a56b0ac9a63e5d2070113f9d97f90">noDeps</a>) ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> |= <a class="code" href="group__rpmcli.html#gadf32289fe336bef9d75cc270cea6b4bb">UNINSTALL_NODEPS</a>;
<a name="l00254"></a>00254 
<a name="l00255"></a>00255         <span class="keywordflow">if</span> (!poptPeekArg(optCon)) {
<a name="l00256"></a>00256             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;no packages given for erase&quot;</span>));
<a name="l00257"></a>00257         } <span class="keywordflow">else</span> {
<a name="l00258"></a>00258             ec += <a class="code" href="group__rpmcli.html#gac7a1785e1b24753491fa5fd15c43ff33" title="Erase binary rpm package.">rpmErase</a>(ts, ia, (<a class="code" href="argv_8h.html#a6c416352f01820f9a95d3d9cc21e93e9">ARGV_const_t</a>) poptGetArgs(optCon));
<a name="l00259"></a>00259         }
<a name="l00260"></a>00260         <span class="keywordflow">break</span>;
<a name="l00261"></a>00261 
<a name="l00262"></a>00262     <span class="keywordflow">case</span> MODE_INSTALL:
<a name="l00263"></a>00263 
<a name="l00264"></a>00264         <span class="comment">/* RPMTRANS_FLAG_KEEPOBSOLETE */</span>
<a name="l00265"></a>00265 
<a name="l00266"></a>00266         <span class="keywordflow">if</span> (!ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a7207639a0b2379a99ee8a88147046093">incldocs</a>) {
<a name="l00267"></a>00267             <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> &amp; <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a8a55235b4c4fcbf0f39517a97b4107e1">RPMTRANS_FLAG_NODOCS</a>) {
<a name="l00268"></a>00268                 ;
<a name="l00269"></a>00269             } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="group__rpmmacro.html#ga4bb017f52f3bd9b8aae77772b0bc9ba8" title="Return macro expansion as a numeric value.">rpmExpandNumeric</a>(<span class="stringliteral">&quot;%{_excludedocs}&quot;</span>))
<a name="l00270"></a>00270                 ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab9e93faf03e530ad24c4e71d2c4cb204">transFlags</a> |= <a class="code" href="group__rpmts.html#ggaca72ece8019aa198fc445bd206caa3f4a8a55235b4c4fcbf0f39517a97b4107e1">RPMTRANS_FLAG_NODOCS</a>;
<a name="l00271"></a>00271         }
<a name="l00272"></a>00272 
<a name="l00273"></a>00273         <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#aba8a56b0ac9a63e5d2070113f9d97f90">noDeps</a>) ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a6737db6d359eeb20f8b25040d26833f7">installInterfaceFlags</a> |= <a class="code" href="group__rpmcli.html#gga7a2b8a2c2dbfe8cf05091d3eb8a5e691a213ef7793e9264c29267a63a3f31a902">INSTALL_NODEPS</a>;
<a name="l00274"></a>00274 
<a name="l00275"></a>00275         <span class="comment">/* we&#39;ve already ensured !(!ia-&gt;prefix &amp;&amp; !ia-&gt;relocations) */</span>
<a name="l00276"></a>00276         <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a>) {
<a name="l00277"></a>00277             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a> = <a class="code" href="system_8h.html#a4213b2ad4e4e16d946a377f6684fb364">xmalloc</a>(2 * <span class="keyword">sizeof</span>(*ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>));
<a name="l00278"></a>00278             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[0].<a class="code" href="structrpmRelocation__s.html#a945f7f53153cf221e5692d74df8f5efb">oldPath</a> = NULL;   <span class="comment">/* special case magic */</span>
<a name="l00279"></a>00279             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[0].<a class="code" href="structrpmRelocation__s.html#a9c96e456f9c1b75a40a9a6c8e27506aa">newPath</a> = ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#ab86665a689af0a4d2002904cfe550134">prefix</a>;
<a name="l00280"></a>00280             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[1].<a class="code" href="structrpmRelocation__s.html#a945f7f53153cf221e5692d74df8f5efb">oldPath</a> = NULL;
<a name="l00281"></a>00281             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[1].<a class="code" href="structrpmRelocation__s.html#a9c96e456f9c1b75a40a9a6c8e27506aa">newPath</a> = NULL;
<a name="l00282"></a>00282         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>) {
<a name="l00283"></a>00283             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a> = <a class="code" href="system_8h.html#abd7a1ba91b6b968b64639bb0149a69e5">xrealloc</a>(ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>, 
<a name="l00284"></a>00284                         <span class="keyword">sizeof</span>(*ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>) * (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a364d2204b05fb3c896b6b6211894cbf4">numRelocations</a> + 1));
<a name="l00285"></a>00285             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a364d2204b05fb3c896b6b6211894cbf4">numRelocations</a>].<a class="code" href="structrpmRelocation__s.html#a945f7f53153cf221e5692d74df8f5efb">oldPath</a> = NULL;
<a name="l00286"></a>00286             ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a364d2204b05fb3c896b6b6211894cbf4">numRelocations</a>].<a class="code" href="structrpmRelocation__s.html#a9c96e456f9c1b75a40a9a6c8e27506aa">newPath</a> = NULL;
<a name="l00287"></a>00287         }
<a name="l00288"></a>00288 
<a name="l00289"></a>00289         <span class="keywordflow">if</span> (!poptPeekArg(optCon)) {
<a name="l00290"></a>00290             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;no packages given for install&quot;</span>));
<a name="l00291"></a>00291         } <span class="keywordflow">else</span> {
<a name="l00292"></a>00292             <span class="comment">/* FIX: ia-&gt;relocations[0].newPath undefined */</span>
<a name="l00293"></a>00293             ec += <a class="code" href="group__rpmcli.html#ga276748bd64f3ecaa06d09d4eeb0718c7" title="Install/upgrade/freshen binary rpm package.">rpmInstall</a>(ts, ia, (<a class="code" href="argv_8h.html#a4628d0ccf538438d6ef2795aeebd7e31">ARGV_t</a>) poptGetArgs(optCon));
<a name="l00294"></a>00294         }
<a name="l00295"></a>00295         <span class="keywordflow">break</span>;
<a name="l00296"></a>00296 
<a name="l00297"></a>00297 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMEIU */</span>
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 <span class="preprocessor">#ifdef  IAM_RPMQV</span>
<a name="l00300"></a>00300 <span class="preprocessor"></span>    <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>:
<a name="l00301"></a>00301         <span class="keywordflow">if</span> (!poptPeekArg(optCon) &amp;&amp; !(qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#ad62ab6b0e7a75e065b3bd647f36e4c88">qva_source</a> == <a class="code" href="group__rpmcli.html#ggacd3922fd981998d572e1973273e355dda4765b243cb435f41722c5fe53d03da62">RPMQV_ALL</a>))
<a name="l00302"></a>00302             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;no arguments given for query&quot;</span>));
<a name="l00303"></a>00303 
<a name="l00304"></a>00304         ec = <a class="code" href="group__rpmcli.html#ga2dbfa3886628a79646b2c286ea5c56d9" title="Display package information.">rpmcliQuery</a>(ts, qva, (<a class="code" href="argv_8h.html#a6c416352f01820f9a95d3d9cc21e93e9">ARGV_const_t</a>) poptGetArgs(optCon));
<a name="l00305"></a>00305         <span class="keywordflow">break</span>;
<a name="l00306"></a>00306 
<a name="l00307"></a>00307     <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>:
<a name="l00308"></a>00308     {   <a class="code" href="rpmvf_8h.html#aca944e7ab106a92cc3da05515facacdc">rpmVerifyFlags</a> verifyFlags = <a class="code" href="rpmvf_8h.html#a62cf0189172e77e77d74993c51bc0842">VERIFY_ALL</a>;
<a name="l00309"></a>00309 
<a name="l00310"></a>00310         verifyFlags &amp;= ~qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a70e3964c63e618f1a3a92b07d60db712">qva_flags</a>;
<a name="l00311"></a>00311         qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a70e3964c63e618f1a3a92b07d60db712">qva_flags</a> = (<a class="code" href="rpmcli_8h.html#a1430ab595c8699e159fa4284d0fbaf59">rpmQueryFlags</a>) verifyFlags;
<a name="l00312"></a>00312 
<a name="l00313"></a>00313         <span class="keywordflow">if</span> (!poptPeekArg(optCon) &amp;&amp; !(qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#ad62ab6b0e7a75e065b3bd647f36e4c88">qva_source</a> == <a class="code" href="group__rpmcli.html#ggacd3922fd981998d572e1973273e355dda4765b243cb435f41722c5fe53d03da62">RPMQV_ALL</a>))
<a name="l00314"></a>00314             <a class="code" href="cliutils_8c.html#a04b3e702e4cded860c0e1c9bb6f104ed">argerror</a>(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">&quot;no arguments given for verify&quot;</span>));
<a name="l00315"></a>00315         ec = <a class="code" href="group__rpmcli.html#gacd811a9348f4d2408f1fcc55fb0e91b8" title="Verify package install.">rpmcliVerify</a>(ts, qva, (<a class="code" href="argv_8h.html#a6c416352f01820f9a95d3d9cc21e93e9">ARGV_const_t</a>) poptGetArgs(optCon));
<a name="l00316"></a>00316     }   <span class="keywordflow">break</span>;
<a name="l00317"></a>00317 <span class="preprocessor">#endif  </span><span class="comment">/* IAM_RPMQV */</span>
<a name="l00318"></a>00318 
<a name="l00319"></a>00319 <span class="preprocessor">#if !defined(IAM_RPMQV)</span>
<a name="l00320"></a>00320 <span class="preprocessor"></span>    <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6aa6891a524a00c9093e6ade13f42f20cc">MODE_QUERY</a>:
<a name="l00321"></a>00321     <span class="keywordflow">case</span> <a class="code" href="rpmqv_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6a8afb36000e3c9ee8064dff47cdc34d9f">MODE_VERIFY</a>:
<a name="l00322"></a>00322 <span class="preprocessor">#endif</span>
<a name="l00323"></a>00323 <span class="preprocessor"></span><span class="preprocessor">#if !defined(IAM_RPMEIU)</span>
<a name="l00324"></a>00324 <span class="preprocessor"></span>    <span class="keywordflow">case</span> MODE_INSTALL:
<a name="l00325"></a>00325     <span class="keywordflow">case</span> MODE_ERASE:
<a name="l00326"></a>00326 <span class="preprocessor">#endif</span>
<a name="l00327"></a>00327 <span class="preprocessor"></span>    <span class="keywordflow">case</span> <a class="code" href="rpmspec_8c.html#a811fe196a5d9d37857c2f8adeeaac3c6ad34eac71f48c80a1ff29750151a0187b">MODE_UNKNOWN</a>:
<a name="l00328"></a>00328         <span class="keywordflow">if</span> (poptPeekArg(optCon) != NULL || argc &lt;= 1 || <a class="code" href="rpmlog_8h.html#a16d38257a060a06fe95122f8fa5bf4e8">rpmIsVerbose</a>()) {
<a name="l00329"></a>00329             <a class="code" href="cliutils_8c.html#a4a1ef17fed649a0761310301053e97ed">printUsage</a>(optCon, stderr, 0);
<a name="l00330"></a>00330             ec = argc;
<a name="l00331"></a>00331         }
<a name="l00332"></a>00332         <span class="keywordflow">break</span>;
<a name="l00333"></a>00333     }
<a name="l00334"></a>00334 
<a name="l00335"></a>00335     ts = <a class="code" href="group__rpmts.html#ga5315165a6e80a0c71dbe5eb07dd18f58" title="Destroy transaction set, closing the database as well.">rpmtsFree</a>(ts);
<a name="l00336"></a>00336     <a class="code" href="cliutils_8c.html#a494970a3454c7b765b70943ae1a2eca1">finishPipe</a>();
<a name="l00337"></a>00337 
<a name="l00338"></a>00338 <span class="preprocessor">#ifdef  IAM_RPMQV</span>
<a name="l00339"></a>00339 <span class="preprocessor"></span>    qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a5da426be3eafe4553aef972d4ce010e1">qva_queryFormat</a> = <a class="code" href="system_8h.html#ae6e74ce39e6413596a772e62aacc51cb">_free</a>(qva-&gt;<a class="code" href="structrpmQVKArguments__s.html#a5da426be3eafe4553aef972d4ce010e1">qva_queryFormat</a>);
<a name="l00340"></a>00340 <span class="preprocessor">#endif</span>
<a name="l00341"></a>00341 <span class="preprocessor"></span>
<a name="l00342"></a>00342 <span class="preprocessor">#ifdef  IAM_RPMEIU</span>
<a name="l00343"></a>00343 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a> != NULL)
<a name="l00344"></a>00344     <span class="keywordflow">for</span> (i = 0; i &lt; ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a364d2204b05fb3c896b6b6211894cbf4">numRelocations</a>; i++)
<a name="l00345"></a>00345         ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[i].<a class="code" href="structrpmRelocation__s.html#a945f7f53153cf221e5692d74df8f5efb">oldPath</a> = <a class="code" href="system_8h.html#ae6e74ce39e6413596a772e62aacc51cb">_free</a>(ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>[i].<a class="code" href="structrpmRelocation__s.html#a945f7f53153cf221e5692d74df8f5efb">oldPath</a>);
<a name="l00346"></a>00346     ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a> = <a class="code" href="system_8h.html#ae6e74ce39e6413596a772e62aacc51cb">_free</a>(ia-&gt;<a class="code" href="structrpmInstallArguments__s.html#a1ee56f83b4716af6d2e7c292d426ea9b">relocations</a>);
<a name="l00347"></a>00347 <span class="preprocessor">#endif</span>
<a name="l00348"></a>00348 <span class="preprocessor"></span>
<a name="l00349"></a>00349     <a class="code" href="group__rpmcli.html#ga9b4197af25cc216aa3bb7cce5d158dcf" title="Destroy most everything needed by an rpm CLI executable context.">rpmcliFini</a>(optCon);
<a name="l00350"></a>00350 
<a name="l00351"></a>00351     <span class="keywordflow">return</span> <a class="code" href="cliutils_8h.html#a89b25b44e8686ea530eba18ba929d9e3">RETVAL</a>(ec);
<a name="l00352"></a>00352 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jul 15 2011 for rpm by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>