aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-14 21:17:01 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-14 21:17:01 +0100
commitf851762537b0d2597968b8fc205e9afef26602c3 (patch)
treebe274e25d533ff34abc858668d75222bd1842133
parentc25a27d099a2214cfa3ba7d07b2363a130541820 (diff)
downloadpaludis-f851762537b0d2597968b8fc205e9afef26602c3.tar.gz
paludis-f851762537b0d2597968b8fc205e9afef26602c3.tar.xz
Only unavailable-2 is repository/able
-rwxr-xr-xpaludis/repositories/unavailable/unavailable_repository_TEST_setup.sh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc21
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.hh1
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc53
4 files changed, 51 insertions, 26 deletions
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST_setup.sh b/paludis/repositories/unavailable/unavailable_repository_TEST_setup.sh
index ed18fa7..e9d8b74 100755
--- a/paludis/repositories/unavailable/unavailable_repository_TEST_setup.sh
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST_setup.sh
@@ -10,6 +10,7 @@ END
mkdir -p repo2
cat <<"END" > repo2/foo.repository
+format = unavailable-2
repo_name = foo
cat-one/
@@ -20,6 +21,7 @@ cat-one/
:2 2 ; Two
END
cat <<"END" > repo2/bar.repository
+format = unavailable-2
repo_name = bar
cat-one/
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index 968073e..58da42f 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -43,7 +43,13 @@ namespace paludis
struct Implementation<UnavailableRepositoryFile>
{
std::string repo_name, homepage, description, sync, repo_format;
+ bool autoconfigurable;
Entries entries;
+
+ Implementation() :
+ autoconfigurable(false)
+ {
+ }
};
template <>
@@ -98,7 +104,14 @@ UnavailableRepositoryFile::_load(const FSEntry & f)
{
if (key == "format")
{
- if (value != "unavailable-1")
+ if (value == "unavailable-1")
+ {
+ }
+ else if (value == "unavailable-2")
+ {
+ _imp->autoconfigurable = true;
+ }
+ else
throw UnavailableRepositoryConfigurationError(
"Unsupported format '" + value + "' in '" + stringify(f) + "'");
}
@@ -242,6 +255,12 @@ UnavailableRepositoryFile::repo_format() const
return _imp->repo_format;
}
+bool
+UnavailableRepositoryFile::autoconfigurable() const
+{
+ return _imp->autoconfigurable;
+}
+
template class PrivateImplementationPattern<UnavailableRepositoryFile>;
template class WrappedForwardIterator<UnavailableRepositoryFile::ConstIteratorTag,
const UnavailableRepositoryFileEntry>;
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.hh b/paludis/repositories/unavailable/unavailable_repository_file.hh
index 21036ca..29790f0 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_file.hh
@@ -49,6 +49,7 @@ namespace paludis
std::string description() const PALUDIS_ATTRIBUTE((warn_unused_result));
std::string sync() const PALUDIS_ATTRIBUTE((warn_unused_result));
std::string repo_format() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool autoconfigurable() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index dc9261c..997443e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -188,31 +188,34 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
}
}
- const std::tr1::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(new NoConfigurationInformationMask);
- const std::tr1::shared_ptr<UnavailableRepositoryID> id(new UnavailableRepositoryID(
- make_named_values<UnavailableRepositoryIDParams>(
- value_for<n::description>(repository_description),
- value_for<n::environment>(env),
- value_for<n::format>(repository_format),
- value_for<n::homepage>(repository_homepage),
- value_for<n::mask>(repository_sync && repository_format ?
- make_null_shared_ptr() : no_configuration_mask),
- value_for<n::name>(CategoryNamePart("repository") + PackageNamePart(file.repo_name())),
- value_for<n::repository>(_imp->repo),
- value_for<n::sync>(repository_sync)
- )));
-
- _imp->categories->insert(id->name().category());
- PackageNames::iterator p(_imp->package_names.find(id->name().category()));
- if (_imp->package_names.end() == p)
- p = _imp->package_names.insert(std::make_pair(id->name().category(),
- make_shared_ptr(new QualifiedPackageNameSet))).first;
- p->second->insert(id->name());
-
- IDs::iterator i(_imp->ids.find(id->name()));
- if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(id->name(), make_shared_ptr(new PackageIDSequence))).first;
- i->second->push_back(id);
+ if (file.autoconfigurable())
+ {
+ const std::tr1::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(new NoConfigurationInformationMask);
+ const std::tr1::shared_ptr<UnavailableRepositoryID> id(new UnavailableRepositoryID(
+ make_named_values<UnavailableRepositoryIDParams>(
+ value_for<n::description>(repository_description),
+ value_for<n::environment>(env),
+ value_for<n::format>(repository_format),
+ value_for<n::homepage>(repository_homepage),
+ value_for<n::mask>(repository_sync && repository_format ?
+ make_null_shared_ptr() : no_configuration_mask),
+ value_for<n::name>(CategoryNamePart("repository") + PackageNamePart(file.repo_name())),
+ value_for<n::repository>(_imp->repo),
+ value_for<n::sync>(repository_sync)
+ )));
+
+ _imp->categories->insert(id->name().category());
+ PackageNames::iterator p(_imp->package_names.find(id->name().category()));
+ if (_imp->package_names.end() == p)
+ p = _imp->package_names.insert(std::make_pair(id->name().category(),
+ make_shared_ptr(new QualifiedPackageNameSet))).first;
+ p->second->insert(id->name());
+
+ IDs::iterator i(_imp->ids.find(id->name()));
+ if (_imp->ids.end() == i)
+ i = _imp->ids.insert(std::make_pair(id->name(), make_shared_ptr(new PackageIDSequence))).first;
+ i->second->push_back(id);
+ }
}
bool