aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-04 20:25:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-04 20:25:34 +0000
commit3caef7b22c4eaee861f0f655d5c1650652b7d2c6 (patch)
tree9b472d0447d1b824c574e594d9ee05e704a20ca1 /src
parent8e76744365a37d8cf9816764377cbdd26592e568 (diff)
downloadpaludis-3caef7b22c4eaee861f0f655d5c1650652b7d2c6.tar.gz
paludis-3caef7b22c4eaee861f0f655d5c1650652b7d2c6.tar.xz
Bye bye importare
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/resolve_cmdline.cc4
-rw-r--r--src/clients/importare/Makefile.am49
-rw-r--r--src/clients/importare/command_line.cc126
-rw-r--r--src/clients/importare/command_line.hh73
-rw-r--r--src/clients/importare/importare.cc278
-rw-r--r--src/clients/importare/install.cc159
-rw-r--r--src/clients/importare/install.hh31
-rw-r--r--src/clients/importare/man_importare.cc79
8 files changed, 2 insertions, 797 deletions
diff --git a/src/clients/cave/resolve_cmdline.cc b/src/clients/cave/resolve_cmdline.cc
index b2cead475..c255b57e3 100644
--- a/src/clients/cave/resolve_cmdline.cc
+++ b/src/clients/cave/resolve_cmdline.cc
@@ -109,7 +109,7 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
("auto", 'a', "If the target is a set, if-same, otherwise never")
("never", 'n', "Never")
("if-transient", 't', "Only if the installed package is transient "
- "(e.g. from 'importare')")
+ "(e.g. from 'cave import')")
("if-same", 's', "If it is the same as the proposed replacement (that is, if it has the same "
"version, and no non-special use flags or choices have had their values changed)")
("if-same-version", 'v', "If it is the same version as the proposed replacement")
@@ -122,7 +122,7 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
args::EnumArg::EnumArgOptions
("never", 'n', "Never")
("if-transient", 't', "Only if the installed package is transient "
- "(e.g. from 'importare') (default if --everything)")
+ "(e.g. from 'cave import') (default if --everything)")
("if-same", 's', "If it is the same as the proposed replacement (that is, if it has the same "
"version, and no non-special use flags or choices have had their values changed) (default if --complete)")
("if-same-version", 'v', "If it is the same version as the proposed replacement")
diff --git a/src/clients/importare/Makefile.am b/src/clients/importare/Makefile.am
deleted file mode 100644
index 96e3735f2..000000000
--- a/src/clients/importare/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-include $(top_srcdir)/misc/common-makefile.am
-
-AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src \
- @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
-
-SUBDIRS = .
-
-bin_PROGRAMS = importare
-noinst_PROGRAMS = man-importare
-man_MANS = importare.1
-
-importare.1 : man-importare
- ./man-importare > $@
-
-man_importare_SOURCES = \
- man_importare.cc \
- command_line.hh \
- command_line.cc
-
-man_importare_LDADD = \
- $(top_builddir)/paludis/args/legacy/libpaludisargslegacy_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/args/libpaludisargs_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/src/output/liboutput.a \
- $(DYNAMIC_LD_LIBS)
-
-importare_SOURCES = \
- command_line.hh command_line.cc \
- install.hh install.cc \
- importare.cc
-
-importare_LDADD = \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/legacy/libpaludislegacy_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/args/legacy/libpaludisargslegacy_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/args/libpaludisargs_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/src/output/liboutput.a \
- $(DYNAMIC_LD_LIBS)
-
-TESTS =
-
-EXTRA_DIST = \
- $(man_MANS) \
- $(TESTS)
-
-DISTCLEANFILES = $(man_MANS) $(noinst_DATA)
-
diff --git a/src/clients/importare/command_line.cc b/src/clients/importare/command_line.cc
deleted file mode 100644
index 8da5ac210..000000000
--- a/src/clients/importare/command_line.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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
- */
-
-#include "command_line.hh"
-#include <paludis/util/singleton-impl.hh>
-
-using namespace paludis;
-
-template class paludis::Singleton<CommandLine>;
-
-CommandLine::CommandLine() :
- ArgsHandler(),
-
- action_args(main_options_section(), "Actions",
- "Selects which basic action to perform. Exactly one action should "
- "be specified."),
- a_install(&action_args, "install", 'i', "Install one or more packages (default)", false),
- a_version(&action_args, "version", 'V', "Display program version", false),
- a_help(&action_args, "help", 'h', "Display program help", false),
-
- general_args(main_options_section(), "General options",
- "Options which are relevant for most or all actions."),
- a_log_level(&general_args, "log-level", '\0'),
- a_no_colour(&general_args, "no-colour", '\0', "Do not use colour", false),
- a_no_color(&a_no_colour, "no-color"),
- a_force_colour(&general_args, "force-colour", '\0', "Force the use of colour", false),
- a_force_color(&a_force_colour, "force-color"),
- a_environment(&general_args, "environment", 'E', "Environment specification (class:suffix, both parts optional)"),
- a_compact(&general_args, "compact", '\0', "Display output using one line per entry", true),
-
- source_args(main_options_section(), "Source options",
- "Options affecting the source image"),
- a_location(&source_args, "location", 'l', "Location of source image (default: current directory)"),
- a_install_under(&source_args, "install-under", 'u', "Install under a given directory (default: /)"),
- a_rewrite_ids_over_to_root(&source_args, "rewrite-ids-over-to-root", 'r',
- "Change any UID or GID over this value to 0 (-1 disables, default)"),
-
- metadata_args(main_options_section(), "Metadata options",
- "Options affecting generated metadata"),
- a_description(&metadata_args, "description", 'D', "Specify a package description"),
- a_build_dependency(&metadata_args, "build-dependency", 'B', "Specify a build dependency"),
- a_run_dependency(&metadata_args, "run-dependency", 'R', "Specify a run dependency"),
- a_preserve_metadata(&metadata_args, "preserve-metadata", 'P', "If replacing a package, copy its description and dependencies", true),
-
- install_args(main_options_section(), "Install options",
- "Options which are relevant for --install"),
-
- dl_args(main_options_section())
-{
- add_usage_line("[ --install ] [ --location path/ ] category/package [ version ] [ slot ]");
-
- install_args.a_add_to_world_spec.remove();
- install_args.a_fetch.remove();
- install_args.a_no_safe_resume.remove();
-
- dl_args.dl_reinstall_targets.remove();
-
- add_environment_variable("IMPORTARE_OPTIONS", "Default command-line options.");
-
- add_note(
- "importare requires a repository with format 'installed_unpackaged' configured and available. It cannot use "
- "a standard VDB or suchlike because there is no ebuild available.");
- add_note(
- "Packages installed using importare will not be visible to broken ebuilds that illegally access the VDB. "
- "This means that things like 'built_with_use' will not realise that the package is installed.");
-
- add_note("Importare is deprecated. Use 'cave import' instead.");
-
- add_example(
- "importare --location img/ unpackaged/myapp 1.23",
- "Install the contents of img/ (which could be produced, for example, using 'sudo make DESTDIR=img/ install' "
- "from an autotools package) as 'unpackaged/myapp' version 1.23. If 'unpackaged/myapp' is already installed, "
- "it will be replaced.");
- add_example(
- "importare --location img/ unpackaged/myapp 1.23 --run-dependency dev-libs/mpfr --run-dependency dev-libs/gmp",
- "As above, and add dependencies. Dependencies are used for resolution and to provide correct output for "
- "paludis --uninstall(-unused).");
- add_example(
- "importare --location img/ unpackaged/myapp 1.23 --preserve-metadata",
- "If an existing version of unpackaged/myapp was installed using importare, copies metadata (build and run "
- "dependencies, and description) from that version.");
- add_example(
- "importare --location /var/empty sys-apps/portage 2.2",
- "Install an empty fake package named 'sys-apps/portage', version 2.2. DANGEROUS!");
-}
-
-std::string
-CommandLine::app_name() const
-{
- return "importare";
-}
-
-std::string
-CommandLine::app_synopsis() const
-{
- return "The deprecated Paludis unpackaged package installer";
-}
-
-std::string
-CommandLine::app_description() const
-{
- return
- "importare can be used to manage packages where no real package file is available. Importare is "
- "deprecated; use 'cave import' instead.";
-}
-
-CommandLine::~CommandLine()
-{
-}
-
diff --git a/src/clients/importare/command_line.hh b/src/clients/importare/command_line.hh
deleted file mode 100644
index 9303265f6..000000000
--- a/src/clients/importare/command_line.hh
+++ /dev/null
@@ -1,73 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008, 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
- */
-
-#ifndef PALUDIS_GUARD_SRC_CLIENTS_IMPORTARE_COMMAND_LINE_HH
-#define PALUDIS_GUARD_SRC_CLIENTS_IMPORTARE_COMMAND_LINE_HH 1
-
-#include <paludis/args/args.hh>
-#include <paludis/util/singleton.hh>
-#include <paludis/args/legacy/dep_list_args_group.hh>
-#include <paludis/args/legacy/install_args_group.hh>
-#include <paludis/args/log_level_arg.hh>
-
-class CommandLine :
- public paludis::args::ArgsHandler,
- public paludis::Singleton<CommandLine>
-{
- friend class paludis::Singleton<CommandLine>;
-
- private:
- CommandLine();
- ~CommandLine();
-
- public:
- virtual std::string app_name() const;
- virtual std::string app_synopsis() const;
- virtual std::string app_description() const;
-
- paludis::args::ArgsGroup action_args;
- paludis::args::SwitchArg a_install;
- paludis::args::SwitchArg a_version;
- paludis::args::SwitchArg a_help;
-
- paludis::args::ArgsGroup general_args;
- paludis::args::LogLevelArg a_log_level;
- paludis::args::SwitchArg a_no_colour;
- paludis::args::AliasArg a_no_color;
- paludis::args::SwitchArg a_force_colour;
- paludis::args::AliasArg a_force_color;
- paludis::args::StringArg a_environment;
- paludis::args::SwitchArg a_compact;
-
- paludis::args::ArgsGroup source_args;
- paludis::args::StringArg a_location;
- paludis::args::StringArg a_install_under;
- paludis::args::IntegerArg a_rewrite_ids_over_to_root;
-
- paludis::args::ArgsGroup metadata_args;
- paludis::args::StringArg a_description;
- paludis::args::StringSetArg a_build_dependency;
- paludis::args::StringSetArg a_run_dependency;
- paludis::args::SwitchArg a_preserve_metadata;
-
- paludis::args::InstallArgsGroup install_args;
- paludis::args::DepListArgsGroup dl_args;
-};
-
-#endif
diff --git a/src/clients/importare/importare.cc b/src/clients/importare/importare.cc
deleted file mode 100644
index a831e3179..000000000
--- a/src/clients/importare/importare.cc
+++ /dev/null
@@ -1,278 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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
- */
-
-#include "command_line.hh"
-#include "install.hh"
-
-#include <paludis/args/do_help.hh>
-#include <src/output/colour.hh>
-
-#include <paludis/environment_factory.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/about.hh>
-#include <paludis/repository_factory.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/selection.hh>
-#include <paludis/user_dep_spec.hh>
-#include <paludis/unformatted_pretty_printer.hh>
-
-#include <algorithm>
-#include <iterator>
-#include <iostream>
-#include <vector>
-
-using namespace paludis;
-using std::cout;
-using std::cerr;
-using std::endl;
-
-namespace
-{
- struct DoVersion
- {
- };
-
- void display_version()
- {
- cout << "importare, part of " << PALUDIS_PACKAGE << " " << PALUDIS_VERSION_MAJOR << "."
- << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO << PALUDIS_VERSION_SUFFIX;
- if (! std::string(PALUDIS_GIT_HEAD).empty())
- cout << " git " << PALUDIS_GIT_HEAD;
- cout << endl;
- }
-
- 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;
- }
-}
-
-int
-main(int argc, char *argv[])
-{
- std::string options(paludis::getenv_with_default("IMPORTARE_OPTIONS", ""));
- if (! options.empty())
- options = "(" + options + ") ";
- options += join(argv + 1, argv + argc, " ");
-
- Context context(std::string("In program ") + argv[0] + " " + options + ":");
-
- Log::get_instance()->message("importare.deprecated", ll_warning, lc_context)
- << "importare is deprecated. Use 'cave import' instead.";
-
- try
- {
- CommandLine::get_instance()->run(argc, argv, "importare", "IMPORTARE_OPTIONS", "IMPORTARE_CMDLINE");
- set_use_colour(! CommandLine::get_instance()->a_no_colour.specified());
- set_force_colour(CommandLine::get_instance()->a_force_colour.specified());
-
- if (CommandLine::get_instance()->a_help.specified())
- throw args::DoHelp();
-
- if (CommandLine::get_instance()->a_version.specified())
- throw DoVersion();
-
- if (CommandLine::get_instance()->a_log_level.specified())
- Log::get_instance()->set_log_level(CommandLine::get_instance()->a_log_level.option());
- else
- Log::get_instance()->set_log_level(ll_qa);
-
- Log::get_instance()->set_program_name(argv[0]);
-
- /* need at most one action */
- if (1 < (
- CommandLine::get_instance()->a_install.specified()
- ))
- throw args::DoHelp("you should specify at most one action");
-
- std::string paludis_command("paludis"), env_spec;
-
- if (CommandLine::get_instance()->a_environment.specified())
- {
- env_spec = CommandLine::get_instance()->a_environment.argument();
- paludis_command.append(" --" + CommandLine::get_instance()->a_environment.long_name() + " " +
- CommandLine::get_instance()->a_environment.argument());
- }
-
- paludis_command.append(" --" + CommandLine::get_instance()->a_log_level.long_name() + " " +
- CommandLine::get_instance()->a_log_level.argument());
-
- if (CommandLine::get_instance()->a_no_color.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_no_color.long_name());
-
- if (CommandLine::get_instance()->a_force_color.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_force_color.long_name());
-
- paludis_command.append(CommandLine::get_instance()->install_args.paludis_command_fragment());
- paludis_command.append(CommandLine::get_instance()->dl_args.paludis_command_fragment());
-
- std::shared_ptr<Environment> env(EnvironmentFactory::get_instance()->create(env_spec));
- env->set_paludis_command(paludis_command);
-
- std::vector<std::string> params(
- CommandLine::get_instance()->begin_parameters(),
- CommandLine::get_instance()->end_parameters());
-
- if ((params.size() > 3) || (params.size() < 1))
- throw args::DoHelp("install action takes between one and three parameters (cat/pkg version slot)");
-
- QualifiedPackageName q(params[0]);
- VersionSpec v(params.size() >= 2 ? params[1] : "0", user_version_spec_options());
- SlotName s(params.size() >= 3 ? params[2] : "0");
-
- std::string build_dependencies, run_dependencies, description;
-
- if (CommandLine::get_instance()->a_preserve_metadata.specified())
- {
- std::shared_ptr<const PackageIDSequence> old_ids((*env)[selection::AllVersionsSorted(generator::Package(q))]);
- std::shared_ptr<const PackageID> old_id;
- for (PackageIDSequence::ConstIterator i(old_ids->begin()), i_end(old_ids->end()) ;
- i != i_end ; ++i)
- {
- auto repo(env->package_database()->fetch_repository((*i)->repository_name()));
- if (! repo->format_key())
- continue;
- if (repo->format_key()->value() != "installed_unpackaged")
- continue;
- old_id = *i;
- break;
- }
-
- if (! old_id)
- throw args::DoHelp("--" + CommandLine::get_instance()->a_preserve_metadata.long_name() + " specified but "
- "no old ID available");
-
- if (old_id->short_description_key())
- description = old_id->short_description_key()->value();
- if (old_id->build_dependencies_key())
- build_dependencies = old_id->build_dependencies_key()->pretty_print_value(UnformattedPrettyPrinter(), { });
- if (old_id->run_dependencies_key())
- run_dependencies = old_id->run_dependencies_key()->pretty_print_value(UnformattedPrettyPrinter(), { });
- }
-
- if (CommandLine::get_instance()->a_description.specified())
- description = CommandLine::get_instance()->a_description.argument();
- if (CommandLine::get_instance()->a_build_dependency.specified())
- build_dependencies = join(
- CommandLine::get_instance()->a_build_dependency.begin_args(),
- CommandLine::get_instance()->a_build_dependency.end_args(), ", ");
- if (CommandLine::get_instance()->a_run_dependency.specified())
- run_dependencies = join(
- CommandLine::get_instance()->a_run_dependency.begin_args(),
- CommandLine::get_instance()->a_run_dependency.end_args(), ", ");
-
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("location", stringify(
- CommandLine::get_instance()->a_location.specified() ?
- FSPath(CommandLine::get_instance()->a_location.argument()) :
- FSPath::cwd()));
- keys->insert("install_under", stringify(
- CommandLine::get_instance()->a_install_under.specified() ?
- FSPath(CommandLine::get_instance()->a_install_under.argument()) :
- FSPath("/")));
- keys->insert("rewrite_ids_over_to_root", stringify(
- CommandLine::get_instance()->a_rewrite_ids_over_to_root.specified() ?
- CommandLine::get_instance()->a_rewrite_ids_over_to_root.argument() : -1));
- keys->insert("format", "unpackaged");
- keys->insert("name", stringify(q));
- keys->insert("version", stringify(v));
- keys->insert("slot", stringify(s));
- keys->insert("description", description);
- keys->insert("build_dependencies", build_dependencies);
- keys->insert("run_dependencies", run_dependencies);
- std::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(env.get(),
- std::bind(from_keys, keys, std::placeholders::_1)));
- env->package_database()->add_repository(10, repo);
- std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(q));
- if (1 != std::distance(ids->begin(), ids->end()))
- throw InternalError(PALUDIS_HERE, "ids is '" + join(indirect_iterator(ids->begin()), indirect_iterator(
- ids->end()), " ") + "'");
-
- return do_install(env, *ids->begin());
- }
- catch (const DoVersion &)
- {
- display_version();
- cout << endl;
- cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
- cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
- cout << "License, version 2." << endl;
-
- return EXIT_SUCCESS;
- }
- catch (const paludis::args::ArgsError & e)
- {
- cerr << "Usage error: " << e.message() << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- catch (const args::DoHelp & h)
- {
- if (h.message.empty())
- {
- cout << "Usage: " << argv[0] << " [options]" << endl;
- cout << endl;
- cout << *CommandLine::get_instance();
- return EXIT_SUCCESS;
- }
- else
- {
- cerr << "Usage error: " << h.message << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- }
- catch (const Exception & e)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.backtrace("\n * ")
- << e.message() << " (" << e.what() << ")" << endl;
- return EXIT_FAILURE;
- }
- catch (const std::exception & e)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.what() << endl;
- return EXIT_FAILURE;
- }
- catch (...)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * Unknown exception type. Ouch..." << endl;
- return EXIT_FAILURE;
- }
-}
-
-
diff --git a/src/clients/importare/install.cc b/src/clients/importare/install.cc
deleted file mode 100644
index 24a36e474..000000000
--- a/src/clients/importare/install.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008, 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
- */
-
-#include "install.hh"
-#include "command_line.hh"
-#include <src/output/console_install_task.hh>
-#include <paludis/args/do_help.hh>
-
-#include <iostream>
-#include <cstdlib>
-#include <cstring>
-
-#include <paludis/legacy/install_task.hh>
-#include <paludis/legacy/tasks_exceptions.hh>
-
-#include <paludis/util/log.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/set.hh>
-
-#include <paludis/hook.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
-#include <paludis/mask.hh>
-#include <paludis/action.hh>
-#include <paludis/name.hh>
-#include <paludis/choice.hh>
-
-using namespace paludis;
-
-using std::cerr;
-using std::cout;
-using std::endl;
-
-namespace
-{
- class OurInstallTask :
- public ConsoleInstallTask
- {
- private:
- std::shared_ptr<Environment> _env;
-
- public:
- OurInstallTask(std::shared_ptr<Environment> env, const DepListOptions & options,
- std::shared_ptr<const DestinationsSet> destinations) :
- ConsoleInstallTask(env.get(), options, destinations),
- _env(env)
- {
- }
-
- virtual bool want_full_install_reasons() const
- {
- return CommandLine::get_instance()->install_args.want_full_install_reasons();
- }
-
- virtual bool want_tags_summary() const
- {
- return CommandLine::get_instance()->install_args.want_tags_summary();
- }
-
- virtual bool want_install_reasons() const
- {
- return CommandLine::get_instance()->install_args.want_install_reasons();
- }
-
- virtual bool want_unchanged_use_flags() const
- {
- return CommandLine::get_instance()->install_args.want_unchanged_use_flags();
- }
-
- virtual bool want_changed_use_flags() const
- {
- return CommandLine::get_instance()->install_args.want_changed_use_flags();
- }
-
- virtual bool want_new_use_flags() const
- {
- return CommandLine::get_instance()->install_args.want_new_use_flags();
- }
-
- virtual bool want_use_summary() const
- {
- return CommandLine::get_instance()->install_args.want_use_summary();
- }
-
- virtual bool want_compact() const
- {
- return CommandLine::get_instance()->a_compact.specified();
- }
-
- virtual bool want_suggestions() const
- {
- return false;
- }
-
- virtual bool want_new_descriptions() const
- {
- return CommandLine::get_instance()->install_args.want_new_descriptions();
- }
-
- virtual bool want_existing_descriptions() const
- {
- return CommandLine::get_instance()->install_args.want_existing_descriptions();
- }
-
- virtual std::string make_resume_command(const bool) const
- {
- return "";
- }
-
- void show_resume_command() const
- {
- }
- };
-}
-
-int
-do_install(const std::shared_ptr<Environment> & env, const std::shared_ptr<const PackageID> & target)
-{
- Context context("When performing install action from command line:");
-
- CommandLine::get_instance()->install_args.a_add_to_world_spec.set_specified(true);
- CommandLine::get_instance()->install_args.a_add_to_world_spec.set_argument(stringify(target->name()));
-
- DepListOptions options;
- CommandLine::get_instance()->dl_args.populate_dep_list_options(env.get(), options);
- CommandLine::get_instance()->install_args.populate_dep_list_options(env.get(), options);
-
- OurInstallTask task(env, options, CommandLine::get_instance()->install_args.destinations(env.get()));
- CommandLine::get_instance()->install_args.populate_install_task(env.get(), task);
- CommandLine::get_instance()->dl_args.populate_install_task(env.get(), task);
-
- std::shared_ptr<PackageIDSequence> targets(std::make_shared<PackageIDSequence>());
- targets->push_back(target);
- task.set_targets_from_exact_packages(targets);
- task.execute();
-
- cout << endl;
-
- return task.exit_status();
-}
-
-
diff --git a/src/clients/importare/install.hh b/src/clients/importare/install.hh
deleted file mode 100644
index 2f00ae0f8..000000000
--- a/src/clients/importare/install.hh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008 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
- */
-
-#ifndef PALUDIS_GUARD_SRC_CLIENTS_IMPORTARE_INSTALL_HH
-#define PALUDIS_GUARD_SRC_CLIENTS_IMPORTARE_INSTALL_HH 1
-
-#include <paludis/environment-fwd.hh>
-#include <paludis/package_id-fwd.hh>
-#include <memory>
-
-int do_install(
- const std::shared_ptr<paludis::Environment> &,
- const std::shared_ptr<const paludis::PackageID> & target);
-
-#endif
diff --git a/src/clients/importare/man_importare.cc b/src/clients/importare/man_importare.cc
deleted file mode 100644
index 2917ce694..000000000
--- a/src/clients/importare/man_importare.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2009 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
- */
-
-#include "command_line.hh"
-#include <paludis/args/man.hh>
-
-#include <iostream>
-#include <cstdlib>
-
-using std::cout;
-using std::endl;
-
-namespace
-{
- struct ManCommandLine :
- paludis::args::ArgsHandler
- {
- paludis::args::ArgsGroup group;
- paludis::args::SwitchArg a_html;
-
- ManCommandLine() :
- group(main_options_section(), "", ""),
- a_html(&group, "html", '\0', "", false)
- {
- }
-
- virtual std::string app_name() const
- {
- return "";
- }
-
- virtual std::string app_description() const
- {
- return "";
- }
-
- virtual std::string app_synopsis() const
- {
- return "";
- }
- };
-}
-
-int
-main(int argc, char * argv[])
-{
- ManCommandLine cmdline;
- cmdline.run(argc, argv, "", "", "");
-
- if (cmdline.a_html.specified())
- {
- paludis::args::HtmlWriter hw(cout);
- paludis::args::generate_doc(hw, CommandLine::get_instance());
- }
- else
- {
- paludis::args::ManWriter mw(cout);
- paludis::args::generate_doc(mw, CommandLine::get_instance());
- }
-
- return EXIT_SUCCESS;
-}
-