2 const char *__progname;
14 #include <rpm/rpmcli.h>
15 #include <rpm/rpmlib.h> /* RPMSIGTAG, rpmReadPackageFile .. */
16 #include <rpm/rpmbuild.h>
17 #include <rpm/rpmlog.h>
18 #include <rpm/rpmfileutil.h>
20 #include <rpm/rpmdb.h>
21 #include <rpm/rpmps.h>
22 #include <rpm/rpmts.h>
26 #define GETOPT_REBUILD 1003
27 #define GETOPT_RECOMPILE 1004
30 #if defined(IAM_RPMBT) || defined(IAM_RPMK)
31 #include "lib/signature.h"
38 MODE_QUERY = (1 << 0),
39 MODE_VERIFY = (1 << 3),
40 #define MODES_QV (MODE_QUERY | MODE_VERIFY)
42 MODE_INSTALL = (1 << 1),
43 MODE_ERASE = (1 << 2),
44 #define MODES_IE (MODE_INSTALL | MODE_ERASE)
46 MODE_BUILD = (1 << 4),
47 MODE_REBUILD = (1 << 5),
48 MODE_RECOMPILE = (1 << 8),
49 MODE_TARBUILD = (1 << 11),
50 #define MODES_BT (MODE_BUILD | MODE_TARBUILD | MODE_REBUILD | MODE_RECOMPILE)
52 MODE_CHECKSIG = (1 << 6),
53 MODE_RESIGN = (1 << 7),
54 #define MODES_K (MODE_CHECKSIG | MODE_RESIGN)
56 MODE_INITDB = (1 << 10),
57 MODE_REBUILDDB = (1 << 12),
58 MODE_VERIFYDB = (1 << 13),
59 #define MODES_DB (MODE_INITDB | MODE_REBUILDDB | MODE_VERIFYDB)
65 #define MODES_FOR_DBPATH (MODES_BT | MODES_IE | MODES_QV | MODES_DB)
66 #define MODES_FOR_NODEPS (MODES_BT | MODES_IE | MODE_VERIFY)
67 #define MODES_FOR_TEST (MODES_BT | MODES_IE)
68 #define MODES_FOR_ROOT (MODES_BT | MODES_IE | MODES_QV | MODES_DB | MODES_K)
72 /* the structure describing the options we take and the defaults */
73 static struct poptOption optionsTable[] = {
76 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
77 N_("Query/Verify package selection options:"),
79 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQueryPoptTable, 0,
80 N_("Query options (with -q or --query):"),
82 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmVerifyPoptTable, 0,
83 N_("Verify options (with -V or --verify):"),
85 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliFtsPoptTable, 0,
86 N_("File tree walk options (with --ftswalk):"),
88 #endif /* IAM_RPMQV */
91 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmSignPoptTable, 0,
92 N_("Signature options:"),
97 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmDatabasePoptTable, 0,
98 N_("Database options:"),
100 #endif /* IAM_RPMDB */
103 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmBuildPoptTable, 0,
104 N_("Build options with [ <specfile> | <tarball> | <source package> ]:"),
106 #endif /* IAM_RPMBT */
109 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmInstallPoptTable, 0,
110 N_("Install/Upgrade/Erase options:"),
112 #endif /* IAM_RPMEIU */
114 { "quiet", '\0', 0, &quiet, 0, NULL, NULL},
116 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
117 N_("Common options for all rpm modes and executables:"),
126 /* MiNT cannot dynamically increase the stack. */
127 long _stksize = 64 * 1024L;
131 static void argerror(const char * desc)
133 fprintf(stderr, _("%s: %s\n"), __progname, desc);
137 static void printVersion(FILE * fp)
139 fprintf(fp, _("RPM version %s\n"), rpmEVR);
142 static void printBanner(FILE * fp)
144 fprintf(fp, _("Copyright (C) 1998-2002 - Red Hat, Inc.\n"));
145 fprintf(fp, _("This program may be freely redistributed under the terms of the GNU GPL\n"));
148 static void printUsage(poptContext con, FILE * fp, int flags)
155 poptPrintHelp(con, fp, flags);
157 poptPrintUsage(con, fp, flags);
160 int main(int argc, char *argv[])
163 enum modes bigMode = MODE_UNKNOWN;
165 #if defined(IAM_RPMQV)
166 QVA_t qva = &rpmQVKArgs;
170 BTA_t ba = &rpmBTArgs;
174 struct rpmInstallArguments_s * ia = &rpmIArgs;
177 #if defined(IAM_RPMDB)
178 struct rpmDatabaseArguments_s * da = &rpmDBArgs;
181 #if defined(IAM_RPMK)
182 QVA_t ka = &rpmQVKArgs;
185 #if defined(IAM_RPMBT) || defined(IAM_RPMK)
186 char * passPhrase = "";
191 const char *optArg, *poptCtx;
201 #if HAVE_MCHECK_H && HAVE_MTRACE
202 mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
204 setprogname(argv[0]); /* Retrofit glibc __progname */
206 /* XXX glibc churn sanity */
207 if (__progname == NULL) {
208 if ((__progname = strrchr(argv[0], '/')) != NULL) __progname++;
209 else __progname = argv[0];
212 /* Set the major mode based on argv[0] */
214 if (rstreq(__progname, "rpmbuild")) bigMode = MODE_BUILD;
217 if (rstreq(__progname, "rpmquery")) bigMode = MODE_QUERY;
218 if (rstreq(__progname, "rpmverify")) bigMode = MODE_VERIFY;
221 #if defined(IAM_RPMQV)
222 /* Jumpstart option from argv[0] if necessary. */
224 case MODE_QUERY: qva->qva_mode = 'q'; break;
225 case MODE_VERIFY: qva->qva_mode = 'V'; break;
226 case MODE_CHECKSIG: qva->qva_mode = 'K'; break;
227 case MODE_RESIGN: qva->qva_mode = 'R'; break;
243 #if defined(ENABLE_NLS)
244 /* set up the correct locale */
245 (void) setlocale(LC_ALL, "" );
247 bindtextdomain(PACKAGE, LOCALEDIR);
251 rpmSetVerbosity(RPMLOG_NOTICE); /* XXX silly use by showrc */
253 /* Only build has it's own set of aliases, everything else uses rpm */
255 poptCtx = "rpmbuild";
260 /* Make a first pass through the arguments, looking for --rcfile */
261 /* We need to handle that before dealing with the rest of the arguments. */
262 /* XXX popt argv definition should be fixed instead of casting... */
263 optCon = poptGetContext(poptCtx, argc, (const char **)argv, optionsTable, 0);
265 char *poptfile = rpmGenPath(rpmConfigDir(), LIBRPMALIAS_FILENAME, NULL);
266 (void) poptReadConfigFile(optCon, poptfile);
269 (void) poptReadDefaultConfig(optCon, 1);
270 poptSetExecPath(optCon, rpmConfigDir(), 1);
272 while ((arg = poptGetNextOpt(optCon)) > 0) {
273 optArg = poptGetOptArg(optCon);
277 fprintf(stderr, _("Internal error in argument processing (%d) :-(\n"), arg);
283 fprintf(stderr, "%s: %s\n",
284 poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
292 switch (ba->buildMode) {
293 case 'b': bigMode = MODE_BUILD; break;
294 case 't': bigMode = MODE_TARBUILD; break;
295 case 'B': bigMode = MODE_REBUILD; break;
296 case 'C': bigMode = MODE_RECOMPILE; break;
299 if ((ba->buildAmount & RPMBUILD_RMSOURCE) && bigMode == MODE_UNKNOWN)
300 bigMode = MODE_BUILD;
302 if ((ba->buildAmount & RPMBUILD_RMSPEC) && bigMode == MODE_UNKNOWN)
303 bigMode = MODE_BUILD;
305 if (ba->buildRootOverride && bigMode != MODE_BUILD &&
306 bigMode != MODE_REBUILD && bigMode != MODE_TARBUILD) {
307 argerror("--buildroot may only be used during package builds");
309 #endif /* IAM_RPMBT */
312 if (bigMode == MODE_UNKNOWN || (bigMode & MODES_DB)) {
314 if (bigMode != MODE_UNKNOWN)
315 argerror(_("only one major mode may be specified"));
317 bigMode = MODE_INITDB;
320 if (bigMode != MODE_UNKNOWN)
321 argerror(_("only one major mode may be specified"));
323 bigMode = MODE_REBUILDDB;
326 if (bigMode != MODE_UNKNOWN)
327 argerror(_("only one major mode may be specified"));
329 bigMode = MODE_VERIFYDB;
332 #endif /* IAM_RPMDB */
335 if (bigMode == MODE_UNKNOWN || (bigMode & MODES_QV)) {
336 switch (qva->qva_mode) {
337 case 'q': bigMode = MODE_QUERY; break;
338 case 'V': bigMode = MODE_VERIFY; break;
341 if (qva->qva_sourceCount) {
342 if (qva->qva_sourceCount > 2)
343 argerror(_("one type of query/verify may be performed at a "
346 if (qva->qva_flags && (bigMode & ~MODES_QV))
347 argerror(_("unexpected query flags"));
349 if (qva->qva_queryFormat && (bigMode & ~MODES_QV))
350 argerror(_("unexpected query format"));
352 if (qva->qva_source != RPMQV_PACKAGE && (bigMode & ~MODES_QV))
353 argerror(_("unexpected query source"));
355 #endif /* IAM_RPMQV */
358 if (bigMode == MODE_UNKNOWN || (bigMode & MODES_IE))
359 { int iflags = (ia->installInterfaceFlags &
360 (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL));
361 int eflags = (ia->installInterfaceFlags & INSTALL_ERASE);
364 argerror(_("only one major mode may be specified"));
366 bigMode = MODE_INSTALL;
368 bigMode = MODE_ERASE;
370 #endif /* IAM_RPMEIU */
373 if (bigMode == MODE_UNKNOWN || (bigMode & MODES_K)) {
374 switch (ka->qva_mode) {
378 case RPMSIGN_IMPORT_PUBKEY:
379 case RPMSIGN_CHK_SIGNATURE:
380 bigMode = MODE_CHECKSIG;
383 case RPMSIGN_ADD_SIGNATURE:
384 case RPMSIGN_NEW_SIGNATURE:
385 case RPMSIGN_DEL_SIGNATURE:
386 bigMode = MODE_RESIGN;
387 ka->sign = (ka->qva_mode != RPMSIGN_DEL_SIGNATURE);
391 #endif /* IAM_RPMK */
393 #if defined(IAM_RPMEIU)
394 if (!( bigMode == MODE_INSTALL ) &&
395 (ia->probFilter & (RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_OLDPACKAGE)))
396 argerror(_("only installation, upgrading, rmsource and rmspec may be forced"));
397 if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_FORCERELOCATE))
398 argerror(_("files may only be relocated during package installation"));
400 if (ia->relocations && ia->prefix)
401 argerror(_("cannot use --prefix with --relocate or --excludepath"));
403 if (bigMode != MODE_INSTALL && ia->relocations)
404 argerror(_("--relocate and --excludepath may only be used when installing new packages"));
406 if (bigMode != MODE_INSTALL && ia->prefix)
407 argerror(_("--prefix may only be used when installing new packages"));
409 if (ia->prefix && ia->prefix[0] != '/')
410 argerror(_("arguments to --prefix must begin with a /"));
412 if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & INSTALL_HASH))
413 argerror(_("--hash (-h) may only be specified during package "
416 if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & INSTALL_PERCENT))
417 argerror(_("--percent may only be specified during package "
420 if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_REPLACEPKG))
421 argerror(_("--replacepkgs may only be specified during package "
424 if (bigMode != MODE_INSTALL && (ia->transFlags & RPMTRANS_FLAG_NODOCS))
425 argerror(_("--excludedocs may only be specified during package "
428 if (bigMode != MODE_INSTALL && ia->incldocs)
429 argerror(_("--includedocs may only be specified during package "
432 if (ia->incldocs && (ia->transFlags & RPMTRANS_FLAG_NODOCS))
433 argerror(_("only one of --excludedocs and --includedocs may be "
436 if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_IGNOREARCH))
437 argerror(_("--ignorearch may only be specified during package "
440 if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_IGNOREOS))
441 argerror(_("--ignoreos may only be specified during package "
444 if (bigMode != MODE_INSTALL && bigMode != MODE_ERASE &&
445 (ia->probFilter & (RPMPROB_FILTER_DISKSPACE|RPMPROB_FILTER_DISKNODES)))
446 argerror(_("--ignoresize may only be specified during package "
449 if ((ia->installInterfaceFlags & UNINSTALL_ALLMATCHES) && bigMode != MODE_ERASE)
450 argerror(_("--allmatches may only be specified during package "
453 if ((ia->transFlags & RPMTRANS_FLAG_ALLFILES) && bigMode != MODE_INSTALL)
454 argerror(_("--allfiles may only be specified during package "
457 if ((ia->transFlags & RPMTRANS_FLAG_JUSTDB) &&
458 bigMode != MODE_INSTALL && bigMode != MODE_ERASE)
459 argerror(_("--justdb may only be specified during package "
460 "installation and erasure"));
462 if (bigMode != MODE_INSTALL && bigMode != MODE_ERASE && bigMode != MODE_VERIFY &&
463 (ia->transFlags & (RPMTRANS_FLAG_NOSCRIPTS | _noTransScripts | _noTransTriggers)))
464 argerror(_("script disabling options may only be specified during "
465 "package installation and erasure"));
467 if (bigMode != MODE_INSTALL && bigMode != MODE_ERASE && bigMode != MODE_VERIFY &&
468 (ia->transFlags & (RPMTRANS_FLAG_NOTRIGGERS | _noTransTriggers)))
469 argerror(_("trigger disabling options may only be specified during "
470 "package installation and erasure"));
472 if (ia->noDeps & (bigMode & ~MODES_FOR_NODEPS))
473 argerror(_("--nodeps may only be specified during package "
474 "building, rebuilding, recompilation, installation,"
475 "erasure, and verification"));
477 if ((ia->transFlags & RPMTRANS_FLAG_TEST) && (bigMode & ~MODES_FOR_TEST))
478 argerror(_("--test may only be specified during package installation, "
479 "erasure, and building"));
480 #endif /* IAM_RPMEIU */
482 if (rpmcliRootDir && rpmcliRootDir[1] && (bigMode & ~MODES_FOR_ROOT))
483 argerror(_("--root (-r) may only be specified during "
484 "installation, erasure, querying, and "
485 "database rebuilds"));
488 switch (urlIsURL(rpmcliRootDir)) {
490 if (bigMode & MODES_FOR_ROOT)
493 if (rpmcliRootDir[0] != '/')
494 argerror(_("arguments to --root (-r) must begin with a /"));
500 rpmSetVerbosity(RPMLOG_WARNING);
502 #if defined(IAM_RPMBT) || defined(IAM_RPMK)
504 #if defined(IAM_RPMBT)
507 #if defined(IAM_RPMK)
512 if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD ||
513 bigMode == MODE_RESIGN || bigMode == MODE_TARBUILD)
519 if ((av = poptGetArgs(optCon)) == NULL) {
520 fprintf(stderr, _("no files to sign\n"));
524 if (stat(*av, &sb)) {
525 fprintf(stderr, _("cannot access file %s\n"), *av);
536 if (poptPeekArg(optCon)) {
537 int sigTag = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY);
545 passPhrase = rpmGetPassPhrase(_("Enter pass phrase: "), sigTag);
546 if (passPhrase == NULL) {
547 fprintf(stderr, _("Pass phrase check failed\n"));
551 fprintf(stderr, _("Pass phrase is good.\n"));
552 passPhrase = xstrdup(passPhrase);
556 _("Invalid %%_signature spec in macro file.\n"));
563 argerror(_("--sign may only be used during package building"));
566 /* Make rpmLookupSignatureType() return 0 ("none") from now on */
567 (void) rpmLookupSignatureType(RPMLOOKUPSIG_DISABLE);
569 #endif /* IAM_RPMBT || IAM_RPMK */
571 if (rpmcliPipeOutput) {
573 fprintf(stderr, _("creating a pipe for --pipe failed: %m\n"));
577 if (!(pipeChild = fork())) {
578 (void) signal(SIGPIPE, SIG_DFL);
580 (void) dup2(p[0], STDIN_FILENO);
582 (void) execl("/bin/sh", "/bin/sh", "-c", rpmcliPipeOutput, NULL);
583 fprintf(stderr, _("exec failed\n"));
587 (void) dup2(p[1], STDOUT_FILENO);
592 (void) rpmtsSetRootDir(ts, rpmcliRootDir);
596 ec = rpmtsInitDB(ts, 0644);
600 { rpmVSFlags vsflags = rpmExpandNumeric("%{_vsflags_rebuilddb}");
601 rpmVSFlags ovsflags = rpmtsSetVSFlags(ts, vsflags);
602 ec = rpmtsRebuildDB(ts);
603 vsflags = rpmtsSetVSFlags(ts, ovsflags);
606 ec = rpmtsVerifyDB(ts);
608 #endif /* IAM_RPMDB */
615 while (!rpmIsVerbose())
616 rpmIncreaseVerbosity();
618 if (!poptPeekArg(optCon))
619 argerror(_("no packages files given for rebuild"));
622 RPMBUILD_PREP | RPMBUILD_BUILD | RPMBUILD_INSTALL | RPMBUILD_CHECK;
623 if (bigMode == MODE_REBUILD) {
624 ba->buildAmount |= RPMBUILD_PACKAGEBINARY;
625 ba->buildAmount |= RPMBUILD_RMSOURCE;
626 ba->buildAmount |= RPMBUILD_RMSPEC;
627 ba->buildAmount |= RPMBUILD_CLEAN;
628 ba->buildAmount |= RPMBUILD_RMBUILD;
631 while ((pkg = poptGetArg(optCon))) {
632 char * specFile = NULL;
635 ec = rpmInstallSource(ts, pkg, &specFile, &ba->cookie);
637 ba->rootdir = rpmcliRootDir;
638 ba->passPhrase = passPhrase;
639 ec = build(ts, specFile, ba, rpmcliRcfile);
641 ba->cookie = _free(ba->cookie);
642 specFile = _free(specFile);
653 if (!quiet) while (!rpmIsVerbose())
654 rpmIncreaseVerbosity();
656 switch (ba->buildChar) {
658 ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
660 ba->buildAmount |= RPMBUILD_PACKAGEBINARY;
661 ba->buildAmount |= RPMBUILD_CLEAN;
663 ba->buildAmount |= RPMBUILD_INSTALL;
664 ba->buildAmount |= RPMBUILD_CHECK;
665 if ((ba->buildChar == 'i') && ba->shortCircuit)
668 ba->buildAmount |= RPMBUILD_BUILD;
669 if ((ba->buildChar == 'c') && ba->shortCircuit)
672 ba->buildAmount |= RPMBUILD_PREP;
676 ba->buildAmount |= RPMBUILD_FILECHECK;
679 ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
683 if (!poptPeekArg(optCon)) {
684 if (bigMode == MODE_BUILD)
685 argerror(_("no spec files given for build"));
687 argerror(_("no tar files given for build"));
690 while ((pkg = poptGetArg(optCon))) {
691 ba->rootdir = rpmcliRootDir;
692 ba->passPhrase = passPhrase;
694 ec = build(ts, pkg, ba, rpmcliRcfile);
698 (void) rpmReadConfigFiles(rpmcliRcfile, NULL);
701 #endif /* IAM_RPMBT */
705 if (ia->noDeps) ia->installInterfaceFlags |= UNINSTALL_NODEPS;
707 if (!poptPeekArg(optCon)) {
708 argerror(_("no packages given for erase"));
710 ec += rpmErase(ts, ia, (ARGV_const_t) poptGetArgs(optCon));
716 /* RPMTRANS_FLAG_KEEPOBSOLETE */
719 if (ia->transFlags & RPMTRANS_FLAG_NODOCS) {
721 } else if (rpmExpandNumeric("%{_excludedocs}"))
722 ia->transFlags |= RPMTRANS_FLAG_NODOCS;
725 if (ia->noDeps) ia->installInterfaceFlags |= INSTALL_NODEPS;
727 /* we've already ensured !(!ia->prefix && !ia->relocations) */
729 ia->relocations = xmalloc(2 * sizeof(*ia->relocations));
730 ia->relocations[0].oldPath = NULL; /* special case magic */
731 ia->relocations[0].newPath = ia->prefix;
732 ia->relocations[1].oldPath = NULL;
733 ia->relocations[1].newPath = NULL;
734 } else if (ia->relocations) {
735 ia->relocations = xrealloc(ia->relocations,
736 sizeof(*ia->relocations) * (ia->numRelocations + 1));
737 ia->relocations[ia->numRelocations].oldPath = NULL;
738 ia->relocations[ia->numRelocations].newPath = NULL;
741 if (!poptPeekArg(optCon)) {
742 argerror(_("no packages given for install"));
744 /* FIX: ia->relocations[0].newPath undefined */
745 ec += rpmInstall(ts, ia, (ARGV_t) poptGetArgs(optCon));
749 #endif /* IAM_RPMEIU */
753 if (!poptPeekArg(optCon)
754 && !(qva->qva_source == RPMQV_ALL || qva->qva_source == RPMQV_HDLIST))
755 argerror(_("no arguments given for query"));
757 qva->qva_specQuery = rpmspecQuery;
758 ec = rpmcliQuery(ts, qva, (ARGV_const_t) poptGetArgs(optCon));
759 qva->qva_specQuery = NULL;
763 { rpmVerifyFlags verifyFlags = VERIFY_ALL;
765 verifyFlags &= ~qva->qva_flags;
766 qva->qva_flags = (rpmQueryFlags) verifyFlags;
768 if (!poptPeekArg(optCon)
769 && !(qva->qva_source == RPMQV_ALL || qva->qva_source == RPMQV_HDLIST))
770 argerror(_("no arguments given for verify"));
771 ec = rpmcliVerify(ts, qva, (ARGV_const_t) poptGetArgs(optCon));
773 #endif /* IAM_RPMQV */
777 { rpmVerifyFlags verifyFlags =
778 (VERIFY_FILEDIGEST|VERIFY_DIGEST|VERIFY_SIGNATURE);
780 verifyFlags &= ~ka->qva_flags;
781 ka->qva_flags = (rpmQueryFlags) verifyFlags;
784 if (!poptPeekArg(optCon))
785 argerror(_("no arguments given"));
786 ka->passPhrase = passPhrase;
787 ec = rpmcliSign(ts, ka, (ARGV_const_t) poptGetArgs(optCon));
789 #endif /* IAM_RPMK */
791 #if !defined(IAM_RPMQV)
795 #if !defined(IAM_RPMK)
799 #if !defined(IAM_RPMDB)
804 #if !defined(IAM_RPMBT)
810 #if !defined(IAM_RPMEIU)
815 if (poptPeekArg(optCon) != NULL || argc <= 1 || rpmIsVerbose()) {
816 printUsage(optCon, stderr, 0);
826 optCon = poptFreeContext(optCon);
828 rpmFreeMacros(rpmCLIMacroContext);
832 (void) fclose(stdout);
833 (void) waitpid(pipeChild, &status, 0);
836 /* keeps memory leak checkers quiet */
837 rpmFreeFilesystems();
841 qva->qva_queryFormat = _free(qva->qva_queryFormat);
846 ba->buildRootOverride = _free(ba->buildRootOverride);
847 ba->targets = _free(ba->targets);
851 if (ia->relocations != NULL)
852 for (i = 0; i < ia->numRelocations; i++)
853 ia->relocations[i].oldPath = _free(ia->relocations[i].oldPath);
854 ia->relocations = _free(ia->relocations);
857 #if HAVE_MCHECK_H && HAVE_MTRACE
858 muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
861 /* XXX Avoid exit status overflow. Status 255 is special to xargs(1) */
862 if (ec > 254) ec = 254;