#include <paludis/paludis.hh>
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace examples;
using std::cout;
using std::endl;
using std::left;
using std::setw;
int main(int argc, char * argv[])
{
int exit_status(0);
try
{
"example_match_package", "EXAMPLE_MATCH_PACKAGE_OPTIONS", "EXAMPLE_MATCH_PACKAGE_CMDLINE");
std::shared_ptr<const SetSpecTree> system(env->set(
SetName(
"system")));
std::shared_ptr<const SetSpecTree> world(env->set(
SetName(
"world")));
for (const auto & id : *ids)
{
cout << left << setw(50) << (
stringify(*
id) +
":") <<
" " <<
"paludis" << endl;
cout << left << setw(50) << (
stringify(*
id) +
":") <<
" " <<
"system" << endl;
cout << left << setw(50) << (
stringify(*
id) +
":") <<
" " <<
"world" << endl;
else
cout << left << setw(50) << (
stringify(*
id) +
":") <<
" " <<
"nothing" << endl;
}
}
{
cout << endl;
cout << "Unhandled exception:" << endl
return EXIT_FAILURE;
}
catch (const std::exception & e)
{
cout << endl;
cout << "Unhandled exception:" << endl
<<
" * " << e.
what() << endl;
return EXIT_FAILURE;
}
catch (...)
{
cout << endl;
cout << "Unhandled exception:" << endl
<< " * Unknown exception type. Ouch..." << endl;
return EXIT_FAILURE;
}
return exit_status;
}
Definition exception.hh:77
std::string backtrace(const std::string &delim) const
const char * what() const noexcept override
const std::string & message() const noexcept
PartiallyMadePackageDepSpec & package(const QualifiedPackageName &)
static CommandLine * get_instance() PALUDIS_ATTRIBUTE((warn_unused_result))
Definition generator.hh:147
Definition selection.hh:172
PartiallyMadePackageDepSpec make_package_dep_spec(const PartiallyMadePackageDepSpecOptions &) PALUDIS_VISIBLE
WrappedValue< SetNameTag > SetName
Definition name-fwd.hh:131
std::string stringify(const T_ &item)
Definition stringify.hh:166
Definition about_metadata-fwd.hh:24
bool match_package(const Environment &env, const PackageDepSpec &spec, const std::shared_ptr< const PackageID > &id, const std::shared_ptr< const PackageID > &spec_id, const MatchPackageOptions &options) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE
bool match_package_in_set(const Environment &env, const SetSpecTree &spec, const std::shared_ptr< const PackageID > &id, const MatchPackageOptions &options) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE