aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-26 22:20:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-26 22:20:30 +0000
commit567ab602aa21d69e2f8966b939b59902b5bae826 (patch)
tree065c15f3e3654da1b1fb3dff633b739ebe3a9418
parentda2ecbd408ce1a6160b1a7097f4214c1352a6c06 (diff)
downloadpaludis-567ab602aa21d69e2f8966b939b59902b5bae826.tar.gz
paludis-567ab602aa21d69e2f8966b939b59902b5bae826.tar.xz
Tidy up the reverse deps code a bit
-rw-r--r--src/adjutrix/find_reverse_deps.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/adjutrix/find_reverse_deps.cc b/src/adjutrix/find_reverse_deps.cc
index 7e9ec6e..cd35452 100644
--- a/src/adjutrix/find_reverse_deps.cc
+++ b/src/adjutrix/find_reverse_deps.cc
@@ -71,7 +71,7 @@ namespace
atom->accept(this);
}
- int found_matches()
+ bool found_matches()
{
return _found_matches;
}
@@ -184,9 +184,6 @@ namespace
bool found_matches(false);
- if (p_entries->empty())
- return found_matches ? EXIT_SUCCESS: EXIT_FAILURE;
-
for (PackageDatabaseEntryCollection::Iterator e(p_entries->begin()), e_end(p_entries->end()) ;
e != e_end ; ++e)
{
@@ -205,11 +202,11 @@ namespace
catch (Exception & exception)
{
std::cout << "Caught Exception (" << exception.what() << ")" << std::endl;
- return (found_matches ? EXIT_SUCCESS : EXIT_FAILURE) | 2;
+ return (found_matches ? 0 : 1) | 2;
}
}
- return found_matches ? EXIT_SUCCESS : EXIT_FAILURE;
+ return found_matches ? 0 : 1;
}
}
@@ -221,10 +218,10 @@ int do_find_reverse_deps(AdjutrixEnvironment & env)
PackageDepAtom::Pointer atom(new PackageDepAtom(*CommandLine::get_instance()->begin_parameters()));
PackageDatabaseEntryCollection::Pointer entries(env.package_database()->query(atom, is_either));
- int ret(EXIT_FAILURE);
+ int ret(0);
if (entries->empty())
- return ret;
+ return 1;
for (IndirectIterator<PackageDatabase::RepositoryIterator, const Repository>
r(env.package_database()->begin_repositories()),
@@ -233,7 +230,6 @@ int do_find_reverse_deps(AdjutrixEnvironment & env)
if (r->name() == RepositoryName("virtuals"))
continue;
-
write_repository_header(stringify(*atom), stringify(r->name()));
CategoryNamePartCollection::ConstPointer cat_names(r->category_names());