Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10541 - in /trunk/zypper/src: ./ callbacks/ output/ utils/
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Fri, 11 Jul 2008 12:54:49 -0000
  • Message-id: <20080711125449.8322024B32@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Fri Jul 11 14:54:48 2008
New Revision: 10541

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10541&view=rev
Log:
- moved utils.* to utils/misc.* and split

Added:
trunk/zypper/src/utils/messages.cc
trunk/zypper/src/utils/messages.h
trunk/zypper/src/utils/misc.cc
- copied, changed from r10533, trunk/zypper/src/utils.cc
trunk/zypper/src/utils/misc.h
- copied, changed from r10533, trunk/zypper/src/utils.h
Removed:
trunk/zypper/src/utils.cc
trunk/zypper/src/utils.h
Modified:
trunk/zypper/src/CMakeLists.txt
trunk/zypper/src/Zypper.cc
trunk/zypper/src/callbacks/locks.h
trunk/zypper/src/callbacks/repo.h
trunk/zypper/src/install.cc
trunk/zypper/src/locks.cc
trunk/zypper/src/misc.cc
trunk/zypper/src/output/OutXML.cc
trunk/zypper/src/repos.cc
trunk/zypper/src/search.h
trunk/zypper/src/solve-commit.cc
trunk/zypper/src/update.cc
trunk/zypper/src/update.h

Modified: trunk/zypper/src/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/CMakeLists.txt?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/CMakeLists.txt (original)
+++ trunk/zypper/src/CMakeLists.txt Fri Jul 11 14:54:48 2008
@@ -13,7 +13,6 @@
Command.h
repos.h
misc.h
- utils.h
search.h
info.h
Table.h
@@ -33,7 +32,6 @@
Command.cc
repos.cc
misc.cc
- utils.cc
search.cc
info.cc
Table.cc
@@ -61,6 +59,8 @@

