diff options
author | 2011-06-16 13:30:06 +0100 | |
---|---|---|
committer | 2011-06-16 13:30:06 +0100 | |
commit | 0465d3dd418e96a3a4c97ffe74dfa52884dd8b2b (patch) | |
tree | 5b8a34a2c56c1dd8da3aad2412ee11a8e696d4c5 | |
parent | ced5a3be44b70a4a1412a201b5b0b578be02de66 (diff) | |
download | paludis-0465d3dd418e96a3a4c97ffe74dfa52884dd8b2b.tar.gz paludis-0465d3dd418e96a3a4c97ffe74dfa52884dd8b2b.tar.xz |
Instruo is dead
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | bash-completion/Makefile.am | 2 | ||||
-rw-r--r-- | bash-completion/instruo | 73 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | doc/clients/Makefile.am | 12 | ||||
-rw-r--r-- | doc/clients/index.html.part | 1 | ||||
-rw-r--r-- | doc/clients/toplinks.html.part.in | 2 | ||||
-rw-r--r-- | doc/index.html.part.in | 1 | ||||
-rw-r--r-- | src/clients/instruo/Makefile.am | 85 | ||||
-rw-r--r-- | src/clients/instruo/command_line.cc | 88 | ||||
-rw-r--r-- | src/clients/instruo/command_line.hh | 62 | ||||
-rwxr-xr-x | src/clients/instruo/help_TEST | 5 | ||||
-rw-r--r-- | src/clients/instruo/instruo.cc | 432 | ||||
-rw-r--r-- | src/clients/instruo/man_instruo.cc | 65 | ||||
-rwxr-xr-x | src/clients/instruo/version_TEST | 4 |
16 files changed, 5 insertions, 840 deletions
diff --git a/.gitignore b/.gitignore index c2e090280..67c126a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -138,7 +138,6 @@ paludis-*.*.*.tar.bz2 /doc/clients/footer.html.part /doc/clients/header.html.part /doc/clients/index.html -/doc/clients/instruo.html /doc/clients/toplinks.html.part /doc/configuration/bashrc.html /doc/configuration/bashrc.html.part @@ -498,10 +497,6 @@ paludis-*.*.*.tar.bz2 !/src/clients/cave/cave.txt /src/clients/cave/*.xml /src/clients/cave/*.html-man-fragment -/src/clients/instruo/instruo -/src/clients/instruo/*.txt -/src/clients/instruo/*.xml -/src/clients/instruo/*.html-man-fragment /stamp-h1 /test/test_fail_TEST /test/test_pass_TEST diff --git a/Makefile.am b/Makefile.am index 87c779c83..02f9de543 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-ruby --enable-ruby-doc --enable-vim \ --with-hacked-log-dir='$${DESTDIR}$${prefix}/log_dir' \ --with-repositories=default,accounts,gemcutter \ --with-environments=default,portage \ - --with-clients=default,accerso,appareo,cave,instruo \ + --with-clients=default,accerso,appareo,cave \ --with-default-distribution=giant-space-monkey \ --enable-htmltidy --enable-search-index diff --git a/bash-completion/Makefile.am b/bash-completion/Makefile.am index 05e5ee93d..1fd86f955 100644 --- a/bash-completion/Makefile.am +++ b/bash-completion/Makefile.am @@ -1,5 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_DATA = accerso instruo cave +noinst_DATA = accerso cave EXTRA_DIST = $(noinst_DATA) AUTOMAKE_OPTIONS = 1.11 parallel-tests diff --git a/bash-completion/instruo b/bash-completion/instruo deleted file mode 100644 index 6f3b8983c..000000000 --- a/bash-completion/instruo +++ /dev/null @@ -1,73 +0,0 @@ -# Bash completion function for instruo -# vim: set et sw=4 sts=4 ts=4 ft=sh : - -# NOTE: This is still a work in progress, don't expect it to work well or -# properly right now. - -_instruo_get_repodir() { - local repodir - [[ -f ./profiles/repo_name ]] && repodir=$(readlink -f $(pwd)) - [[ -z "${repodir}" && -f ../profiles/repo_name ]] \ - && repodir=$(readlink -f $(pwd)/..) - [[ -z "${repodir}" && -f ../../profiles/repo_name ]] \ - && repodir=$(readlink -f $(pwd)/../..) - [[ -z "${repodir}" ]] && return 1 - echo "${repodir}" -} - -_instruo() { - local cur prev opts - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - - # Figure out what our repository dir is - for i in $(seq 0 ${COMP_CWORD}) ; do - if [[ ${COMP_WORDS[i]} == "-D" \ - || ${COMP_WORDS[i]} == "--repository-dir" ]] - then - repodir=${COMP_WORDS[i+1]} - fi - done - [[ -z "${repodir}" ]] && repodir="$(_instruo_get_repodir)" - - opts="--generate-cache -g \ - --version -V \ - --help -h \ - --log-level \ - --no-colour \ - --no-color \ - --repository-dir -D \ - --output-dir -o \ - --extra-repository-dir \ - --master-repository-name \ - --report-file -r" - - case "${cur}" in - -*) - COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) - return 0 - ;; - *) - case "${prev}" in - ## Enum operators - --log-level) - COMPREPLY=($(compgen -W "debug qa warning silent" -- "${cur}")) - return 0 - ;; - - --repository-dir|-D|--output-dir|-o|--extra-repository-dir) - _filedir -d - return 0 - ;; - - --report-file|-r) - _filedir - return 0 - ;; - - esac - ;; - esac -} -complete -o filenames -F _instruo instruo diff --git a/configure.ac b/configure.ac index d704c0420..2f2143e18 100644 --- a/configure.ac +++ b/configure.ac @@ -1582,7 +1582,7 @@ AC_DEFINE_UNQUOTED([DEFAULT_DISTRIBUTION], "$DEFAULT_DISTRIBUTION", [Default dis dnl }}} dnl {{{ clients -ALL_CLIENTS="accerso appareo cave instruo" +ALL_CLIENTS="accerso appareo cave" ALL_CLIENTS_HTML="" for a in $ALL_CLIENTS ; do ALL_CLIENTS_HTML="$ALL_CLIENTS_HTML $a.html" @@ -1597,8 +1597,7 @@ AC_ARG_WITH([clients], accerso A fetch / mirror client appareo A tool for generating manifests - cave The modular Paludis client - instruo A metadata generation client], + cave The modular Paludis client], [clients="`echo $with_clients | tr ',' ' '`"], [clients="$DEFAULT_CLIENTS"]) clients=`echo $clients | tr ' ' '\n' \ @@ -1879,7 +1878,6 @@ AC_CONFIG_FILES([ src/clients/accerso/Makefile src/clients/appareo/Makefile src/clients/cave/Makefile - src/clients/instruo/Makefile src/output/Makefile vim/Makefile vim/ftdetect/Makefile diff --git a/doc/clients/Makefile.am b/doc/clients/Makefile.am index 7f4406a2a..f5ef3ddf4 100644 --- a/doc/clients/Makefile.am +++ b/doc/clients/Makefile.am @@ -147,18 +147,6 @@ $(CAVE_COMMANDS_HTML) : header.html.part footer.html.part fi ; } \ && cat footer.html.part ; } > $@ -instruo.html : header.html.part footer.html.part - { cat header.html.part && { \ - echo "<h1>instruo</h1>"; \ - if test -f $(top_builddir)/src/clients/instruo/instruo.html-man-fragment ; then \ - cat $(top_builddir)/src/clients/instruo/instruo.html-man-fragment ; \ - elif test -f $(top_srcdir)/src/clients/instruo/instruo.html-man-fragment ; then \ - cat $(top_srcdir)/src/clients/instruo/instruo.html-man-fragment ; \ - else \ - echo "<p>Sorry, documentation was generated without support for the instruo client.</p>" ; \ - fi ; } \ - && cat footer.html.part ; } > $@ - header.html.part : $(srcdir)/../header.html.part.in toplinks.html.part sed \ -e 's,###TOPURI###,../,g' \ diff --git a/doc/clients/index.html.part b/doc/clients/index.html.part index f5ba7281e..a331bea7e 100644 --- a/doc/clients/index.html.part +++ b/doc/clients/index.html.part @@ -13,7 +13,6 @@ <ul> <li><a href="accerso.html">accerso</a>, the mirror client.</li> - <li><a href="instruo.html">instruo</a>, the metadata generation client.</li> <li><a href="appareo.html">appareo</a>, a Manifest generation tool.</li> </ul> diff --git a/doc/clients/toplinks.html.part.in b/doc/clients/toplinks.html.part.in index 018d748a3..6bb291598 100644 --- a/doc/clients/toplinks.html.part.in +++ b/doc/clients/toplinks.html.part.in @@ -46,7 +46,7 @@ </td> <td class="currentpage"> - <a href="###TOPURI###clients/instruo.html">instruo</a> + </td> </tr> diff --git a/doc/index.html.part.in b/doc/index.html.part.in index 1cda1d025..76657c558 100644 --- a/doc/index.html.part.in +++ b/doc/index.html.part.in @@ -88,7 +88,6 @@ the exheres repository format.</p> <ul> <li><a href="clients/accerso.html">accerso</a>, the mirror client.</li> - <li><a href="clients/instruo.html">instruo</a>, the metadata generation client.</li> <li><a href="clients/appareo.html">appareo</a>, a Manifest generation tool.</li> </ul> diff --git a/src/clients/instruo/Makefile.am b/src/clients/instruo/Makefile.am deleted file mode 100644 index 52a376829..000000000 --- a/src/clients/instruo/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -include $(top_srcdir)/misc/common-makefile.am - -AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src \ - @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@ -DEFS= \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DLIBEXECDIR=\"$(libexecdir)\" \ - -DLIBDIR=\"$(libdir)\" - -SUBDIRS = . - -bin_PROGRAMS = instruo -man_MANS = instruo.1 - -SUFFIXES = .1 .txt .xml - -man_MANS_txts = instruo.txt -man_MANS_xmls = instruo.xml -man_MANS_html_man_fragments = instruo.html-man-fragment - -if USE_PREBUILT_DOCUMENTATION -else - -noinst_PROGRAMS = man-instruo - -$(man_MANS_txts) : man-instruo - if ! ./man-instruo `echo $@ | sed -e 's.^instruo-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi - -.txt.xml : $(man_MANS_txts) - asciidoc --doctype=manpage --backend=docbook --out-file=$@ --conf=$(top_srcdir)/misc/asciidoc.conf $< - -.xml.1 : $(man_MANS_xmls) - xmlto man $< - -.xml.html-man-fragment : $(man_MANS_xmls) - xmlto html $< -o $@-dir - sed \ - -e '1s,^.*\(<div class="refnamediv">\),\1,' \ - -e '$$s,</body>.*,,' -e '$$s,</div><div class="navfooter"><hr></div>,,' \ - -e 's,<a name="[^"]*"></a>,,g' \ - $@-dir/index.html > $@ - rm -fr $@-dir - -man_instruo_SOURCES = \ - man_instruo.cc \ - command_line.hh \ - command_line.cc - -man_instruo_LDADD = \ - $(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) - -endif - -instruo_SOURCES = \ - command_line.hh command_line.cc \ - instruo.cc - -instruo_LDADD = \ - $(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) - -TESTS = version_TEST \ - help_TEST - -noinst_DATA = $(man_MANS_html_man_fragments) - -EXTRA_DIST = \ - $(man_MANS) \ - $(man_MANS_html_man_fragments) \ - $(TESTS) - -DISTCLEANFILES = \ - $(man_MANS) \ - $(man_MANS_txts) \ - $(man_MANS_xmls) \ - $(man_MANS_html_man_fragments) - diff --git a/src/clients/instruo/command_line.cc b/src/clients/instruo/command_line.cc deleted file mode 100644 index e2db4c1b9..000000000 --- a/src/clients/instruo/command_line.cc +++ /dev/null @@ -1,88 +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_generate_cache(&action_args, "generate-cache", 'g', "Generate cache", 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_repository_directory(&general_args, "repository-dir", 'D', - "Where to find the repository (default: current directory)"), - a_output_directory(&general_args, "output-dir", 'o', - "Where to place generated metadata (default: current directory)"), - a_master_repository_name(&general_args, "master-repository-name", '\0', - "Use the specified name for the master repository. Specify the location using --extra-repository-dir. " - "Only for repositories with no metadata/layout.conf."), - a_extra_repository_dir(&general_args, "extra-repository-dir", '\0', - "Also include the repository at this location. May be specified multiple times, in creation order."), - a_report_file(&general_args, "report-file", 'r', - "Write report to the specified file, rather than stdout") -{ - add_usage_line("--generate-cache [ at least one of --repository-dir /dir or --output-dir /dir ]"); - - add_description_line("instruo is configured purely from the command line. It does not use any user " - "configuration files."); - - add_environment_variable("INSTRUO_OPTIONS", "Default command-line options."); - add_environment_variable("INSTRUO_THREADS", "Number of threads to use. Default: 5"); -} - -std::string -CommandLine::app_name() const -{ - return "instruo"; -} - -std::string -CommandLine::app_synopsis() const -{ - return "Metadata generation client for Paludis"; -} - -std::string -CommandLine::app_description() const -{ - return - "instruo is a metadata generation client for Paludis. It generates metadata cache for every ID in a " - "given repository and produces a report of any failures."; -} - -CommandLine::~CommandLine() -{ -} - diff --git a/src/clients/instruo/command_line.hh b/src/clients/instruo/command_line.hh deleted file mode 100644 index dfe51def6..000000000 --- a/src/clients/instruo/command_line.hh +++ /dev/null @@ -1,62 +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_INSTRUO_COMMAND_LINE_HH -#define PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH 1 - -#include <paludis/args/args.hh> -#include <paludis/util/singleton.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_generate_cache; - 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_repository_directory; - paludis::args::StringArg a_output_directory; - paludis::args::StringArg a_master_repository_name; - paludis::args::StringSequenceArg a_extra_repository_dir; - paludis::args::StringArg a_report_file; -}; - -#endif diff --git a/src/clients/instruo/help_TEST b/src/clients/instruo/help_TEST deleted file mode 100755 index e424c7252..000000000 --- a/src/clients/instruo/help_TEST +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -./instruo --help - - diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc deleted file mode 100644 index 880d9bfed..000000000 --- a/src/clients/instruo/instruo.cc +++ /dev/null @@ -1,432 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2007, 2008, 2009, 2010, 2011 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 <output/colour.hh> -#include <paludis/args/do_help.hh> -#include "command_line.hh" -#include <paludis/about.hh> -#include <paludis/action.hh> -#include <paludis/package_id.hh> -#include <paludis/generator.hh> -#include <paludis/filter.hh> -#include <paludis/filtered_generator.hh> -#include <paludis/selection.hh> -#include <paludis/util/system.hh> -#include <paludis/util/join.hh> -#include <paludis/util/log.hh> -#include <paludis/util/sequence.hh> -#include <paludis/util/map.hh> -#include <paludis/util/visitor_cast.hh> -#include <paludis/util/set.hh> -#include <paludis/util/make_named_values.hh> -#include <paludis/util/mutex.hh> -#include <paludis/util/thread_pool.hh> -#include <paludis/util/destringify.hh> -#include <paludis/util/safe_ofstream.hh> -#include <paludis/util/pretty_print.hh> -#include <paludis/util/indirect_iterator-impl.hh> -#include <paludis/util/timestamp.hh> -#include <paludis/util/accept_visitor.hh> -#include <paludis/environments/no_config/no_config_environment.hh> -#include <paludis/metadata_key.hh> -#include <paludis/repository.hh> -#include <algorithm> -#include <functional> -#include <iostream> -#include <map> - -using namespace paludis; -using std::cout; -using std::cerr; -using std::endl; - -namespace -{ - typedef std::multimap<std::shared_ptr<const PackageID>, std::string, PackageIDComparator> Results; - - struct KeyValidator - { - void visit(const MetadataValueKey<std::string> & k) - { - const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataValueKey<SlotName> & k) - { - const SlotName & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataValueKey<long> & k) - { - long PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataValueKey<bool> & k) - { - bool PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k) - { - const std::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.parse_value()); - } - - void visit(const MetadataTimeKey & k) - { - Timestamp PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k) - { - const std::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.parse_value()); - } - - void visit(const MetadataValueKey<FSPath> & k) - { - const FSPath & PALUDIS_ATTRIBUTE((unused)) c(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<PlainTextSpecTree> & k) - { - const std::shared_ptr<const PlainTextSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<RequiredUseSpecTree> & k) - { - const std::shared_ptr<const RequiredUseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<FetchableURISpecTree> & k) - { - const std::shared_ptr<const FetchableURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<SimpleURISpecTree> & k) - { - const std::shared_ptr<const SimpleURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k) - { - const std::shared_ptr<const LicenseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataSpecTreeKey<DependencySpecTree> & k) - { - const std::shared_ptr<const DependencySpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value()); - } - - void visit(const MetadataCollectionKey<PackageIDSequence> & k) - { - const std::shared_ptr<const PackageIDSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataCollectionKey<Set<std::string> > & k) - { - const std::shared_ptr<const Set<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataCollectionKey<Map<std::string, std::string> > & k) - { - const std::shared_ptr<const Map<std::string, std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataCollectionKey<Sequence<std::string> > & k) - { - const std::shared_ptr<const Sequence<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataCollectionKey<FSPathSequence> & k) - { - const std::shared_ptr<const FSPathSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataCollectionKey<KeywordNameSet> & k) - { - const std::shared_ptr<const KeywordNameSet> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k) - { - const std::shared_ptr<const Choices> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value()); - } - - void visit(const MetadataSectionKey & k) - { - std::for_each(indirect_iterator(k.begin_metadata()), - indirect_iterator(k.end_metadata()), accept_visitor(*this)); - } - }; - - void worker(Mutex & mutex, const std::shared_ptr<PackageIDSequence> & ids, CategoryNamePart & old_cat, - unsigned & total, unsigned & success, Results & results) - { - while (true) - { - std::shared_ptr<const PackageID> id; - { - Lock lock(mutex); - if (ids->empty()) - return; - id = *ids->begin(); - ids->pop_front(); - - if (id->name().category() != old_cat) - { - cout << "Processing " << colour(cl_package_name, stringify(id->name().category())) << "..." << endl; - old_cat = id->name().category(); - } - - ++total; - } - - Context i_context("When generating metadata for ID '" + stringify(*id) + "':"); - - try - { - PackageID::MetadataConstIterator eapi_i(id->find_metadata("EAPI")); - if (id->end_metadata() == eapi_i) - { - Lock lock(mutex); - results.insert(std::make_pair(id, "No EAPI metadata key")); - continue; - } - - if (! visitor_cast<const MetadataValueKey<std::string> >(**eapi_i)) - { - Lock lock(mutex); - results.insert(std::make_pair(id, "EAPI metadata key is not a string key")); - continue; - } - - if (visitor_cast<const MetadataValueKey<std::string> >(**eapi_i)->parse_value() == "UNKNOWN") - { - Lock lock(mutex); - results.insert(std::make_pair(id, "EAPI is 'UNKNOWN'")); - continue; - } - - bool metadata_errors(false); - KeyValidator v; - for (PackageID::MetadataConstIterator m(id->begin_metadata()), m_end(id->end_metadata()); m_end != m; ++m) - { - try - { - (*m)->accept(v); - } - catch (const InternalError &) - { - throw; - } - catch (const Exception & e) - { - Lock lock(mutex); - results.insert(std::make_pair(id, "Error in metadata key '" + (*m)->raw_name() + "': '" + e.message() + - "' (" + e.what() + ")")); - metadata_errors = true; - } - } - - if (! metadata_errors) - { - Lock lock(mutex); - ++success; - } - } - catch (const InternalError &) - { - throw; - } - catch (const Exception & e) - { - Lock lock(mutex); - results.insert(std::make_pair(id, "Uncaught exception '" + e.message() + "' (" + e.what() + ")")); - } - } - } -} - -int -main(int argc, char *argv[]) -{ - std::string options(paludis::getenv_with_default("INSTRUO_OPTIONS", "")); - if (! options.empty()) - options = "(" + options + ") "; - options += join(argv + 1, argv + argc, " "); - - Context context(std::string("In program ") + argv[0] + " " + options + ":"); - - try - { - CommandLine::get_instance()->run(argc, argv, "instruo", "INSTRUO_OPTIONS", "INSTRUO_CMDLINE"); - set_use_colour( - (! CommandLine::get_instance()->a_no_colour.specified()) && - (! CommandLine::get_instance()->a_report_file.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_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); - - if (1 < ( - CommandLine::get_instance()->a_generate_cache.specified() + - CommandLine::get_instance()->a_version.specified() - )) - throw args::DoHelp("you should specify exactly one action"); - - if (! CommandLine::get_instance()->a_repository_directory.specified()) - CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd())); - - if (CommandLine::get_instance()->a_version.specified()) - { - cout << "instruo, 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 << 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; - } - - if (( - CommandLine::get_instance()->a_repository_directory.specified() + - CommandLine::get_instance()->a_output_directory.specified() - ) < 1) - throw args::DoHelp("at least one of '--" + CommandLine::get_instance()->a_repository_directory.long_name() + "' or '--" - + CommandLine::get_instance()->a_output_directory.long_name() + "' must be specified"); - - if (! CommandLine::get_instance()->a_output_directory.specified()) - CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSPath::cwd())); - - std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>()); - for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()), - d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ; - d != d_end ; ++d) - extra_repository_dirs->push_back(FSPath(*d)); - - std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>()); - keys->insert("append_repository_name_to_write_cache", "false"); - NoConfigEnvironment env(make_named_values<no_config_environment::Params>( - n::accept_unstable() = true, - n::disable_metadata_cache() = true, - n::extra_accept_keywords() = "", - n::extra_params() = keys, - n::extra_repository_dirs() = extra_repository_dirs, - n::master_repository_name() = CommandLine::get_instance()->a_master_repository_name.argument(), - n::profiles_if_not_auto() = "", - n::repository_dir() = CommandLine::get_instance()->a_repository_directory.argument(), - n::repository_type() = no_config_environment::ncer_ebuild, - n::write_cache() = CommandLine::get_instance()->a_output_directory.argument() - )); - - std::shared_ptr<PackageIDSequence> ids(env[selection::AllVersionsSorted( - generator::InRepository(env.main_repository()->name()))]); - Results results((PackageIDComparator(&env))); - unsigned success(0), total(0); - CategoryNamePart old_cat("OLDCAT"); - Mutex mutex; - - { - ThreadPool pool; - for (int n(0), n_end(destringify<int>(getenv_with_default("INSTRUO_THREADS", "5"))) ; n < n_end ; ++n) - pool.create_thread(std::bind(&worker, std::ref(mutex), std::ref(ids), std::ref(old_cat), - std::ref(total), std::ref(success), std::ref(results))); - } - - std::cout << std::endl; - - std::shared_ptr<SafeOFStream> outf; - if (CommandLine::get_instance()->a_report_file.specified()) - outf = std::make_shared<SafeOFStream>(FSPath(CommandLine::get_instance()->a_report_file.argument()), -1, true); - - std::ostream & out(outf ? *outf : cout); - - out << colour(cl_heading, "Instruo results for ") << colour(cl_repository_name, env.main_repository()->name()) - << colour(cl_heading, " on " + pretty_print_time(time(0)) + ":") << endl << endl - << total << " IDs, " << success << " successes, " << (total - success) << " failures" << endl << endl; - - int exit_status(0); - std::shared_ptr<const PackageID> old_id; - for (Results::const_iterator r(results.begin()), r_end(results.end()) ; r != r_end ; ++r) - { - exit_status |= 1; - if ((! old_id) || (*old_id != *r->first)) - { - out << colour(cl_package_name, stringify(*r->first)) << ":" << endl; - old_id = r->first; - } - out << " " << r->second << endl; - } - out << endl; - - return exit_status; - } - 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/instruo/man_instruo.cc b/src/clients/instruo/man_instruo.cc deleted file mode 100644 index 2216facca..000000000 --- a/src/clients/instruo/man_instruo.cc +++ /dev/null @@ -1,65 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2006, 2007, 2009, 2011 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 <paludis/args/do_help.hh> - -#include <iostream> -#include <cstdlib> - -using std::cout; -using std::endl; - -namespace -{ - struct ManCommandLine : - paludis::args::ArgsHandler - { - 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, "", "", ""); - - auto w(std::make_shared<paludis::args::AsciidocWriter>(cout)); - - paludis::args::generate_doc(*w, CommandLine::get_instance()); - - return EXIT_SUCCESS; -} - - diff --git a/src/clients/instruo/version_TEST b/src/clients/instruo/version_TEST deleted file mode 100755 index 3eecdb712..000000000 --- a/src/clients/instruo/version_TEST +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -./instruo --version - |