Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9452 - in /trunk/libzypp/zypp: RepoManager.cc repo/RepoException.cc repo/RepoException.h repo/RepoProvideFile.cc
  • From: jreidinger@xxxxxxxxxxxxxxxx
  • Date: Tue, 08 Apr 2008 11:15:12 -0000
  • Message-id: <20080408111512.C600426F95@xxxxxxxxxxxxxxxx>
Author: jreidinger
Date: Tue Apr 8 13:15:12 2008
New Revision: 9452

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9452&view=rev
Log:
move RepoInfo to universal RepoException. This can enable more verbose output
for frontend. (helps with bnc #377137)

Modified:
trunk/libzypp/zypp/RepoManager.cc
trunk/libzypp/zypp/repo/RepoException.cc
trunk/libzypp/zypp/repo/RepoException.h
trunk/libzypp/zypp/repo/RepoProvideFile.cc

Modified: trunk/libzypp/zypp/RepoManager.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9452&r1=9451&r2=9452&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Tue Apr 8 13:15:12 2008
@@ -920,7 +920,7 @@
Pathname solvfile = (_pimpl->options.repoCachePath /
alias).extend(".solv");

if ( ! PathInfo(solvfile).isExist() )
- ZYPP_THROW(RepoNotCachedException());
+ ZYPP_THROW(RepoNotCachedException(info));

try
{
@@ -1013,7 +1013,7 @@
++it )
{
if ( info.alias() == (*it).alias() )
- ZYPP_THROW(RepoAlreadyExistsException(info.alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(info));
}

RepoInfo tosave = info;
@@ -1071,7 +1071,7 @@
if ( (*it).alias() == (*kit).alias() )
{
ERR << "To be added repo " << (*it).alias() << " conflicts with
existing repo " << (*kit).alias() << endl;
- ZYPP_THROW(RepoAlreadyExistsException((*it).alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(*it));
}
}
}
@@ -1205,7 +1205,7 @@
++it )
{
if ( newinfo.alias() == (*it).alias() )
- ZYPP_THROW(RepoAlreadyExistsException(newinfo.alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(newinfo));
}
}


Modified: trunk/libzypp/zypp/repo/RepoException.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoException.cc?rev=9452&r1=9451&r2=9452&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/RepoException.cc (original)
+++ trunk/libzypp/zypp/repo/RepoException.cc Tue Apr 8 13:15:12 2008
@@ -30,12 +30,22 @@
: Exception( msg_r )
{}

- RepoNotCachedException::RepoNotCachedException()
- : RepoException( "Repository not Cached" )
+ RepoException::RepoException( const RepoInfo & info )
+ : Exception( "Repo exception" ), _info( info )
{}

- RepoNotCachedException::RepoNotCachedException( const std::string & msg_r )
- : RepoException( msg_r )
+ RepoException::RepoException( const RepoInfo & info,
+ const std::string& msg_r )
+ : Exception( msg_r ), _info( info )
+ {}
+
+ RepoNotCachedException::RepoNotCachedException( const RepoInfo& info )
+ : RepoException( info, "Repository not Cached" )
+ {}
+
+ RepoNotCachedException::RepoNotCachedException( const RepoInfo& info,
+ const std::string & msg_r )
+ : RepoException( info, msg_r )
{}



Modified: trunk/libzypp/zypp/repo/RepoException.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoException.h?rev=9452&r1=9451&r2=9452&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/RepoException.h (original)
+++ trunk/libzypp/zypp/repo/RepoException.h Tue Apr 8 13:15:12 2008
@@ -35,8 +35,21 @@
RepoException();
/** Ctor */
RepoException( const std::string & msg_r );
+
+ RepoException( const RepoInfo & info );
+
+ RepoException( const RepoInfo & info, const std::string & msg_r );
+
+ virtual ~RepoException() throw() {}
+
+ RepoInfo info()
+ { return _info; }
+
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ private:
+ RepoInfo _info;
};
///////////////////////////////////////////////////////////////////

@@ -48,8 +61,8 @@
class RepoNotCachedException : public RepoException
{
public:
- RepoNotCachedException();
- RepoNotCachedException( const std::string & msg_r );
+ RepoNotCachedException( const RepoInfo& info );
+ RepoNotCachedException( const RepoInfo& info, const std::string & msg_r
);
};

/**
@@ -63,16 +76,9 @@
{}

RepoNoUrlException( const RepoInfo &info)
- : _info(info)
- {}
+ : RepoException(info)
+ {}

- ~RepoNoUrlException() throw()
- {}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};

/**
@@ -92,15 +98,8 @@
{
public:
RepoNotFoundException( const RepoInfo &info)
- : _info(info)
- {}
- ~RepoNotFoundException() throw()
+ : RepoException(info)
{}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};

/**
@@ -110,24 +109,17 @@
class RepoAlreadyExistsException : public RepoException
{
public:
- ~RepoAlreadyExistsException() throw()
- {}
-
- RepoAlreadyExistsException( const std::string &alias,
+ RepoAlreadyExistsException( const RepoInfo &info,
const std::string & msg_r )
- : RepoException(msg_r)
- , _alias(alias)
+ : RepoException(info,msg_r)
{}

- RepoAlreadyExistsException( const std::string &alias )
- : _alias(alias)
+ RepoAlreadyExistsException( const RepoInfo &info )
+ : RepoException(info)
{}

std::string alias()
- { return _alias; }
-
- private:
- std::string _alias;
+ { return info().alias(); }
};

/**
@@ -144,8 +136,6 @@
RepoUnknownTypeException()
{}

- ~RepoUnknownTypeException() throw()
- {}
};

/**
@@ -156,19 +146,11 @@
{
public:
RepoMetadataException( const RepoInfo &info)
- : _info(info)
+ : RepoException(info)
{}

RepoMetadataException()
{}
-
- ~RepoMetadataException() throw()
- {}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};

/////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/repo/RepoProvideFile.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoProvideFile.cc?rev=9452&r1=9451&r2=9452&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/RepoProvideFile.cc (original)
+++ trunk/libzypp/zypp/repo/RepoProvideFile.cc Tue Apr 8 13:15:12 2008
@@ -212,7 +212,8 @@

Url url;

- RepoException repo_excpt(str::form(_("Can't provide file '%s' from
repository '%s'"),
+ RepoException repo_excpt(repo_r,
+ str::form(_("Can't provide file '%s' from
repository '%s'"),
loc_r.filename().c_str(),
repo_r.alias().c_str() ) );


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

< Previous Next >
This Thread
  • No further messages