aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-02-21 20:43:56 +0000
committerAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-02-21 20:43:56 +0000
commitdbad9d5f818882b730626028da3943a6c1039ef7 (patch)
tree3d96775139c17f12ec1592a233e13a2ed3083dda /paludis/repositories
parent9567079d3b62aba92acaa7b8e9d4c13a1788b034 (diff)
downloadpaludis-dbad9d5f818882b730626028da3943a6c1039ef7.tar.gz
paludis-dbad9d5f818882b730626028da3943a6c1039ef7.tar.xz
Add PackageID::transient_key and use it to avoid reporting
'unpackaged' packages as 'missing'. Fixes ticket:410
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/cran/cran_package_id.cc7
-rw-r--r--paludis/repositories/cran/cran_package_id.hh1
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc6
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh2
-rw-r--r--paludis/repositories/e/ebuild_id.cc6
-rw-r--r--paludis/repositories/e/ebuild_id.hh2
-rw-r--r--paludis/repositories/e/qa/metadata_keys.cc5
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc4
-rw-r--r--paludis/repositories/fake/fake_package_id.cc6
-rw-r--r--paludis/repositories/fake/fake_package_id.hh1
-rw-r--r--paludis/repositories/gems/gem_specification.cc6
-rw-r--r--paludis/repositories/gems/gem_specification.hh1
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc36
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc6
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.hh1
-rw-r--r--paludis/repositories/virtuals/package_id.cc6
-rw-r--r--paludis/repositories/virtuals/package_id.hh1
18 files changed, 98 insertions, 0 deletions
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index dedde5079..bee81d7b5 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -548,3 +548,10 @@ CRANPackageID::size_of_all_distfiles_key() const
{
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+CRANPackageID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
diff --git a/paludis/repositories/cran/cran_package_id.hh b/paludis/repositories/cran/cran_package_id.hh
index e19649db5..6f94af2ec 100644
--- a/paludis/repositories/cran/cran_package_id.hh
+++ b/paludis/repositories/cran/cran_package_id.hh
@@ -78,6 +78,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index b69f5b399..e600104a9 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -520,6 +520,12 @@ EInstalledRepositoryID::license_key() const
return _imp->license;
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+EInstalledRepositoryID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
const tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
EInstalledRepositoryID::inherited_key() const
{
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index e905fffd0..be1ec221b 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -86,6 +86,8 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
+
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 9b14a25af..90768322f 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -528,6 +528,12 @@ EbuildID::use_key() const
return _imp->use;
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+EbuildID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> >
EbuildID::license_key() const
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 4c5d410cc..f61d0a502 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -91,6 +91,8 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<RestrictSpecTree> > restrict_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
+
virtual bool arbitrary_less_than_comparison(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/qa/metadata_keys.cc b/paludis/repositories/e/qa/metadata_keys.cc
index 8b585fcbc..de70fc6ef 100644
--- a/paludis/repositories/e/qa/metadata_keys.cc
+++ b/paludis/repositories/e/qa/metadata_keys.cc
@@ -46,6 +46,11 @@ namespace
long PALUDIS_ATTRIBUTE((unused)) t(k.value());
}
+ void visit(const MetadataValueKey<bool> & k)
+ {
+ bool PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ }
+
void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
const tr1::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.value());
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index 1af579529..67ec291fe 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -327,6 +327,10 @@ namespace
{
}
+ void visit(const MetadataValueKey<bool> &)
+ {
+ }
+
void visit(const MetadataTimeKey &)
{
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index e8dfb7a1e..bbb0d903b 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -948,6 +948,12 @@ FakePackageID::size_of_all_distfiles_key() const
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+FakePackageID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
char
FakePackageID::use_expand_separator() const
{
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 787bd2db1..b6fa457be 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -223,6 +223,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
const tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords_key();
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index e3faa3031..781dece97 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -456,6 +456,12 @@ GemSpecification::size_of_all_distfiles_key() const
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+GemSpecification::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
bool
GemSpecification::arbitrary_less_than_comparison(const PackageID &) const
{
diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh
index 972c3ff5e..0ef6fe0a4 100644
--- a/paludis/repositories/gems/gem_specification.hh
+++ b/paludis/repositories/gems/gem_specification.hh
@@ -113,6 +113,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 3de053122..d2f061f4c 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -39,6 +39,7 @@
#include <paludis/contents.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/hashed_containers.hh>
#include <fstream>
@@ -517,6 +518,41 @@ InstalledUnpackagedID::size_of_all_distfiles_key() const
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+namespace paludis
+{
+ class InstalledUnpackagedTransientKey :
+ public LiteralMetadataValueKey<bool>
+ {
+ public:
+ InstalledUnpackagedTransientKey(
+ const std::string &,
+ const std::string &,
+ const MetadataKeyType,
+ bool v);
+
+ virtual std::string pretty_print() const;
+ };
+}
+
+InstalledUnpackagedTransientKey::InstalledUnpackagedTransientKey(
+ const std::string & r, const std::string & h, const MetadataKeyType t, bool v) :
+ LiteralMetadataValueKey<bool>(r, h, t, v)
+{
+}
+
+std::string
+InstalledUnpackagedTransientKey::pretty_print() const
+{
+ return stringify(value());
+}
+
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+InstalledUnpackagedID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >(
+ new InstalledUnpackagedTransientKey("transient", "Transient", mkt_internal, true));
+}
+
namespace
{
struct SupportVisitor :
diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh
index 0e2ed5bda..9b103c2de 100644
--- a/paludis/repositories/unpackaged/installed_id.hh
+++ b/paludis/repositories/unpackaged/installed_id.hh
@@ -78,6 +78,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 6ccf5ceb7..594990b42 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -287,6 +287,12 @@ UnpackagedID::size_of_all_distfiles_key() const
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+UnpackagedID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
bool
UnpackagedID::supports_action(const SupportsActionTestBase & test) const
{
diff --git a/paludis/repositories/unpackaged/unpackaged_id.hh b/paludis/repositories/unpackaged/unpackaged_id.hh
index 3c2ab4e12..5dbb3233c 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.hh
+++ b/paludis/repositories/unpackaged/unpackaged_id.hh
@@ -76,6 +76,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 33e5ebc91..f508ded44 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -526,3 +526,9 @@ VirtualsPackageID::size_of_all_distfiles_key() const
return tr1::shared_ptr<const MetadataValueKey<long> >();
}
+const tr1::shared_ptr<const MetadataValueKey<bool> >
+VirtualsPackageID::transient_key() const
+{
+ return tr1::shared_ptr<const MetadataValueKey<bool> >();
+}
+
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index e0b1781db..b840335ad 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -104,6 +104,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;