diff options
author | 2015-10-31 14:41:39 +0000 | |
---|---|---|
committer | 2015-11-05 17:37:15 +0000 | |
commit | dfc9acb9553cb661eb69c4fd7127e2d54f5c6104 (patch) | |
tree | e2e187f7048e7032d5b2e3edfb19a2c816c4c5a4 | |
parent | 080751d44a081d5a974d7406a9f79b63f67604e8 (diff) | |
download | paludis-dfc9acb9553cb661eb69c4fd7127e2d54f5c6104.tar.gz paludis-dfc9acb9553cb661eb69c4fd7127e2d54f5c6104.tar.xz |
Add stub for EAPI 6
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | paludis/repositories/e/Makefile.am | 17 | ||||
-rw-r--r-- | paludis/repositories/e/e_repository_TEST_6.cc | 137 | ||||
-rwxr-xr-x | paludis/repositories/e/e_repository_TEST_6_cleanup.sh | 9 | ||||
-rwxr-xr-x | paludis/repositories/e/e_repository_TEST_6_setup.sh | 37 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/6.conf | 11 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/Makefile.am | 2 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild/6/Makefile.am | 14 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild/6/output_functions.bash | 33 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild/Makefile.am | 2 | ||||
-rw-r--r-- | paludis/util/echo_functions.bash.in | 1 |
11 files changed, 262 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 1a6b8dd11..5d020cce1 100644 --- a/configure.ac +++ b/configure.ac @@ -1335,6 +1335,7 @@ AC_CONFIG_FILES([ paludis/repositories/e/ebuild/3/Makefile paludis/repositories/e/ebuild/4/Makefile paludis/repositories/e/ebuild/5/Makefile + paludis/repositories/e/ebuild/6/Makefile paludis/repositories/e/ebuild/Makefile paludis/repositories/e/ebuild/exheres-0/Makefile paludis/repositories/e/ebuild/paludis-1/Makefile diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am index 9ffaa8760..99c71f83d 100644 --- a/paludis/repositories/e/Makefile.am +++ b/paludis/repositories/e/Makefile.am @@ -307,6 +307,18 @@ e_repository_TEST_5_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_ e_repository_TEST_5_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@ +e_repository_TEST_6_SOURCES = e_repository_TEST_6.cc + +e_repository_TEST_6_LDADD = \ + $(top_builddir)/paludis/util/gtest_runner.o \ + $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \ + $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \ + $(DYNAMIC_LD_LIBS) + +e_repository_TEST_6_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@ + +e_repository_TEST_6_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@ + e_repository_TEST_phases_SOURCES = e_repository_TEST_phases.cc e_repository_TEST_phases_LDADD = \ @@ -547,6 +559,9 @@ EXTRA_DIST = \ e_repository_TEST_5.cc \ e_repository_TEST_5_setup.sh \ e_repository_TEST_5_cleanup.sh \ + e_repository_TEST_6.cc \ + e_repository_TEST_6_setup.sh \ + e_repository_TEST_6_cleanup.sh \ e_repository_TEST_pbin.cc \ e_repository_TEST_pbin_setup.sh \ e_repository_TEST_pbin_cleanup.sh \ @@ -620,6 +635,7 @@ check_SCRIPTS = \ e_repository_TEST_3_setup.sh e_repository_TEST_3_cleanup.sh \ e_repository_TEST_4_setup.sh e_repository_TEST_4_cleanup.sh \ e_repository_TEST_5_setup.sh e_repository_TEST_5_cleanup.sh \ + e_repository_TEST_6_setup.sh e_repository_TEST_6_cleanup.sh \ e_repository_TEST_pbin_setup.sh e_repository_TEST_pbin_cleanup.sh \ e_repository_TEST_phases_setup.sh e_repository_TEST_phases_cleanup.sh \ e_repository_TEST_exlibs_setup.sh e_repository_TEST_exlibs_cleanup.sh \ @@ -709,6 +725,7 @@ TESTS = \ e_repository_TEST_3 \ e_repository_TEST_4 \ e_repository_TEST_5 \ + e_repository_TEST_6 \ e_repository_TEST_ever \ e_repository_TEST_exheres_0 \ e_repository_TEST_exlibs \ diff --git a/paludis/repositories/e/e_repository_TEST_6.cc b/paludis/repositories/e/e_repository_TEST_6.cc new file mode 100644 index 000000000..467a7f7fc --- /dev/null +++ b/paludis/repositories/e/e_repository_TEST_6.cc @@ -0,0 +1,137 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Ciaran McCreesh + * Copyright (c) 2015 David Leverton + * + * 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 <paludis/repositories/e/e_repository.hh> +#include <paludis/repositories/e/e_repository_exceptions.hh> +#include <paludis/repositories/e/e_repository_id.hh> +#include <paludis/repositories/e/vdb_repository.hh> +#include <paludis/repositories/e/eapi.hh> +#include <paludis/repositories/e/spec_tree_pretty_printer.hh> + +#include <paludis/repositories/fake/fake_installed_repository.hh> +#include <paludis/repositories/fake/fake_package_id.hh> + +#include <paludis/environments/test/test_environment.hh> + + +#include <paludis/util/system.hh> +#include <paludis/util/visitor_cast.hh> +#include <paludis/util/map.hh> +#include <paludis/util/make_named_values.hh> +#include <paludis/util/set.hh> +#include <paludis/util/safe_ifstream.hh> +#include <paludis/util/stringify.hh> + +#include <paludis/standard_output_manager.hh> +#include <paludis/package_id.hh> +#include <paludis/metadata_key.hh> +#include <paludis/action.hh> +#include <paludis/user_dep_spec.hh> +#include <paludis/generator.hh> +#include <paludis/filter.hh> +#include <paludis/filtered_generator.hh> +#include <paludis/selection.hh> +#include <paludis/repository_factory.hh> +#include <paludis/choice.hh> +#include <paludis/slot.hh> +#include <paludis/unformatted_pretty_printer.hh> + +#include <functional> +#include <set> +#include <string> + +#include "config.h" + +#include <gtest/gtest.h> + +using namespace paludis; + +namespace +{ + void cannot_uninstall(const std::shared_ptr<const PackageID> & id, const UninstallActionOptions &) + { + if (id) + throw InternalError(PALUDIS_HERE, "cannot uninstall"); + } + + std::shared_ptr<OutputManager> make_standard_output_manager(const Action &) + { + return std::make_shared<StandardOutputManager>(); + } + + std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m, + const std::string & k) + { + Map<std::string, std::string>::ConstIterator mm(m->find(k)); + if (m->end() == mm) + return ""; + else + return mm->second; + } + + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } +} + +TEST(ERepository, InstallEAPI6) +{ + TestEnvironment env; + std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>()); + keys->insert("format", "e"); + keys->insert("names_cache", "/var/empty"); + keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_6_dir" / "repo")); + keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_6_dir" / "repo/profiles/profile")); + keys->insert("layout", "traditional"); + keys->insert("eapi_when_unknown", "0"); + keys->insert("eapi_when_unspecified", "0"); + keys->insert("profile_eapi", "0"); + keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_6_dir" / "distdir")); + keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_6_dir" / "build")); + std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env, + std::bind(from_keys, keys, std::placeholders::_1))); + env.add_repository(1, repo); + + std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>( + make_named_values<FakeInstalledRepositoryParams>( + n::environment() = &env, + n::name() = RepositoryName("installed"), + n::suitable_destination() = true, + n::supports_uninstall() = true + ))); + env.add_repository(2, installed_repo); + + InstallAction action(make_named_values<InstallActionOptions>( + n::destination() = installed_repo, + n::make_output_manager() = &make_standard_output_manager, + n::perform_uninstall() = &cannot_uninstall, + n::replacing() = std::make_shared<PackageIDSequence>(), + n::want_phase() = &want_all_phases + )); + + PretendAction pretend_action(make_named_values<PretendActionOptions>( + n::destination() = installed_repo, + n::make_output_manager() = &make_standard_output_manager, + n::replacing() = std::make_shared<PackageIDSequence>() + )); + +} + diff --git a/paludis/repositories/e/e_repository_TEST_6_cleanup.sh b/paludis/repositories/e/e_repository_TEST_6_cleanup.sh new file mode 100755 index 000000000..3b57b3f1a --- /dev/null +++ b/paludis/repositories/e/e_repository_TEST_6_cleanup.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# vim: set ft=sh sw=4 sts=4 et : + +if [ -d e_repository_TEST_6_dir ] ; then + rm -fr e_repository_TEST_6_dir +else + true +fi + diff --git a/paludis/repositories/e/e_repository_TEST_6_setup.sh b/paludis/repositories/e/e_repository_TEST_6_setup.sh new file mode 100755 index 000000000..e91dd1baf --- /dev/null +++ b/paludis/repositories/e/e_repository_TEST_6_setup.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# vim: set ft=sh sw=4 sts=4 et : + +mkdir e_repository_TEST_6_dir || exit 1 +cd e_repository_TEST_6_dir || exit 1 + +mkdir -p root/etc + +mkdir -p vdb +touch vdb/THISISTHEVDB + +mkdir -p build +ln -s build symlinked_build + +mkdir -p distdir + +mkdir -p repo/{profiles/profile,metadata,eclass} || exit 1 +cd repo || exit 1 +echo "test-repo" >> profiles/repo_name || exit 1 +echo "cat" >> profiles/categories || exit 1 +cat <<END > profiles/profile/make.defaults +ARCH="cheese" +USERLAND="GNU" +KERNEL="linux" +LIBC="glibc" +CHOST="i286-badger-linux-gnu" +LINGUAS="enabled_en enabled_en_GB enabled_en_GB@UTF-8" +USE_EXPAND="LINGUAS USERLAND" +USE_EXPAND_UNPREFIXED="ARCH" +USE_EXPAND_IMPLICIT="USERLAND ARCH" +USE_EXPAND_VALUES_USERLAND="GNU" +USE_EXPAND_VALUES_ARCH="cheese otherarch" +IUSE_IMPLICIT="build" +END + +cd .. +cd .. diff --git a/paludis/repositories/e/eapis/6.conf b/paludis/repositories/e/eapis/6.conf new file mode 100644 index 000000000..9408cbb61 --- /dev/null +++ b/paludis/repositories/e/eapis/6.conf @@ -0,0 +1,11 @@ +# Configuration for EAPI 6 (draft) +# EAPI 6 will be specified in PMS. + +source ${PALUDIS_EAPIS_DIR}/5.conf +exported_name = 6 +can_be_pbin = true +is_pbin = false + +ebuild_module_suffixes = 6 5 4 3 2 1 0 +utility_path_suffixes = 6 5 4 3 2 1 0 + diff --git a/paludis/repositories/e/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am index fb069096f..aae1d37c4 100644 --- a/paludis/repositories/e/eapis/Makefile.am +++ b/paludis/repositories/e/eapis/Makefile.am @@ -22,7 +22,7 @@ eapis = \ pbin-1+paludis-1.conf \ pbin-1+exheres-0.conf -future_eapis = +future_eapis = 6.conf eapidir = $(datadir)/paludis/eapis/ diff --git a/paludis/repositories/e/ebuild/6/Makefile.am b/paludis/repositories/e/ebuild/6/Makefile.am new file mode 100644 index 000000000..beaef3346 --- /dev/null +++ b/paludis/repositories/e/ebuild/6/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/misc/common-makefile.am + +SUBDIRS = . + +libexecprog6dir = $(libexecdir)/paludis/6 + +libexecprog6_SCRIPTS = \ + output_functions.bash + +TESTS = +check_SCRIPTS = $(TESTS) + +EXTRA_DIST = $(libexecprog6_SCRIPTS) + diff --git a/paludis/repositories/e/ebuild/6/output_functions.bash b/paludis/repositories/e/ebuild/6/output_functions.bash new file mode 100644 index 000000000..07ea40705 --- /dev/null +++ b/paludis/repositories/e/ebuild/6/output_functions.bash @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# vim: set sw=4 sts=4 et : + +# Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh +# +# 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 + +ebuild_notice() +{ + [[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return + paludis_pipe_command LOG "$EAPI" "$@" >/dev/null +} + +ebuild_section() +{ + [[ -n ${PALUDIS_EBUILD_QUIET} ]] && return + echo -ne "${COLOUR_DARK_CYAN}>>>${COLOUR_NORMAL} " + [[ ${PALUDIS_PIPE_COMMANDS_STATUS_SUPPORTED} == "yes" ]] && \ + paludis_pipe_command LOG "$EAPI" "status" "${COLOUR_DARK_CYAN}>>>${COLOUR_NORMAL} $@" >/dev/null + echo "$@" +} + diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am index 6f438469b..ba17a9356 100644 --- a/paludis/repositories/e/ebuild/Makefile.am +++ b/paludis/repositories/e/ebuild/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/misc/common-makefile.am -SUBDIRS = . 0 1 2 3 4 5 exheres-0 paludis-1 pbin-1 utils +SUBDIRS = . 0 1 2 3 4 5 6 exheres-0 paludis-1 pbin-1 utils AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ diff --git a/paludis/util/echo_functions.bash.in b/paludis/util/echo_functions.bash.in index 21f374b71..4a26cb7fb 100644 --- a/paludis/util/echo_functions.bash.in +++ b/paludis/util/echo_functions.bash.in @@ -34,6 +34,7 @@ COLOUR_BROWN=$'\e[33m' COLOUR_PURPLE=$'\e[35m' COLOUR_DARK_BLUE=$'\e[34m' COLOUR_DARK_GREEN=$'\e[32m' +COLOUR_DARK_CYAN=$'\e[36m' if [[ ${PALUDIS_COLOURS} == pink ]]; then COLOUR_GOOD=${COLOUR_PINK} |