aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 20:12:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 20:12:20 +0000
commita25f05fc0663a843616926fa550781c5310d69f8 (patch)
tree775cc33c50bc8079d0ba7905044d38ced808062f
parent73605866f2e6f214019b3e000144589bcf5e9068 (diff)
downloadpaludis-a25f05fc0663a843616926fa550781c5310d69f8.tar.gz
paludis-a25f05fc0663a843616926fa550781c5310d69f8.tar.xz
use_manifest = use | require | ignore
-rw-r--r--paludis/repositories/e/Makefile.am13
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc39
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.hh4
-rw-r--r--paludis/repositories/e/e_repository_params.cc24
-rw-r--r--paludis/repositories/e/e_repository_params.hh5
-rw-r--r--paludis/repositories/e/e_repository_params.se23
-rw-r--r--paludis/repositories/e/e_repository_params.sr1
-rw-r--r--paludis/repositories/e/ebuild_entries.cc4
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc3
-rw-r--r--paludis/repositories/e/make_ebin_repository.cc9
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc9
-rw-r--r--vim/syntax/paludis-repositories-conf.vim9
12 files changed, 130 insertions, 13 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 4135e59..704ba3e 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -3,6 +3,7 @@ CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
DISTCLEANFILES = \
glsa-sr.hh glsa-sr.cc \
e_repository_params-sr.hh e_repository_params-sr.cc \
+ e_repository_params-se.hh e_repository_params-se.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
ebuild-sr.hh ebuild-sr.cc \
ebin-sr.hh ebin-sr.cc ebin-se.hh ebin-se.cc \
@@ -50,6 +51,7 @@ paludis_repositories_e_include_HEADERS = \
e_repository_mask_file.hh \
e_repository_news.hh \
e_repository_params-sr.hh \
+ e_repository_params-se.hh \
e_repository_params.hh \
e_repository_profile.hh \
e_repository_profile_file.hh \
@@ -291,6 +293,9 @@ EXTRA_DIST = \
e_repository_params-sr.hh \
e_repository_params-sr.cc \
e_repository_params.sr \
+ e_repository_params-se.hh \
+ e_repository_params-se.cc \
+ e_repository_params.se \
e_repository_sets_TEST.cc \
e_repository_sets_TEST_setup.sh \
e_repository_sets_TEST_cleanup.sh \
@@ -328,6 +333,8 @@ BUILT_SOURCES = \
dep_parser-se.cc \
e_repository_params-sr.hh \
e_repository_params-sr.cc \
+ e_repository_params-se.hh \
+ e_repository_params-se.cc \
glsa-sr.hh \
glsa-sr.cc \
vdb_repository-sr.hh \
@@ -437,6 +444,12 @@ dep_parser-se.hh : dep_parser.se $(top_srcdir)/misc/make_se.bash
dep_parser-se.cc : dep_parser.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/dep_parser.se > $@ ; then rm -f $@ ; exit 1 ; fi
+e_repository_params-se.hh : e_repository_params.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/e_repository_params.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
+e_repository_params-se.cc : e_repository_params.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/e_repository_params.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
libpaludiserepositoryxmlthings_la_SOURCES = xml_things.cc xml_things.hh
libpaludiserepositoryxmlthings_la_CXXFLAGS = $(AM_CXXFLAGS) @LIBXML2DEPS_CFLAGS@
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 311cde7..ebd4bad 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/e/check_fetched_files_visitor.hh>
#include <paludis/repositories/e/source_uri_finder.hh>
#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
@@ -65,6 +66,7 @@ namespace paludis
bool in_nofetch;
const tr1::shared_ptr<Manifest2Reader> m2r;
+ const UseManifest use_manifest;
Implementation(
const Environment * const e,
@@ -72,7 +74,8 @@ namespace paludis
const FSEntry & d,
const bool c,
const bool n,
- const FSEntry & m2) :
+ const FSEntry & m2,
+ const UseManifest um) :
env(e),
id(i),
distdir(d),
@@ -80,7 +83,8 @@ namespace paludis
failures(new Sequence<FetchActionFailure>),
need_nofetch(false),
in_nofetch(n),
- m2r(new Manifest2Reader(m2))
+ m2r(new Manifest2Reader(m2)),
+ use_manifest(um)
{
}
};
@@ -92,8 +96,9 @@ CheckFetchedFilesVisitor::CheckFetchedFilesVisitor(
const FSEntry & d,
const bool c,
const bool n,
- const FSEntry & m2) :
- PrivateImplementationPattern<CheckFetchedFilesVisitor>(new Implementation<CheckFetchedFilesVisitor>(e, i, d, c, n, m2))
+ const FSEntry & m2,
+ const UseManifest um) :
+ PrivateImplementationPattern<CheckFetchedFilesVisitor>(new Implementation<CheckFetchedFilesVisitor>(e, i, d, c, n, m2, um))
{
}
@@ -173,11 +178,29 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
{
if (_imp->m2r->begin() == _imp->m2r->end())
{
- Log::get_instance()->message(ll_debug, lc_context)
- << "Empty or non-existent Manifest file";
- return true;
+ switch (_imp->use_manifest)
+ {
+ case manifest_use:
+ case manifest_ignore:
+ Log::get_instance()->message(ll_debug, lc_context) << "Empty or non-existent Manifest file";
+ return true;
+
+ case manifest_require:
+ case last_manifest:
+ _imp->failures->push_back(FetchActionFailure::create()
+ .target_file(stringify(distfile.basename()))
+ .failed_integrity_checks("No Manifest available")
+ .requires_manual_fetching(false)
+ .failed_automatic_fetching(false)
+ );
+ return false;
+
+ }
}
+ if (manifest_ignore == _imp->use_manifest)
+ return true;
+
bool found(false);
for (Manifest2Reader::Iterator m(_imp->m2r->begin()), m_end(_imp->m2r->end()) ;
@@ -281,7 +304,7 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
<< "Actual MD5 = " << md5sum.hexsum();
}
}
-
+
if (! found)
{
std::cout << "not in Manifest";
diff --git a/paludis/repositories/e/check_fetched_files_visitor.hh b/paludis/repositories/e/check_fetched_files_visitor.hh
index 56463d3..2c4e747 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.hh
+++ b/paludis/repositories/e/check_fetched_files_visitor.hh
@@ -20,6 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_CHECK_FETCHED_FILES_VISITOR_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_CHECK_FETCHED_FILES_VISITOR_HH 1
+#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/visitor-fwd.hh>
@@ -47,7 +48,8 @@ namespace paludis
const FSEntry & distdir,
const bool check_unneeded,
const bool fetch_restrict,
- const FSEntry & m2);
+ const FSEntry & m2,
+ const UseManifest um);
~CheckFetchedFilesVisitor();
diff --git a/paludis/repositories/e/e_repository_params.cc b/paludis/repositories/e/e_repository_params.cc
index 769290f..2133353 100644
--- a/paludis/repositories/e/e_repository_params.cc
+++ b/paludis/repositories/e/e_repository_params.cc
@@ -1,8 +1,32 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "e_repository_params.hh"
+#include <paludis/util/stringify.hh>
+#include <paludis/util/exception.hh>
+#include <ostream>
+#include <istream>
+#include <string>
using namespace paludis;
+using namespace paludis::erepository;
+#include <paludis/repositories/e/e_repository_params-se.cc>
#include <paludis/repositories/e/e_repository_params-sr.cc>
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index 02c1157..53ec535 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -35,6 +35,11 @@ namespace paludis
class PackageDatabase;
class ERepository;
+ namespace erepository
+ {
+#include <paludis/repositories/e/e_repository_params-se.hh>
+ }
+
#include <paludis/repositories/e/e_repository_params-sr.hh>
}
diff --git a/paludis/repositories/e/e_repository_params.se b/paludis/repositories/e/e_repository_params.se
new file mode 100644
index 0000000..7420af8
--- /dev/null
+++ b/paludis/repositories/e/e_repository_params.se
@@ -0,0 +1,23 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_UseManifest()
+{
+ prefix manifest
+ want_destringify
+ namespace paludis::erepository
+
+ key manifest_use "Use"
+ key manifest_require "Require"
+ key manifest_ignore "Ignore"
+
+ doxygen_comment << "END"
+ /**
+ * Whether to use, require or ignore Manifest.
+ *
+ * \ingroup grperepository
+ */
+END
+}
+
+
diff --git a/paludis/repositories/e/e_repository_params.sr b/paludis/repositories/e/e_repository_params.sr
index 1376d21..5c862f7 100644
--- a/paludis/repositories/e/e_repository_params.sr
+++ b/paludis/repositories/e/e_repository_params.sr
@@ -27,6 +27,7 @@ make_class_ERepositoryParams()
key eapi_when_unknown std::string
key eapi_when_unspecified std::string
key profile_eapi std::string
+ key use_manifest "erepository::UseManifest"
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index e930a58..57481a2 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -414,7 +414,9 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
_imp->e_repository->params().distdir, o.fetch_unneeded, fetch_userpriv_ok,
mirrors_name, fetch_restrict, no_mirror);
id->src_uri_key()->value()->accept(f);
- CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o.fetch_unneeded, fetch_restrict, ((_imp->e_repository->layout()->package_directory(id->name())) / "Manifest"));
+ CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o.fetch_unneeded, fetch_restrict,
+ ((_imp->e_repository->layout()->package_directory(id->name())) / "Manifest"),
+ _imp->e_repository->params().use_manifest);
id->src_uri_key()->value()->accept(c);
if (c.need_nofetch())
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 066b903..8980662 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/e/fetch_visitor.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/sequence.hh>
@@ -55,7 +56,7 @@ namespace test_cases
FetchVisitor v(&env, *env.package_database()->query(query::Matches(PackageDepSpec("=cat/pkg-1", pds_pm_permissive)),
qo_require_exactly_one)->begin(),
*eapi, FSEntry("fetch_visitor_TEST_dir/out"),
- false, false, "test", false);
+ false, false, "test", false, erepository::manifest_use);
parse_uri("file:///" + stringify(FSEntry("fetch_visitor_TEST_dir/in/input1").realpath()), *eapi)->accept(v);
TEST_CHECK(FSEntry("fetch_visitor_TEST_dir/out/input1").is_regular_file());
diff --git a/paludis/repositories/e/make_ebin_repository.cc b/paludis/repositories/e/make_ebin_repository.cc
index 2317ead..9573a76 100644
--- a/paludis/repositories/e/make_ebin_repository.cc
+++ b/paludis/repositories/e/make_ebin_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/map.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/destringify.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -167,6 +168,13 @@ paludis::make_ebin_repository(
buildroot = DistributionData::get_instance()->distribution_from_string(
env->default_distribution())->default_ebuild_build_root;
+ erepository::UseManifest use_manifest(erepository::manifest_use);
+ if (m->end() != m->find("use_manifest") && ! m->find("use_manifest")->second.empty())
+ {
+ Context item_context("When handling use_manifest key:");
+ use_manifest = destringify<erepository::UseManifest>(m->find("use_manifest")->second);
+ }
+
return tr1::shared_ptr<ERepository>(new ERepository(ERepositoryParams::create()
.entry_format("ebin")
.layout(layout)
@@ -189,6 +197,7 @@ paludis::make_ebin_repository(
.eapi_when_unspecified(eapi_when_unspecified)
.eapi_when_unknown(eapi_when_unknown)
.profile_eapi(profile_eapi)
+ .use_manifest(use_manifest)
.buildroot(buildroot)));
}
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index 80c3899..041bebd 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/map.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/destringify.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -194,6 +195,13 @@ paludis::make_ebuild_repository(
layout = DistributionData::get_instance()->distribution_from_string(
env->default_distribution())->default_ebuild_layout;
+ erepository::UseManifest use_manifest(erepository::manifest_use);
+ if (m->end() != m->find("use_manifest") && ! m->find("use_manifest")->second.empty())
+ {
+ Context item_context("When handling use_manifest key:");
+ use_manifest = destringify<erepository::UseManifest>(m->find("use_manifest")->second);
+ }
+
return tr1::shared_ptr<ERepository>(new ERepository(ERepositoryParams::create()
.entry_format("ebuild")
.layout(layout)
@@ -216,6 +224,7 @@ paludis::make_ebuild_repository(
.eapi_when_unknown(eapi_when_unknown)
.eapi_when_unspecified(eapi_when_unspecified)
.profile_eapi(profile_eapi)
+ .use_manifest(use_manifest)
.buildroot(buildroot)));
}
diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim
index bbf5def..5cf32e5 100644
--- a/vim/syntax/paludis-repositories-conf.vim
+++ b/vim/syntax/paludis-repositories-conf.vim
@@ -25,7 +25,8 @@ syn match PaludisRepositoriesConfEquals /=/ skipwhite
syn region PaludisRepositoriesConfValue contained start=// end=/$/
\ contains=PaludisRepositoriesConfString,PaludisRepositoriesConfUnquoted,
- \ PaludisRepositoriesConfContinuation,PaludisRepositoriesConfVariable
+ \ PaludisRepositoriesConfContinuation,PaludisRepositoriesConfVariable,
+ \ PaludisRepositoriesConfKnownValue
\ skipwhite
syn match PaludisRepositoriesConfContinuation contained /\\$/
@@ -41,11 +42,15 @@ syn keyword PaludisRepositoriesConfKnownKey contained
\ location distdir format buildroot library sync root yaml_uri
\ master_repository profiles pkgdir setsdir securitydir newsdir
\ names_cache sync sync_options eclassdirs cache write_cache
- \ world provides_cache importance layout
+ \ world provides_cache importance layout use_manifest
+
+syn keyword PaludisRepositoriesConfKnownValue contained
+ \ use require ignore
syn match PaludisRepositoriesConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
hi def link PaludisRepositoriesConfKnownKey Keyword
+hi def link PaludisRepositoriesConfKnownValue Keyword
hi def link PaludisRepositoriesConfString String
hi def link PaludisRepositoriesConfUnquoted Constant
hi def link PaludisRepositoriesConfVariable Identifier