SET( zypper_utils_HEADERS
utils/getopt.h
+ utils/messages.h
+ utils/misc.h
utils/pager.h
utils/prompt.h
utils/richtext.h
@@ -68,6 +68,8 @@

SET( zypper_utils_SRCS
utils/getopt.cc
+ utils/messages.cc
+ utils/misc.cc
utils/pager.cc
utils/prompt.cc
utils/richtext.cc

Modified: trunk/zypper/src/Zypper.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.cc (original)
+++ trunk/zypper/src/Zypper.cc Fri Jul 11 14:54:48 2008
@@ -38,7 +38,8 @@
#include "Command.h"

#include "Table.h"
-#include "utils.h"
+#include "utils/misc.h"
+#include "utils/messages.h"
#include "utils/getopt.h"

#include "repos.h"

Modified: trunk/zypper/src/callbacks/locks.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/callbacks/locks.h?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/callbacks/locks.h (original)
+++ trunk/zypper/src/callbacks/locks.h Fri Jul 11 14:54:48 2008
@@ -15,7 +15,7 @@
#include "zypp/PoolQuery.h"

#include "utils/prompt.h"
-#include "utils.h"
+//#include "utils/misc.h"

namespace zypp {


Modified: trunk/zypper/src/callbacks/repo.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/callbacks/repo.h?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/callbacks/repo.h (original)
+++ trunk/zypper/src/callbacks/repo.h Fri Jul 11 14:54:48 2008
@@ -18,7 +18,7 @@

#include "Zypper.h"
#include "utils/prompt.h"
-#include "utils.h"
+#include "utils/misc.h"

///////////////////////////////////////////////////////////////////
namespace ZmartRecipients

Modified: trunk/zypper/src/install.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/install.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/install.cc (original)
+++ trunk/zypper/src/install.cc Fri Jul 11 14:54:48 2008
@@ -5,7 +5,7 @@
#include "zypp/base/Algorithm.h"
#include "zypp/PoolQuery.h"

-#include "utils.h"
+#include "utils/misc.h"

#include "install.h"


Modified: trunk/zypper/src/locks.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/locks.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/locks.cc (original)
+++ trunk/zypper/src/locks.cc Fri Jul 11 14:54:48 2008
@@ -8,7 +8,7 @@
#include "output/Out.h"
#include "main.h"
#include "Table.h"
-#include "utils.h"
+#include "utils/misc.h"
#include "locks.h"
#include "repos.h"


Modified: trunk/zypper/src/misc.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/misc.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/misc.cc (original)
+++ trunk/zypper/src/misc.cc Fri Jul 11 14:54:48 2008
@@ -17,7 +17,7 @@
#include "zypp/RepoInfo.h"

#include "main.h"
-#include "utils.h"
+#include "utils/misc.h"
#include "utils/pager.h"
#include "utils/prompt.h"
#include "utils/getopt.h"

Modified: trunk/zypper/src/output/OutXML.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.cc (original)
+++ trunk/zypper/src/output/OutXML.cc Fri Jul 11 14:54:48 2008
@@ -5,7 +5,7 @@
#include "zypp/base/String.h"

#include "OutXML.h"
-#include "../utils.h"
+#include "utils/misc.h"

using std::cout;
using std::endl;

Modified: trunk/zypper/src/repos.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/repos.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/repos.cc (original)
+++ trunk/zypper/src/repos.cc Fri Jul 11 14:54:48 2008
@@ -23,7 +23,8 @@
#include "main.h"
#include "getopt.h"
#include "Table.h"
-#include "utils.h"
+#include "utils/messages.h"
+#include "utils/misc.h" // for xml_encode
#include "repos.h"

using namespace std;

Modified: trunk/zypper/src/search.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/search.h?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/search.h (original)
+++ trunk/zypper/src/search.h Fri Jul 11 14:54:48 2008
@@ -16,7 +16,7 @@
#include "zypp/Patch.h"

#include "Zypper.h"
-#include "utils.h" // for kind_to_string_localized
+#include "utils/misc.h" // for kind_to_string_localized
#include "Table.h"

std::string selectable_search_repo_str(const zypp::ui::Selectable & s);

Modified: trunk/zypper/src/solve-commit.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/solve-commit.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/solve-commit.cc (original)
+++ trunk/zypper/src/solve-commit.cc Fri Jul 11 14:54:48 2008
@@ -20,7 +20,7 @@
#include "zypp/media/MediaException.h"

#include "misc.h"
-#include "utils.h"
+#include "utils/misc.h"
#include "utils/getopt.h"
#include "utils/prompt.h"


Modified: trunk/zypper/src/update.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/update.cc?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/update.cc (original)
+++ trunk/zypper/src/update.cc Fri Jul 11 14:54:48 2008
@@ -9,7 +9,6 @@

#include "zypp/Patch.h"

-//#include "utils.h"
#include "Table.h"
#include "update.h"


Modified: trunk/zypper/src/update.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/update.h?rev=10541&r1=10540&r2=10541&view=diff
==============================================================================
--- trunk/zypper/src/update.h (original)
+++ trunk/zypper/src/update.h Fri Jul 11 14:54:48 2008
@@ -1,6 +1,6 @@
#include "Zypper.h"

-#include "utils.h"
+#include "utils/misc.h"

/**
* Are there applicable patches?

Added: trunk/zypper/src/utils/messages.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/utils/messages.cc?rev=10541&view=auto
==============================================================================
--- trunk/zypper/src/utils/messages.cc (added)
+++ trunk/zypper/src/utils/messages.cc Fri Jul 11 14:54:48 2008
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ____ _ _ __ _ __ ___ _ _
+ |_ / || | '_ \ '_ \/ -_) '_|
+ /__|\_, | .__/ .__/\___|_|
+ |__/|_| |_|
+\*---------------------------------------------------------------------------*/
+
+#include <sstream>
+#include "zypp/base/String.h"
+#include "Zypper.h"
+
+#include "messages.h"
+
+using namespace std;
+
+
+/// tell the user to report a bug, and how
+// (multiline, with endls)
+void report_a_bug (Out & out)
+{
+ ostringstream s;
+ s <<_("Please file a bug report about this.") << endl
+ // TranslatorExplanation remember not to translate the URL
+ // unless you translate the actual page :)
+ << _("See http://en.opensuse.org/Zypper#Troubleshooting for
instructions.");
+ out.error(s.str());
+}
+
+// ----------------------------------------------------------------------------
+
+void report_too_many_arguments(const string & specific_help)
+{
+ report_too_many_arguments(Zypper::instance()->out(), specific_help);
+}
+
+void report_too_many_arguments(Out & out, const string & specific_help)
+{
+ //! \todo make this more explanatory, e.g. "Ingoring arg1 arg2. This command
does not take arguments. See %s for more information."
+ ostringstream s;
+ s << _("Usage") << ':' << endl << specific_help;
+ out.error(_("Too many arguments."), s.str());
+}
+
+// ----------------------------------------------------------------------------
+
+void report_required_arg_missing(Out & out, const string & cmd_help)
+{
+ out.error(_("Required argument missing."));
+ ostringstream s;
+ s << _("Usage") << ':' << endl;
+ s << cmd_help;
+ out.info(s.str());
+}
+
+// ----------------------------------------------------------------------------
+
+void report_dummy_option(Out & out, const string & longoption_str)
+{
+ out.warning(zypp::str::form(
+ _("The '--%s' option has currently no effect."), longoption_str.c_str()));
+}

Added: trunk/zypper/src/utils/messages.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/utils/messages.h?rev=10541&view=auto
==============================================================================
--- trunk/zypper/src/utils/messages.h (added)
+++ trunk/zypper/src/utils/messages.h Fri Jul 11 14:54:48 2008
@@ -0,0 +1,28 @@
+/*---------------------------------------------------------------------------*\
+ ____ _ _ __ _ __ ___ _ _
+ |_ / || | '_ \ '_ \/ -_) '_|
+ /__|\_, | .__/ .__/\___|_|
+ |__/|_| |_|
+\*---------------------------------------------------------------------------*/
+
+#ifndef MESSAGES_H_
+#define MESSAGES_H_
+
+#include "output/Out.h"
+
+
+/** Write a suggestion to report a bug to the output. */
+void report_a_bug (Out & out);
+
+/** Say that too many arguments have been specified */
+void report_too_many_arguments(const std::string & specific_help); //
deprecated
+void report_too_many_arguments(Out & out, const std::string & specific_help);
+
+/** Say the specified option has no effect */
+void report_dummy_option(Out & out, const std::string & longoption_str);
+
+/** Say you miss a required argument and print command help */
+void report_required_arg_missing(Out & out, const std::string & cmd_help);
+
+
+#endif /*MESSAGES_H_*/

Copied: trunk/zypper/src/utils/misc.cc (from r10533, trunk/zypper/src/utils.cc)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/utils/misc.cc?p2=trunk/zypper/src/utils/misc.cc&p1=trunk/zypper/src/utils.cc&r1=10533&r2=10541&rev=10541&view=diff
==============================================================================
--- trunk/zypper/src/utils.cc (original)
+++ trunk/zypper/src/utils/misc.cc Fri Jul 11 14:54:48 2008
@@ -1,3 +1,10 @@
+/*---------------------------------------------------------------------------*\
+ ____ _ _ __ _ __ ___ _ _
+ |_ / || | '_ \ '_ \/ -_) '_|
+ /__|\_, | .__/ .__/\___|_|
+ |__/|_| |_|
+\*---------------------------------------------------------------------------*/
+
#include <fstream>
#include <sstream>
#include <unistd.h>
@@ -11,9 +18,9 @@
#include "zypp/parser/xml_escape_parser.hpp"
#include "zypp/Capability.h"

-#include "Zypper.h"
#include "main.h"
-#include "utils.h"
+
+#include "utils/misc.h"


using namespace std;
@@ -49,54 +56,6 @@

// ----------------------------------------------------------------------------

-/// tell the user to report a bug, and how
-// (multiline, with endls)
-void report_a_bug (Out & out)
-{
- ostringstream s;
- s <<_("Please file a bug report about this.") << endl
- // TranslatorExplanation remember not to translate the URL
- // unless you translate the actual page :)
- << _("See http://en.opensuse.org/Zypper#Troubleshooting for
instructions.");
- out.error(s.str());
-}
-
-// ----------------------------------------------------------------------------
-
-void report_too_many_arguments(const string & specific_help)
-{
- report_too_many_arguments(Zypper::instance()->out(), specific_help);
-}
-
-void report_too_many_arguments(Out & out, const string & specific_help)
-{
- //! \todo make this more explanatory, e.g. "Ingoring arg1 arg2. This command
does not take arguments. See %s for more information."
- ostringstream s;
- s << _("Usage") << ':' << endl << specific_help;
- out.error(_("Too many arguments."), s.str());
-}
-
-// ----------------------------------------------------------------------------
-
-void report_required_arg_missing(Out & out, const string & cmd_help)
-{
- out.error(_("Required argument missing."));
- ostringstream s;
- s << _("Usage") << ':' << endl;
- s << cmd_help;
- out.info(s.str());
-}
-
-// ----------------------------------------------------------------------------
-
-void report_dummy_option(Out & out, const string & longoption_str)
-{
- out.warning(str::form(
- _("The '--%s' option has currently no effect."), longoption_str.c_str()));
-}
-
-// ----------------------------------------------------------------------------
-
bool is_changeable_media(const zypp::Url & url)
{
MIL << "Checking if this is a changeable medium" << endl;

Copied: trunk/zypper/src/utils/misc.h (from r10533, trunk/zypper/src/utils.h)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/utils/misc.h?p2=trunk/zypper/src/utils/misc.h&p1=trunk/zypper/src/utils.h&r1=10533&r2=10541&rev=10541&view=diff
==============================================================================
--- trunk/zypper/src/utils.h (original)
+++ trunk/zypper/src/utils/misc.h Fri Jul 11 14:54:48 2008
@@ -1,3 +1,10 @@
+/*---------------------------------------------------------------------------*\
+ ____ _ _ __ _ __ ___ _ _
+ |_ / || | '_ \ '_ \/ -_) '_|
+ /__|\_, | .__/ .__/\___|_|
+ |__/|_| |_|
+\*---------------------------------------------------------------------------*/
+
#ifndef ZYPPER_UTILS_H
#define ZYPPER_UTILS_H

@@ -9,25 +16,12 @@
#include "zypp/Pathname.h"
#include "zypp/RepoInfo.h"

-#include "output/Out.h"
+#include "Zypper.h"

typedef std::set<zypp::ResKind> ResKindSet;

std::string readline_getline();

-/** Write a suggestion to report a bug to the output. */
-void report_a_bug (Out & out);
-
-/** Say that too many arguments have been specified */
-void report_too_many_arguments(const std::string & specific_help); //
deprecated
-void report_too_many_arguments(Out & out, const std::string & specific_help);
-
-/** Say the specified option has no effect */
-void report_dummy_option(Out & out, const std::string & longoption_str);
-
-/** Say you miss a required argument and print command help */
-void report_required_arg_missing(Out & out, const std::string & cmd_help);
-
bool is_changeable_media(const zypp::Url & url);

std::string kind_to_string_localized(

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages