summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-12-09 16:24:16 +0100
committerJindrich Novy <jnovy@redhat.com>2008-12-09 16:24:16 +0100
commit196cc2ad71a6af90961ab62f9f32fc14f7c61878 (patch)
tree787087188255c0b675434a1d05cc8d99627b9ed2
parent95b8a910893bba3ad66507975cd96f1c082004e3 (diff)
downloadrpm-196cc2ad71a6af90961ab62f9f32fc14f7c61878.tar.gz
rpm-196cc2ad71a6af90961ab62f9f32fc14f7c61878.tar.bz2
rpm-196cc2ad71a6af90961ab62f9f32fc14f7c61878.zip
Nuke the useless bits of rpmsort.c declared in global scope
-rw-r--r--tools/rpmsort.c54
1 files changed, 9 insertions, 45 deletions
diff --git a/tools/rpmsort.c b/tools/rpmsort.c
index f82690fdf..fc9bf5141 100644
--- a/tools/rpmsort.c
+++ b/tools/rpmsort.c
@@ -19,15 +19,6 @@ const char *__progname;
#include "debug.h"
-static int _depends_debug;
-
-static int noAvailable = 1;
-#ifdef DYING
-static const char * avdbpath =
- "/usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat";
-#endif
-static int noDeps = 0;
-
static inline const char * identifyDepend(rpmsenseFlags f)
{
if (isLegacyPreReq(f))
@@ -49,7 +40,7 @@ static inline const char * identifyDepend(rpmsenseFlags f)
}
static int
-do_tsort(const char *fileArgv[])
+do_tsort(const char *fileArgv[], int noDeps)
{
rpmts ts = NULL;
const char ** pkgURL = NULL;
@@ -80,31 +71,6 @@ do_tsort(const char *fileArgv[])
goto exit;
}
-#ifdef DYING
- /* Load all the available packages. */
- if (!(noDeps || noAvailable)) {
- rpmdbMatchIterator mi = NULL;
- struct rpmdb_s * avdb = NULL;
- const char * rootdir = "/";
-
- addMacro(NULL, "_dbpath", NULL, avdbpath, RMIL_CMDLINE);
- rc = rpmdbOpen(rootdir, &avdb, O_RDONLY, 0644);
- delMacro(NULL, "_dbpath");
- if (rc) {
- rpmlog(RPMLOG_ERR, _("cannot open Available database\n"));
- goto endavail;
- }
- mi = rpmdbInitIterator(avdb, RPMDBI_PACKAGES, NULL, 0);
- while ((h = rpmdbNextIterator(mi)) != NULL) {
- rpmtsAvailablePackage(ts, h, NULL);
- }
-
-endavail:
- if (mi) rpmdbFreeIterator(mi);
- if (avdb) rpmdbClose(avdb);
- }
-#endif
-
/* Build fully globbed list of arguments in argv[argc]. */
for (fnp = fileArgv; *fnp; fnp++) {
av = _free(av);
@@ -272,13 +238,6 @@ exit:
return rc;
}
-static struct poptOption optionsTable[] = {
- { "noavailable", '\0', 0, &noAvailable, 0, NULL, NULL},
- { "nodeps", '\0', 0, &noDeps, 0, NULL, NULL},
- { "verbose", 'v', 0, 0, 'v', NULL, NULL},
- { NULL, 0, 0, 0, 0, NULL, NULL}
-};
-
int
main(int argc, char *argv[])
{
@@ -286,6 +245,13 @@ main(int argc, char *argv[])
const char * optArg;
int arg;
int ec = 0;
+ int noDeps = 0;
+ struct poptOption optionsTable[] = {
+ { "nodeps", '\0', 0, &noDeps, 0, NULL, NULL},
+ { "verbose", 'v', 0, 0, 'v', NULL, NULL},
+ { NULL, 0, 0, 0, 0, NULL, NULL}
+ };
+
#if HAVE_MCHECK_H && HAVE_MTRACE
mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
@@ -298,8 +264,6 @@ main(int argc, char *argv[])
(void)textdomain(PACKAGE);
#endif
- _depends_debug = 1;
-
optCon = poptGetContext("rpmsort", argc, (const char **) argv, optionsTable, 0);
#if RPM_USES_POPTREADDEFAULTCONFIG
poptReadDefaultConfig(optCon, 1);
@@ -320,7 +284,7 @@ main(int argc, char *argv[])
rpmReadConfigFiles(NULL, NULL);
- ec = do_tsort(poptGetArgs(optCon));
+ ec = do_tsort(poptGetArgs(optCon), noDeps);
optCon = poptFreeContext(optCon);