aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2006-11-28 15:24:06 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2006-11-28 15:24:06 +0000
commitf0a6ebba3dc3a7f23a3314a46aadad11f459d1e2 (patch)
treedc530edf3c03aa7c2fc19ab267a7a459caeef088
parentba32458f33b82ab34e7a7b7996672edfa811c253 (diff)
downloadpaludis-f0a6ebba3dc3a7f23a3314a46aadad11f459d1e2.tar.gz
paludis-f0a6ebba3dc3a7f23a3314a46aadad11f459d1e2.tar.xz
Fix --owner to return with error if any of the files specified are not owned by any currently installed package.
-rw-r--r--src/paludis/owner.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/paludis/owner.cc b/src/paludis/owner.cc
index 4d63bf1..52d8bf8 100644
--- a/src/paludis/owner.cc
+++ b/src/paludis/owner.cc
@@ -75,11 +75,12 @@ namespace
};
}
-void
+int
do_one_owner(
const p::Environment * const env,
const std::string & query)
{
+ bool found_owner=false;
cout << "* " << colour(cl_package_name, query) << endl;
for (p::PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
@@ -106,13 +107,17 @@ do_one_owner(
ContentsFinder d(query, CommandLine::get_instance()->a_full_match.specified());
std::for_each(contents->begin(), contents->end(), accept_visitor(&d));
if (d.found)
+ {
cout << " " << e << endl;
+ found_owner=true;
+ }
}
}
}
}
cout << endl;
+ return found_owner ? 0 : 1;
}
@@ -126,7 +131,7 @@ do_owner()
CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters());
for ( ; q != q_end ; ++q)
- do_one_owner(env, *q);
+ return_code |= do_one_owner(env, *q);
return return_code;
}