aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marc-Antoine Perennou <Marc-Antoine@Perennou.com> 2010-03-11 14:35:04 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-11 13:44:01 +0000
commit54b4e5757fd4ed78ef95dff6dfc94f70391414b4 (patch)
tree21dbb5b66801f3b905a7e3d191e507725b2fbf5c
parenta2ebc1dc247351669f8f4549a3401d4219d22df4 (diff)
downloadpaludis-54b4e5757fd4ed78ef95dff6dfc94f70391414b4.tar.gz
paludis-54b4e5757fd4ed78ef95dff6dfc94f70391414b4.tar.xz
Fix fetch failures with appareo
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc2
-rw-r--r--paludis/repositories/e/e_repository_exceptions.cc5
-rw-r--r--paludis/repositories/e/e_repository_exceptions.hh14
-rw-r--r--src/clients/appareo/appareo.cc12
6 files changed, 35 insertions, 3 deletions
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 51efd60..288fd2f 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -336,7 +336,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
{
_imp->output_manager->stdout_stream() << "unreadable file";
_imp->failures->push_back(make_named_values<FetchActionFailure>(
- value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_automatic_fetching>(true),
value_for<n::failed_integrity_checks>("Unreadable file"),
value_for<n::requires_manual_fetching>(false),
value_for<n::target_file>(stringify(distfile.basename()))
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 40faf20..5006510 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1094,6 +1094,9 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
FSEntry f(params().distdir() / *d);
+ if (! f.is_regular_file_or_symlink_to_regular_file())
+ throw MissingDistfileError("Distfile '" + f.basename() + "' does not exist");
+
SafeIFStream file_stream(f);
MemoisedHashes * hashes = MemoisedHashes::get_instance();
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index a185dc6..76f84c6 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -897,7 +897,7 @@ namespace test_cases
TEST_CHECK(made_manifest == reference_manifest);
- TEST_CHECK_THROWS(repo->make_manifest(QualifiedPackageName("category/package-b")), SafeIFStreamError);
+ TEST_CHECK_THROWS(repo->make_manifest(QualifiedPackageName("category/package-b")), MissingDistfileError);
}
} test_e_repository_manifest;
diff --git a/paludis/repositories/e/e_repository_exceptions.cc b/paludis/repositories/e/e_repository_exceptions.cc
index 5accf26..351f735 100644
--- a/paludis/repositories/e/e_repository_exceptions.cc
+++ b/paludis/repositories/e/e_repository_exceptions.cc
@@ -27,3 +27,8 @@ ERepositoryConfigurationError::ERepositoryConfigurationError(
{
}
+MissingDistfileError::MissingDistfileError(const std::string & s) throw () :
+ Exception(s)
+{
+}
+
diff --git a/paludis/repositories/e/e_repository_exceptions.hh b/paludis/repositories/e/e_repository_exceptions.hh
index 0e9d174..98d7c96 100644
--- a/paludis/repositories/e/e_repository_exceptions.hh
+++ b/paludis/repositories/e/e_repository_exceptions.hh
@@ -47,6 +47,20 @@ namespace paludis
ERepositoryConfigurationError(const std::string & msg) throw ();
};
+ /**
+ * Thrown when a distfile is missing in
+ * ERepository::make_manifest.
+ *
+ * \ingroup grpexceptions
+ * \ingroup grperepository
+ * \since 0.46
+ */
+ class PALUDIS_VISIBLE MissingDistfileError :
+ public Exception
+ {
+ public:
+ MissingDistfileError(const std::string &) throw ();
+ };
}
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index 3e97892..59dbc8c 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -32,6 +32,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/selection.hh>
@@ -274,7 +275,16 @@ main(int argc, char *argv[])
cout << "Making manifest for: " << colour(cl_package_name, stringify(*p)) << "..." << endl;
if (fetch_ids(ids, results, success, total) && env.main_repository()->manifest_interface())
- env.main_repository()->manifest_interface()->make_manifest(*p);
+ {
+ try
+ {
+ env.main_repository()->manifest_interface()->make_manifest(*p);
+ }
+ catch (const MissingDistfileError &)
+ {
+ cerr << "Cannot make manifest for: " << colour(cl_package_name, stringify(*p)) << endl;
+ }
+ }
else
cerr << "Cannot make manifest for: " << colour(cl_package_name, stringify(*p)) << endl;
}