aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marc-Antoine Perennou <Marc-Antoine@Perennou.com> 2010-03-10 22:18:50 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-10 21:40:21 +0000
commitc47556f8fb95d41f2f8e19d4efc80f93bd9c9aaa (patch)
treea99ab2ab282d86eb43202f9d5bf5ecee8de83eac
parent44ffccd642e6223bd19f8c870de29c9adea96945 (diff)
downloadpaludis-c47556f8fb95d41f2f8e19d4efc80f93bd9c9aaa.tar.gz
paludis-c47556f8fb95d41f2f8e19d4efc80f93bd9c9aaa.tar.xz
Control overrides of checksums from appareo
-rw-r--r--src/clients/appareo/appareo.cc22
-rw-r--r--src/clients/appareo/command_line.cc1
-rw-r--r--src/clients/appareo/command_line.hh1
3 files changed, 17 insertions, 7 deletions
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index f3ecf6c..3e97892 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -87,8 +87,9 @@ namespace
throw ConfigurationError("Cannot find tree location (try specifying --repository-dir)");
}
- void fetch_ids(const std::tr1::shared_ptr<const PackageIDSequence> & ids, IDMap & results, unsigned & success, unsigned & total)
+ bool fetch_ids(const std::tr1::shared_ptr<const PackageIDSequence> & ids, IDMap & results, unsigned & success, unsigned & total)
{
+ bool no_conflict_with_manifest(true);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
@@ -136,12 +137,19 @@ namespace
if (! f->failed_integrity_checks().empty())
{
- if (! r.empty())
- r.append(", ");
- r.append(f->failed_integrity_checks());
+ if (CommandLine::get_instance()->a_override.specified())
+ ++success;
+ else
+ {
+ no_conflict_with_manifest = false;
+ if (! r.empty())
+ r.append(", ");
+ r.append(f->failed_integrity_checks());
+ }
}
- results.insert(std::make_pair(*i, f->target_file() + ": " + r));
+ if (! r.empty())
+ results.insert(std::make_pair(*i, f->target_file() + ": " + r));
}
if (failures->empty())
@@ -156,6 +164,7 @@ namespace
results.insert(std::make_pair(*i, "Uncaught exception '" + e.message() + "' (" + e.what() + ")"));
}
}
+ return no_conflict_with_manifest;
}
}
@@ -263,9 +272,8 @@ main(int argc, char *argv[])
const std::tr1::shared_ptr<const PackageIDSequence> ids(env[selection::AllVersionsSorted(
generator::Package(*p) & generator::InRepository(env.main_repository()->name()))]);
- fetch_ids(ids,results, success, total);
cout << "Making manifest for: " << colour(cl_package_name, stringify(*p)) << "..." << endl;
- if (env.main_repository()->manifest_interface())
+ if (fetch_ids(ids, results, success, total) && env.main_repository()->manifest_interface())
env.main_repository()->manifest_interface()->make_manifest(*p);
else
cerr << "Cannot make manifest for: " << colour(cl_package_name, stringify(*p)) << endl;
diff --git a/src/clients/appareo/command_line.cc b/src/clients/appareo/command_line.cc
index 1361e54..e24d44a 100644
--- a/src/clients/appareo/command_line.cc
+++ b/src/clients/appareo/command_line.cc
@@ -55,6 +55,7 @@ CommandLine::CommandLine() :
"Use a subdirectory named for the repository name under the specified directory for repository write cache"),
a_report_file(&general_args, "report-file", 'r',
"Write report to the specified file, rather than stdout"),
+ a_override(&general_args, "override", '\0', "Override Manifest if distfile's checksum does not match with it", false),
tree_args(main_options_section(), "Tree action options",
"Options which are relevant for tree actions."),
a_category(&tree_args, "category", 'C',
diff --git a/src/clients/appareo/command_line.hh b/src/clients/appareo/command_line.hh
index 422a455..cdd78b1 100644
--- a/src/clients/appareo/command_line.hh
+++ b/src/clients/appareo/command_line.hh
@@ -60,6 +60,7 @@ class CommandLine :
paludis::args::StringSequenceArg a_extra_repository_dir;
paludis::args::StringArg a_write_cache_dir;
paludis::args::StringArg a_report_file;
+ paludis::args::SwitchArg a_override;
paludis::args::ArgsGroup tree_args;
paludis::args::StringSetArg a_category;