aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-07 23:34:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-07 23:34:15 +0000
commitd6ead86413680b85f602053b7d6e87848c7e77f2 (patch)
treeaceedff86a9415f47fb15b5feb0546a819857499
parent154b034f2935a0aca3154baa28084bbd0ef2e02d (diff)
downloadpaludis-d6ead86413680b85f602053b7d6e87848c7e77f2.tar.gz
paludis-d6ead86413680b85f602053b7d6e87848c7e77f2.tar.xz
Start of a QAEnvironment for qualudis
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/qa_environment.cc69
-rw-r--r--paludis/qa_environment.hh59
3 files changed, 129 insertions, 0 deletions
diff --git a/paludis/files.m4 b/paludis/files.m4
index 980d779..73c161c 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -61,6 +61,7 @@ add(`paludis', `hh', `cc')
add(`portage_repository', `hh', `cc')
add(`private_implementation_pattern', `hh', `cc')
add(`pstream', `hh', `cc', `test')
+add(`qa_environment', `hh', `cc')
add(`qualified_package_name', `hh', `cc', `test')
add(`repository', `hh', `cc')
add(`repository_name', `hh', `cc')
diff --git a/paludis/qa_environment.cc b/paludis/qa_environment.cc
new file mode 100644
index 0000000..92f7820
--- /dev/null
+++ b/paludis/qa_environment.cc
@@ -0,0 +1,69 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.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 "qa_environment.hh"
+#include <map>
+
+using namespace paludis;
+
+QAEnvironment::QAEnvironment(const FSEntry & base) :
+ Environment(PackageDatabase::Pointer(new PackageDatabase),
+ PackageDatabase::Pointer(new PackageDatabase))
+{
+ std::map<std::string, std::string> keys;
+
+ keys.insert(std::make_pair(std::string("format"), std::string("portage")));
+ keys.insert(std::make_pair(std::string("importace"), "1"));
+ keys.insert(std::make_pair(std::string("location"), stringify(base)));
+ keys.insert(std::make_pair(std::string("cache"), "/var/empty"));
+ keys.insert(std::make_pair(std::string("profile"), "/etc/make.profile"));
+
+ package_database()->add_repository(
+ RepositoryMaker::get_instance()->find_maker("portage")(
+ package_database().raw_pointer(), keys));
+}
+
+QAEnvironment::~QAEnvironment()
+{
+}
+
+bool
+QAEnvironment::query_use(const UseFlagName &, const PackageDatabaseEntry *) const
+{
+ return false;
+}
+
+bool
+QAEnvironment::accept_keyword(const KeywordName &, const PackageDatabaseEntry * const) const
+{
+ return false;
+}
+
+bool
+QAEnvironment::query_user_masks(const PackageDatabaseEntry &) const
+{
+ return false;
+}
+
+bool
+QAEnvironment::query_user_unmasks(const PackageDatabaseEntry &) const
+{
+ return false;
+}
+
diff --git a/paludis/qa_environment.hh b/paludis/qa_environment.hh
new file mode 100644
index 0000000..7252600
--- /dev/null
+++ b/paludis/qa_environment.hh
@@ -0,0 +1,59 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.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
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_QA_ENVIRONMENT_HH
+#define PALUDIS_GUARD_PALUDIS_QA_ENVIRONMENT_HH 1
+
+#include <paludis/environment.hh>
+#include <paludis/package_database.hh>
+#include <paludis/fs_entry.hh>
+
+/** \file
+ * Declarations for the QAEnvironment class.
+ *
+ * \ingroup Environment
+ */
+
+namespace paludis
+{
+ /**
+ * The QAEnvironment is an Environment that corresponds to the environment
+ * used by Qualudis for QA checks.
+ *
+ * \ingroup Environment
+ */
+ class QAEnvironment :
+ public Environment
+ {
+ public:
+ QAEnvironment(const FSEntry & base);
+
+ ~QAEnvironment();
+
+ virtual bool query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
+
+ virtual bool accept_keyword(const KeywordName &, const PackageDatabaseEntry * const) const;
+
+ virtual bool query_user_masks(const PackageDatabaseEntry &) const;
+
+ virtual bool query_user_unmasks(const PackageDatabaseEntry &) const;
+ };
+}
+
+#endif