Zypp Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2007
- 7 participants
- 204 discussions
[zypp-commit] r5834 - in /branches/REFACTORING-10_3/libzypp/zypp: RepoManager.cc parser/plaindir/RepoParser.cc parser/plaindir/RepoParser.h
by dmacvicar@svn.opensuse.org 22 Jun '07
by dmacvicar@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: dmacvicar
Date: Fri Jun 22 17:52:24 2007
New Revision: 5834
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5834&view=rev
Log:
support plaindir rpms
Modified:
branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc Fri Jun 22 17:52:24 2007
@@ -31,7 +31,7 @@
#include "zypp/parser/RepoFileReader.h"
#include "zypp/repo/yum/Downloader.h"
#include "zypp/parser/yum/RepoParser.h"
-
+#include "zypp/parser/plaindir/RepoParser.h"
#include "zypp/repo/susetags/Downloader.h"
#include "zypp/parser/susetags/RepoParser.h"
@@ -281,6 +281,11 @@
{
status = RepoStatus( rawpath + "/content");
}
+ case RepoType::RPMPLAINDIR_e :
+ {
+ if ( PathInfo(Pathname(rawpath + "/cookie")).isExist() )
+ status = RepoStatus( rawpath + "/content");
+ }
break;
default:
ZYPP_THROW(RepoUnknownTypeException());
@@ -377,6 +382,39 @@
return;
// no error
}
+ case RepoType::RPMPLAINDIR_e :
+ {
+ RepoStatus newstatus = parser::plaindir::dirStatus(url.getPathName());
+ bool refresh = false;
+ if ( oldstatus.checksum() == newstatus.checksum() )
+ {
+ MIL << "repo has not changed" << endl;
+ if ( policy == RefreshForced )
+ {
+ MIL << "refresh set to forced" << endl;
+ refresh = true;
+ }
+ }
+ else
+ {
+ refresh = true;
+ }
+
+ if ( refresh )
+ {
+ std::ofstream file(( tmpdir.path() + "/cookie").c_str());
+ if (!file) {
+ ZYPP_THROW (Exception( "Can't open " + tmpdir.path().asString() + "/cookie" ) );
+ }
+ file << url << endl;
+ file << newstatus.checksum() << endl;
+
+ file.close();
+ }
+ else
+ return;
+ // no error
+ }
break;
default:
ZYPP_THROW(RepoUnknownTypeException());
@@ -475,6 +513,15 @@
parser.parse(rawpath);
// no error
}
+ case RepoType::RPMPLAINDIR_e :
+ {
+ InputStream is(rawpath + "cookie");
+ string buffer;
+ getline( is.stream(), buffer);
+ Url url(buffer);
+ parser::plaindir::RepoParser parser(id, store);
+ parser.parse(url.getPathName());
+ }
break;
default:
ZYPP_THROW(RepoUnknownTypeException());
@@ -498,10 +545,15 @@
if ( access.doesFileExist("/content") )
return repo::RepoType::YAST2;
- // if it is a local url
- if ( ! media::MediaManager::downloads(url) )
+ // if it is a local url of type dir
+ if ( (! media::MediaManager::downloads(url)) && ( url.getScheme() == "dir" ) )
{
-
+ Pathname path = Pathname(url.getPathName());
+ if ( PathInfo(path).isDir() )
+ {
+ // allow empty dirs for now
+ return repo::RepoType::RPMPLAINDIR;
+ }
}
return repo::RepoType("UNKNOWN");
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc Fri Jun 22 17:52:24 2007
@@ -35,6 +35,40 @@
namespace plaindir
{ /////////////////////////////////////////////////////////////////
+static time_t recursive_timestamp( const Pathname &dir )
+{
+ time_t max = PathInfo(dir).mtime();
+ std::list<std::string> dircontent;
+ if (filesystem::readdir( dircontent, dir, false) != 0)
+ { // dont look for dot files
+ ERR << "readdir " << dir << " failed" << endl;
+ return 0;
+ }
+
+ for (std::list<std::string>::const_iterator it = dircontent.begin();
+ it != dircontent.end();
+ ++it)
+ {
+ Pathname dir_path = dir + *it;
+ if ( PathInfo(dir_path).isDir())
+ {
+ time_t val = recursive_timestamp(dir_path);
+ if ( val > max )
+ max = val;
+ }
+ }
+ return max;
+}
+
+RepoStatus dirStatus( const Pathname &dir )
+{
+ RepoStatus status;
+ time_t t = recursive_timestamp(dir);
+ status.setTimestamp(Date(t));
+ status.setChecksum(str::numstring(t));
+ return status;
+}
+
data::Package_Ptr makePackageDataFromHeader( const RpmHeader::constPtr header,
set<string> * filerequires,
const Pathname & location, data::RecordId &repoid )
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h Fri Jun 22 17:52:24 2007
@@ -19,6 +19,7 @@
#include "zypp/data/ResolvableDataConsumer.h"
#include "zypp/ProgressData.h"
+#include "zypp/RepoStatus.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -30,6 +31,11 @@
namespace plaindir
{ /////////////////////////////////////////////////////////////////
+ /**
+ * \short Gives a cookie for a dir
+ */
+ RepoStatus dirStatus( const Pathname &dir );
+
/** Plaindir metadata parser. */
class RepoParser : private base::NonCopyable
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5833 - in /branches/REFACTORING-10_3/libzypp/zypp: ./ capability/ parser/plaindir/ repo/ repo/plaindir/ target/rpm/
by dmacvicar@svn.opensuse.org 22 Jun '07
by dmacvicar@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: dmacvicar
Date: Fri Jun 22 16:05:21 2007
New Revision: 5833
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5833&view=rev
Log:
- make RpmHeader return CapabilityImplPtr
- turn the PlainDir Source into a parser
this means plain dir rpms can be cached now
Added:
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
Removed:
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Fri Jun 22 16:05:21 2007
@@ -463,6 +463,19 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/susetags
)
+SET( zypp_parser_plaindir_SRCS
+ parser/plaindir/RepoParser.cc
+)
+
+SET( zypp_parser_plaindir_HEADERS
+ parser/plaindir/RepoParser.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_plaindir_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/plaindir
+)
+
SET( zypp_parser_xml_SRCS
parser/xml/Node.cc
parser/xml/ParseDef.cc
@@ -549,11 +562,6 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/yum
)
-INSTALL( FILES
- ${zypp_parser_yum2_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/yum2
-)
-
SET( zypp_pool_SRCS
pool/GetResolvablesToInsDel.cc
pool/PoolImpl.cc
@@ -652,19 +660,6 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/solver/detail
)
-SET( zypp_repo_plaindir_SRCS
- repo/plaindir/PlaindirImpl.cc
-)
-
-SET( zypp_repo_plaindir_HEADERS
- repo/plaindir/PlaindirImpl.h
-)
-
-INSTALL( FILES
- ${zypp_repo_plaindir_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/repo/plaindir
-)
-
SET( zypp_target_SRCS
target/CommitLog.cc
target/CommitPackageCache.cc
@@ -1017,9 +1012,8 @@
${zypp_parser_xmlstore_SRCS}
${zypp_parser_xml_SRCS}
${zypp_parser_yum_SRCS}
+${zypp_parser_plaindir_SRCS}
${zypp_parser_SRCS}
-${zypp_repo_plaindir_SRCS}
-${zypp_source_SRCS}
${zypp_data_SRCS}
${zypp_media_proxyinfo_SRCS}
${zypp_media_SRCS}
@@ -1044,12 +1038,14 @@
)
SET( zypp_lib_HEADERS
-${zypp_repo_plaindir_HEADERS}
${zypp_target_store_xml_HEADERS}
+${zypp_target_rpm_HEADERS}
${zypp_parser_tagfile_HEADERS}
${zypp_parser_susetags_HEADERS}
-${zypp_target_rpm_HEADERS}
-${zypp_parser_yum2_HEADERS}
+${zypp_parser_yum_HEADERS}
+${zypp_parser_plaindir_HEADERS}
+${zypp_parser_xml_HEADERS}
+${zypp_parser_HEADERS}
${zypp_capability_HEADERS}
${zypp_cache_HEADERS}
${zypp_cache_sqlite3x_HEADERS}
@@ -1058,15 +1054,11 @@
${zypp_data_HEADERS}
${zypp_media_HEADERS}
${zypp_target_hal_HEADERS}
-${zypp_parser_xml_HEADERS}
${zypp_media_proxyinfo_HEADERS}
-${zypp_source_yum_HEADERS}
${zypp_base_HEADERS}
${zypp_solver_detail_HEADERS}
${zypp_target_store_HEADERS}
${zypp_url_HEADERS}
-${zypp_source_HEADERS}
-${zypp_parser_HEADERS}
${zypp_HEADERS}
${zypp_zypp_detail_HEADERS}
${zypp_thread_HEADERS}
@@ -1074,7 +1066,6 @@
${zypp_source_susetags_HEADERS}
${zypp_target_modalias_HEADERS}
${zypp_target_HEADERS}
-${zypp_parser_yum_HEADERS}
${zypp_detail_HEADERS}
${zypp_pool_HEADERS}
)
@@ -1094,7 +1085,6 @@
SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} )
# override some defaults
-SET_LOGGROUP( "plaindir" ${zypp_repo_plaindir_SRCS} )
SET_LOGGROUP( "xmlstore" ${zypp_target_store_xml_SRCS} )
#SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} )
#SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} )
Modified: branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h Fri Jun 22 16:05:21 2007
@@ -309,6 +309,8 @@
}
};
+ typedef std::set<CapabilityImpl::Ptr> CapabilityImplPtrSet;
+
/////////////////////////////////////////////////////////////////
} // namespace capability
///////////////////////////////////////////////////////////////////
Added: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc (added)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc Fri Jun 22 16:05:21 2007
@@ -0,0 +1,294 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#include <iostream>
+#include "zypp/base/Logger.h"
+#include "zypp/base/Iterator.h"
+#include "zypp/base/String.h"
+
+#include <zypp/target/rpm/RpmHeader.h>
+#include <zypp/target/rpm/RpmDb.h>
+
+#include "zypp/parser/plaindir/RepoParser.h"
+#include "zypp/parser/ParseException.h"
+#include "zypp/capability/CapabilityImpl.h"
+#include "zypp/PathInfo.h"
+#include "zypp/ResStore.h"
+#include "zypp/ZConfig.h"
+
+using namespace std;
+using namespace zypp::target::rpm;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace parser
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace plaindir
+{ /////////////////////////////////////////////////////////////////
+
+data::Package_Ptr makePackageDataFromHeader( const RpmHeader::constPtr header,
+ set<string> * filerequires,
+ const Pathname & location, data::RecordId &repoid )
+{
+ if ( ! header )
+ return 0;
+
+ if ( header->isSrc() ) {
+ WAR << "Can't make Package from SourcePackage header" << endl;
+ return 0;
+ }
+
+ data::Package_Ptr pkg = new data::Package;
+
+// typedef std::set<capability::CapabilityImpl::Ptr> DependencyList;
+// typedef std::map<zypp::Dep, DependencyList> Dependencies;
+ pkg->name = header->tag_name();
+// impl->setRepository( repo );
+// if (!location.empty())
+// impl->setLocation( location );
+
+ try {
+ pkg->edition = Edition( header->tag_version(),
+ header->tag_release(),
+ header->tag_epoch());
+ }
+ catch (Exception & excpt_r) {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Package " << pkg->name << " has bad edition '"
+ << (header->tag_epoch().empty()?"":(header->tag_epoch()+":"))
+ << header->tag_version()
+ << (header->tag_release().empty()?"":(string("-") + header->tag_release())) << "'";
+ return 0;
+ }
+
+ Arch arch;
+ try {
+ pkg->arch = Arch( header->tag_arch() );
+ }
+ catch (Exception & excpt_r) {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Package " << pkg->name << " has bad architecture '" << header->tag_arch() << "'";
+ return 0;
+ }
+
+ pkg->deps[Dep::REQUIRES] = header->tag_requires( filerequires );
+ pkg->deps[Dep::PREREQUIRES] = header->tag_prerequires( filerequires );
+ pkg->deps[Dep::CONFLICTS] = header->tag_conflicts( filerequires );
+ pkg->deps[Dep::OBSOLETES] = header->tag_obsoletes( filerequires );
+ pkg->deps[Dep::ENHANCES] = header->tag_enhances( filerequires );
+ pkg->deps[Dep::SUPPLEMENTS] = header->tag_supplements( filerequires );
+
+// Dependencies deps;
+
+// RecordId shareDataWith;
+// std::string vendor;
+// ByteCount installedSize;
+// Date buildTime;
+// DefaultIntegral<bool,false> installOnly;
+// TranslatedText summary;
+// TranslatedText description;
+// TranslatedText licenseToConfirm;
+// TranslatedText insnotify;
+// TranslatedText delnotify;
+// RecordId repository;
+
+// Location repositoryLocation;
+// std::string group;
+// std::set<std::string> keywords;
+// Changelog changelog;
+// std::list<std::string> authors;
+// std::string buildhost;
+// std::string distribution;
+// std::string license;
+// std::string packager;
+// std::string url;
+// std::string operatingSystem;
+// std::string prein;
+// std::string postin;
+// std::string preun;
+// std::string postun;
+//
+
+ list<string> filenames = header->tag_filenames();
+ pkg->deps[Dep::PROVIDES] = header->tag_provides ( filerequires );
+ static str::smatch what;
+ static const str::regex filenameRegex( "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
+ str::regex::optimize|str::regex::nosubs );
+
+ for (list<string>::const_iterator filename = filenames.begin();
+ filename != filenames.end();
+ ++filename)
+ {
+ if ( str::regex_search( filename->begin(), filename->end(), what, filenameRegex ) )
+ {
+ try {
+ pkg->deps[Dep::PROVIDES].insert(capability::buildFile( ResTraits<Package>::kind, *filename ));
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Ignoring invalid capability: " << *filename << endl;
+ }
+ }
+ }
+
+ return pkg;
+}
+
+
+/** RepoParser implementation.
+ * \todo Clean data on exeption.
+ */
+class RepoParser::Impl
+{
+ public:
+ Impl( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r )
+ : _repositoryId( repositoryId_r )
+ , _consumer( consumer_r )
+ {
+ _ticks.sendTo( fnc_r );
+ }
+ int extract_packages_from_directory( const Pathname & path,
+ bool recursive);
+ /** Main entry to parser. */
+ void parse( const Pathname & reporoot_r );
+ public:
+
+ private:
+ data::RecordId _repositoryId;
+ data::ResolvableDataConsumer & _consumer;
+ ProgressData _ticks;
+
+ private: // these (and _ticks) are actually scoped per parse() run.
+};
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::Impl::parse
+// METHOD TYPE : void
+//
+void RepoParser::Impl::parse( const Pathname & reporoot_r )
+{
+ extract_packages_from_directory( reporoot_r, true );
+/*if ( ! _ticks.incr() )
+ ZYPP_THROW( AbortRequestException() );*/
+ // Done
+ if ( ! _ticks.toMax() )
+ ZYPP_THROW( AbortRequestException() );
+}
+
+int RepoParser::Impl::extract_packages_from_directory( const Pathname & path,
+ bool recursive)
+{
+ using target::rpm::RpmHeader;
+ Pathname filename;
+ PathInfo magic;
+ bool distro_magic, pkginfo_magic;
+
+// DBG << "extract_packages_from_directory(.., " << path << ", " << repo.info().alias() << ", " << recursive << ")" << endl;
+
+ /*
+ Check for magic files that indicate how to treat the
+ directory. The files aren't read -- it is sufficient that
+ they exist.
+ */
+
+ magic = PathInfo( path + "/RC_SKIP" );
+ if (magic.isExist()) {
+ return 0;
+ }
+
+ magic = PathInfo( path + "/RC_RECURSIVE" );
+ if (magic.isExist())
+ recursive = true;
+
+ magic = PathInfo( path + "/RC_BY_DISTRO" );
+ distro_magic = magic.isExist();
+
+ pkginfo_magic = true;
+ magic = PathInfo( path + "/RC_IGNORE_PKGINFO" );
+ if (magic.isExist())
+ pkginfo_magic = false;
+
+
+ std::list<std::string> dircontent;
+ if (filesystem::readdir( dircontent, path, false) != 0) { // dont look for dot files
+ ERR << "readdir " << path << " failed" << endl;
+ return -1;
+ }
+
+ for (std::list<std::string>::const_iterator it = dircontent.begin(); it != dircontent.end(); ++it) {
+ Pathname file_path = path + *it;
+ PathInfo file_info( file_path );
+ if (recursive && file_info.isDir()) {
+
+ extract_packages_from_directory( file_path, recursive );
+
+ } else if (file_info.isFile() && file_path.extension() == ".rpm" ) {
+ RpmHeader::constPtr header = RpmHeader::readPackage( file_path, RpmHeader::NOSIGNATURE );
+#warning FIX creation of Package from src.rpm header
+ data::Package_Ptr package = makePackageDataFromHeader( header, NULL, *it, _repositoryId );
+ if (package != NULL) {
+ DBG << "Adding package " << *package << endl;
+ _consumer.consumePackage( _repositoryId, package );
+ }
+ }
+ }
+ return 0;
+}
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : RepoParser
+//
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::RepoParser
+// METHOD TYPE : Ctor
+//
+RepoParser::RepoParser( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r )
+: _pimpl( new Impl( repositoryId_r, consumer_r, fnc_r ) )
+{}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::~RepoParser
+// METHOD TYPE : Dtor
+//
+RepoParser::~RepoParser()
+{}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::parse
+// METHOD TYPE : void
+//
+void RepoParser::parse( const Pathname & reporoot_r )
+{
+ _pimpl->parse( reporoot_r );
+}
+
+/////////////////////////////////////////////////////////////////
+} // namespace plaindir
+///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+} // namespace parser
+///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
Added: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h (added)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h Fri Jun 22 16:05:21 2007
@@ -0,0 +1,73 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#ifndef ZYPP_PARSER_PLAINDIR_REPOPARSER_H
+#define ZYPP_PARSER_PLAINDIR_REPOPARSER_H
+
+#include <iosfwd>
+
+#include "zypp/base/PtrTypes.h"
+#include "zypp/base/NonCopyable.h"
+
+#include "zypp/data/RecordId.h"
+#include "zypp/data/ResolvableDataConsumer.h"
+
+#include "zypp/ProgressData.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace parser
+ { /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace plaindir
+ { /////////////////////////////////////////////////////////////////
+
+ /** Plaindir metadata parser. */
+
+ class RepoParser : private base::NonCopyable
+ {
+ public:
+ /** Ctor.
+ *
+ * \param repositoryId_r repository identifier
+ * \param consumer_r consumer of parsed data
+ * \param fnc_r progress reporting function
+ */
+ RepoParser( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() );
+ /** Dtor */
+ ~RepoParser();
+
+ /** Parse a local repository located at \a reporoot_r.
+ *
+ * \param reporoot_r The local repositories root directory.
+ * \throw Exception on errors.
+ */
+ void parse( const Pathname & reporoot_r );
+
+ public:
+ class Impl;
+ private:
+ RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace plaindir
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+ } // namespace parser
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP2_PARSER_SUSETAGS_REPOPARSER_H
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc Fri Jun 22 16:05:21 2007
@@ -21,6 +21,7 @@
const RepoType RepoType::RPMMD(RepoType::RPMMD_e);
const RepoType RepoType::YAST2(RepoType::YAST2_e);
+ const RepoType RepoType::RPMPLAINDIR(RepoType::RPMPLAINDIR_e);
//const RepoType RepoType::NONE(RepoType::NONE_e);
RepoType::RepoType(const std::string & strval_r)
@@ -39,6 +40,7 @@
_table["susetags"] = RepoType::YAST2_e;
_table["yast"] = RepoType::YAST2_e;
_table["yast2"] = RepoType::YAST2_e;
+ _table["plaindir"] = RepoType::RPMPLAINDIR_e;
_table["NONE"] = _table["none"] = RepoType::NONE_e;
}
@@ -61,6 +63,7 @@
// initialize it
_table[RPMMD_e] = "rpm-md";
_table[YAST2_e] = "yast2";
+ _table[RPMPLAINDIR_e] = "plaindir";
_table[NONE_e] = "NONE";
}
return _table[_type];
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h Fri Jun 22 16:05:21 2007
@@ -28,15 +28,19 @@
{
static const RepoType RPMMD;
static const RepoType YAST2;
+ static const RepoType RPMPLAINDIR;
//static const RepoType NONE;
enum Type
{
NONE_e,
RPMMD_e,
- YAST2_e
+ YAST2_e,
+ RPMPLAINDIR_e,
};
+ RepoType() : _type(NONE_e) {}
+
RepoType(Type type) : _type(type) {}
explicit RepoType(const std::string & strval_r);
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc Fri Jun 22 16:05:21 2007
@@ -1104,6 +1104,15 @@
return empty_list;
}
+inline static void insertCaps( CapSet &capset, capability::CapabilityImplPtrSet ptrset, CapFactory &factory )
+{
+ for ( capability::CapabilityImplPtrSet::const_iterator it = ptrset.begin();
+ it != ptrset.end();
+ ++it )
+ {
+ capset.insert( factory.fromImpl(*it) );
+ }
+}
//
// make Package::Ptr from RpmHeader
@@ -1168,9 +1177,9 @@
arch );
list<string> filenames = impl->filenames();
- dataCollect[Dep::PROVIDES] = header->tag_provides ( filerequires );
CapFactory capfactory;
-
+ insertCaps( dataCollect[Dep::PROVIDES], header->tag_provides( filerequires ), capfactory );
+
static str::smatch what;
static const str::regex filenameRegex( "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
str::regex::optimize|str::regex::nosubs );
@@ -1183,7 +1192,7 @@
{
try
{
- dataCollect[Dep::PROVIDES].insert( capfactory.parse(ResTraits<Package>::kind, *filename) );
+ dataCollect[Dep::PROVIDES].insert(capfactory.fromImpl(capability::buildFile(ResTraits<Package>::kind, *filename) ));
}
catch (Exception & excpt_r)
{
@@ -1193,12 +1202,12 @@
}
}
- dataCollect[Dep::REQUIRES] = header->tag_requires( filerequires );
- dataCollect[Dep::PREREQUIRES] = header->tag_prerequires( filerequires );
- dataCollect[Dep::CONFLICTS] = header->tag_conflicts( filerequires );
- dataCollect[Dep::OBSOLETES] = header->tag_obsoletes( filerequires );
- dataCollect[Dep::ENHANCES] = header->tag_enhances( filerequires );
- dataCollect[Dep::SUPPLEMENTS] = header->tag_supplements( filerequires );
+ insertCaps( dataCollect[Dep::REQUIRES], header->tag_requires( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::PREREQUIRES], header->tag_prerequires( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::CONFLICTS], header->tag_conflicts( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::OBSOLETES], header->tag_obsoletes( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::ENHANCES], header->tag_enhances( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::SUPPLEMENTS], header->tag_supplements( filerequires ), capfactory );
try
{
@@ -1214,7 +1223,6 @@
return pptr;
}
-
const list<Package::Ptr> & RpmDb::doGetPackages(callback::SendReport<ScanDBReport> & report)
{
if ( packagesValid() )
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc Fri Jun 22 16:05:21 2007
@@ -26,6 +26,7 @@
#include "zypp/base/Exception.h"
using namespace std;
+using namespace zypp::capability;
namespace zypp
{
@@ -272,9 +273,9 @@
//
// DESCRIPTION :
//
-CapSet RpmHeader::PkgRelList_val( tag tag_r, bool pre, set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::PkgRelList_val( tag tag_r, bool pre, set<string> * freq_r ) const
{
- CapSet ret;
+ CapabilityImplPtrSet ret;
int_32 kindFlags = 0;
int_32 kindVersion = 0;
@@ -370,10 +371,9 @@
if ((pre && (f & RPMSENSE_PREREQ))
|| ((! pre) && !(f & RPMSENSE_PREREQ)))
{
- CapFactory _f;
try
{
- Capability cap = _f.parse(
+ CapabilityImpl::Ptr cap = capability::buildVersioned(
ResTraits<Package>::kind,
n,
op,
@@ -397,11 +397,11 @@
//
//
// METHOD NAME : RpmHeader::tag_provides
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_provides( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_provides( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_PROVIDENAME, false, freq_r );
}
@@ -410,11 +410,11 @@
//
//
// METHOD NAME : RpmHeader::tag_requires
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_requires( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_requires( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_REQUIRENAME, false, freq_r );
}
@@ -423,11 +423,11 @@
//
//
// METHOD NAME : RpmHeader::tag_requires
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_prerequires( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_prerequires( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_REQUIRENAME, true, freq_r );
}
@@ -436,11 +436,11 @@
//
//
// METHOD NAME : RpmHeader::tag_conflicts
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_conflicts( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_conflicts( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_CONFLICTNAME, false, freq_r );
}
@@ -449,11 +449,11 @@
//
//
// METHOD NAME : RpmHeader::tag_obsoletes
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_obsoletes( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_obsoletes( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_OBSOLETENAME, false, freq_r );
}
@@ -462,16 +462,16 @@
//
//
// METHOD NAME : RpmHeader::tag_enhances
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_enhances( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_enhances( set<string> * freq_r ) const
{
#ifdef HAVE_RPM_ENHANCES
return PkgRelList_val( RPMTAG_ENHANCESNAME, false, freq_r );
#else
- return CapSet();
+ return CapabilityImplPtrSet();
#endif
}
@@ -479,13 +479,13 @@
//
//
// METHOD NAME : RpmHeader::tag_supplements
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_supplements( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_supplements( set<string> * freq_r ) const
{
- return CapSet();
+ return CapabilityImplPtrSet();
#warning NEEDS RPMTAG_SUPPLEMENTSNAME
#if 0
return PkgRelList_val( RPMTAG_SUPPLEMENTSNAME, false, freq_r );
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h Fri Jun 22 16:05:21 2007
@@ -22,6 +22,8 @@
#include "zypp/CapSetFwd.h"
#include "zypp/Pathname.h"
#include "zypp/DiskUsage.h"
+#include "zypp/capability/CapabilityImpl.h"
+
namespace zypp
{
@@ -68,7 +70,7 @@
private:
- CapSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
public:
@@ -107,31 +109,31 @@
/**
* If <code>freq_r</code> is not NULL, file dependencies found are inserted.
**/
- CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_enhances( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_enhances( std::set<std::string> * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_supplements( std::set<std::string> * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_supplements( std::set<std::string> * freq_r = 0 ) const;
ByteCount tag_size() const;
ByteCount tag_archivesize() const;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5832 - in /branches/REFACTORING-10_3/libzypp/zypp: RepoManager.cc RepoManager.h
by dmacvicar@svn.opensuse.org 22 Jun '07
by dmacvicar@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: dmacvicar
Date: Fri Jun 22 16:04:42 2007
New Revision: 5832
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5832&view=rev
Log:
- implement modifyRepository (not tested, no testcase yet)
Modified:
branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc
branches/REFACTORING-10_3/libzypp/zypp/RepoManager.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc Fri Jun 22 16:04:42 2007
@@ -25,6 +25,7 @@
#include "zypp/cache/CacheStore.h"
#include "zypp/repo/cached/RepoImpl.h"
+#include "zypp/media/MediaManager.h"
#include "zypp/MediaSetAccess.h"
#include "zypp/parser/RepoFileReader.h"
@@ -497,6 +498,12 @@
if ( access.doesFileExist("/content") )
return repo::RepoType::YAST2;
+ // if it is a local url
+ if ( ! media::MediaManager::downloads(url) )
+ {
+
+ }
+
return repo::RepoType("UNKNOWN");
}
@@ -722,6 +729,64 @@
////////////////////////////////////////////////////////////////////////////
+ void RepoManager::modifyRepository( const std::string &alias,
+ const RepoInfo & newinfo,
+ const ProgressData::ReceiverFnc & progressrcv )
+ {
+ RepoInfo toedit = getRepositoryInfo(alias);
+
+ if (toedit.filepath().empty())
+ {
+ ZYPP_THROW(RepoException("Can't figure where the repo is stored"));
+ }
+ else
+ {
+ // figure how many repos are there in the file:
+ std::list<RepoInfo> filerepos = repositories_in_file(toedit.filepath());
+
+ // there are more repos in the same file
+ // write them back except the deleted one.
+ //TmpFile tmp;
+ //std::ofstream file(tmp.path().c_str());
+ std::ofstream file(toedit.filepath().c_str());
+ if (!file) {
+ //ZYPP_THROW (Exception( "Can't open " + tmp.path().asString() ) );
+ ZYPP_THROW (Exception( "Can't open " + toedit.filepath().asString() ) );
+ }
+ for ( std::list<RepoInfo>::const_iterator fit = filerepos.begin();
+ fit != filerepos.end();
+ ++fit )
+ {
+ // if the alias is different, dump the original
+ // if it is the same, dump the provided one
+ if ( (*fit).alias() != toedit.alias() )
+ (*fit).dumpRepoOn(file);
+ else
+ toedit.dumpRepoOn(file);
+ }
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ RepoInfo RepoManager::getRepositoryInfo( const std::string &alias,
+ const ProgressData::ReceiverFnc & progressrcv )
+ {
+ std::list<RepoInfo> repos = knownRepositories();
+ for ( std::list<RepoInfo>::const_iterator it = repos.begin();
+ it != repos.end();
+ ++it )
+ {
+ if ( (*it).alias() == alias )
+ return *it;
+ }
+ RepoInfo info;
+ info.setAlias(info.alias());
+ ZYPP_THROW(RepoNotFoundException(info));
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+
std::ostream & operator<<( std::ostream & str, const RepoManager & obj )
{
return str << *obj._pimpl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoManager.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/RepoManager.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/RepoManager.h Fri Jun 22 16:04:42 2007
@@ -169,6 +169,9 @@
/**
* \short Create a repository object from the cache data
*
+ * Creating from cache requires that the repository is
+ * refreshed (metadata downloaded) and cached
+ *
* \throw RepoNotCachedException When the source is not cached.
*/
Repository createFromCache( const RepoInfo &info,
@@ -217,6 +220,30 @@
void removeRepository( const RepoInfo & info,
const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ /**
+ * \short Modify repository attributes
+ *
+ * \throws RepoNotFoundException If no repo match
+ * \throws ParseException If the file parsing fails
+ * \throws Exception On other errors.
+ */
+ void modifyRepository( const std::string &alias,
+ const RepoInfo & newinfo,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+
+ /**
+ * \short Find a matching repository info
+ *
+ * \note if multple repositories incorrectly share the
+ * same alias, the first one found will be returned.
+ *
+ * \throws RepoNotFoundException If no repo match
+ * \throws ParseException If the file parsing fails
+ * \throws Exception On other errors.
+ */
+ RepoInfo getRepositoryInfo( const std::string &alias,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+
protected:
RepoStatus rawMetadataStatus( const RepoInfo &info );
RepoStatus cacheStatus( const RepoInfo &info );
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5831 - /trunk/libzypp-testsuite/solver/src/deptestomatic.cc
by schubi2@svn.opensuse.org 22 Jun '07
by schubi2@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: schubi2
Date: Fri Jun 22 15:30:40 2007
New Revision: 5831
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5831&view=rev
Log:
New API calls which provides more information about one
resolvable after a solverrun:
isSelectedBy (const PoolItem_Ref item);
selects (const PoolItem_Ref item);
Modified:
trunk/libzypp-testsuite/solver/src/deptestomatic.cc
Modified: trunk/libzypp-testsuite/solver/src/deptestomatic.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/solver/src/dep…
==============================================================================
--- trunk/libzypp-testsuite/solver/src/deptestomatic.cc (original)
+++ trunk/libzypp-testsuite/solver/src/deptestomatic.cc Fri Jun 22 15:30:40 2007
@@ -741,7 +741,7 @@
// collect all installed items in a set
void
-print_pool( const string & prefix = "", bool show_all = true, string show_licence = "false" )
+print_pool( solver::detail::Resolver_Ptr resolver, const string & prefix = "", bool show_all = true, string show_licence = "false", bool verbose = false )
{
SortItem info( show_all );
cout << "Current pool:" << endl;
@@ -758,6 +758,26 @@
cout << it->second;
}
cout << endl;
+ if (verbose) {
+ zypp::solver::detail::ItemCapKindList selectedBy = resolver->isSelectedBy(it->second);
+ zypp::solver::detail::ItemCapKindList select = resolver->selects(it->second);
+ for (zypp::solver::detail::ItemCapKindList::const_iterator iter = selectedBy.begin(); iter != selectedBy.end(); ++iter) {
+ if (iter == selectedBy.begin()) {
+ cout << prefix << ++count << ": ";
+ cout << " will be selected by:" << endl;
+ }
+ cout << prefix << ++count << ": ";
+ cout << " " << iter->item << endl;
+ }
+ for (zypp::solver::detail::ItemCapKindList::const_iterator iter = select.begin(); iter != select.end(); ++iter) {
+ if (iter == select.begin()) {
+ cout << prefix << ++count << ": ";
+ cout << " will select:" << endl;
+ }
+ cout << prefix << ++count << ": ";
+ cout << " " << iter->item << endl;
+ }
+ }
}
cout << "Pool End." << endl;
return;
@@ -1412,7 +1432,7 @@
resolver->doUpgrade(stats);
- print_pool( MARKER );
+ print_pool( resolver, MARKER );
} else if (node->equals ("establish")) {
@@ -1630,8 +1650,9 @@
} else if (node->equals ("showpool")) {
string prefix = node->getProp ("prefix");
string all = node->getProp ("all");
- string get_licence = node->getProp ("getlicence");
- print_pool( prefix, !all.empty(), get_licence );
+ string get_licence = node->getProp ("getlicence");
+ string verbose = node->getProp ("verbose");
+ print_pool( resolver, prefix, !all.empty(), get_licence, !verbose.empty() );
} else if (node->equals ("lock")) {
string source_alias = node->getProp ("channel");
string package_name = node->getProp ("package");
@@ -1937,7 +1958,7 @@
resolver->doUpgrade(stats);
- print_pool( MARKER );
+ print_pool( resolver, MARKER );
} else if (node->equals ("establish")) {
@@ -2146,8 +2167,9 @@
} else if (node->equals ("showpool")) {
string prefix = node->getProp ("prefix");
string all = node->getProp ("all");
- string get_licence = node->getProp ("getlicence");
- print_pool( prefix, !all.empty(), get_licence );
+ string get_licence = node->getProp ("getlicence");
+ string verbose = node->getProp ("verbose");
+ print_pool( resolver, prefix, !all.empty(), get_licence, !verbose.empty() );
} else if (node->equals ("lock")) {
string source_alias = node->getProp ("channel");
string package_name = node->getProp ("package");
@@ -2262,7 +2284,7 @@
node = node->next();
}
-print_pool( MARKER );
+print_pool( resolver, MARKER );
report_solutions (resolver, instorder, mediaorder);
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
22 Jun '07
Author: schubi2
Date: Fri Jun 22 15:29:54 2007
New Revision: 5830
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5830&view=rev
Log:
r 5829
Modified:
trunk/libzypp/package/libzypp.changes
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?…
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Fri Jun 22 15:29:54 2007
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Fri Jun 22 15:28:03 CEST 2007 - schubi(a)suse.de
+
+- New API calls which provides more information about one
+ resolvable after a solverrun:
+ isSelectedBy (const PoolItem_Ref item);
+ selects (const PoolItem_Ref item);
+- Revision 5829
+
+-------------------------------------------------------------------
Wed Jun 20 11:47:33 CEST 2007 - schubi(a)suse.de
- Ignore conflicting items which are uninstallable
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5829 - in /trunk/libzypp/zypp: ProblemSolution.h Resolver.cc Resolver.h ResolverProblem.h solver/detail/Resolver.cc solver/detail/Resolver.h solver/detail/ResolverInfoNeededBy.h
by schubi2@svn.opensuse.org 22 Jun '07
by schubi2@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: schubi2
Date: Fri Jun 22 15:27:34 2007
New Revision: 5829
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5829&view=rev
Log:
New API calls added:
const solver::detail::ItemCapKindList isSelectedBy (const PoolItem_Ref
item);
const solver::detail::ItemCapKindList selects (const PoolItem_Ref
item);
Modified:
trunk/libzypp/zypp/ProblemSolution.h
trunk/libzypp/zypp/Resolver.cc
trunk/libzypp/zypp/Resolver.h
trunk/libzypp/zypp/ResolverProblem.h
trunk/libzypp/zypp/solver/detail/Resolver.cc
trunk/libzypp/zypp/solver/detail/Resolver.h
trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h
Modified: trunk/libzypp/zypp/ProblemSolution.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ProblemSolution.h?r…
==============================================================================
--- trunk/libzypp/zypp/ProblemSolution.h (original)
+++ trunk/libzypp/zypp/ProblemSolution.h Fri Jun 22 15:27:34 2007
@@ -14,7 +14,6 @@
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/PtrTypes.h"
-#include "zypp/Resolver.h"
#include "zypp/solver/detail/Resolver.h"
#include "zypp/ResolverProblem.h"
#include "zypp/solver/detail/SolutionAction.h"
Modified: trunk/libzypp/zypp/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.cc?rev=582…
==============================================================================
--- trunk/libzypp/zypp/Resolver.cc (original)
+++ trunk/libzypp/zypp/Resolver.cc Fri Jun 22 15:27:34 2007
@@ -110,7 +110,14 @@
{ return _pimpl->maxSolverPasses(); }
bool Resolver::createSolverTestcase (const std::string & dumpPath)
{ solver::detail::Testcase testcase (dumpPath);
- return testcase.createTestcase(*_pimpl);}
+ return testcase.createTestcase(*_pimpl);}
+#if 1
+ const solver::detail::ItemCapKindList Resolver::isSelectedBy (const PoolItem_Ref item)
+ { return _pimpl->isSelectedBy (item); }
+ const solver::detail::ItemCapKindList Resolver::selects (const PoolItem_Ref item)
+ { return _pimpl->selects (item); }
+#endif
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
Modified: trunk/libzypp/zypp/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.h?rev=5829…
==============================================================================
--- trunk/libzypp/zypp/Resolver.h (original)
+++ trunk/libzypp/zypp/Resolver.h Fri Jun 22 15:27:34 2007
@@ -270,9 +270,40 @@
/**
* Generates a solver Testcase of the current state
*
- * return true if it was successful
+ * \parame dumpPath destination directory of the created directory
+ * \return true if it was successful
*/
- bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+ bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+
+
+ /**
+ * Gives information about WHO has selected an item for installation.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which has triggered the selection of the given param item.
+ * cap Capability which has triggerd this selection
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: Start a solver run before in order to have a result. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList isSelectedBy (const PoolItem_Ref item);
+
+ /**
+ * Gives information about WHICH additional items have been selected by the given item.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which has BEEN triggered by the selection of the given param item.
+ * cap Capability which has BEEN triggerd by this selection
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: Start a solver run before in order to have a result. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList selects (const PoolItem_Ref item);
+
protected:
Modified: trunk/libzypp/zypp/ResolverProblem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResolverProblem.h?r…
==============================================================================
--- trunk/libzypp/zypp/ResolverProblem.h (original)
+++ trunk/libzypp/zypp/ResolverProblem.h Fri Jun 22 15:27:34 2007
@@ -14,7 +14,6 @@
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/PtrTypes.h"
-#include "zypp/Resolver.h"
#include "zypp/ProblemSolution.h"
/////////////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Fri Jun 22 15:27:34 2007
@@ -33,6 +33,7 @@
#include "zypp/CapFilters.h"
#include "zypp/ZYppFactory.h"
#include "zypp/SystemResObject.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
/////////////////////////////////////////////////////////////////////////
@@ -161,12 +162,99 @@
_best_context = NULL;
_timed_out = false;
+ _isSelectedBy.clear();
+ _selects.clear();
+
if (resetValidResults)
contextPool.reset();
}
+//--------------------------------------------------------------------------------------------------
+// Get more information about the solverrun
+// Which item will be triggerd by another item or triggers an item for installation
+typedef struct {
+ ItemCapKindMap isSelectedBy;
+ ItemCapKindMap selects;
+} Collector;
+
+
+static void
+collector_cb_needed (ResolverInfo_Ptr info, void *data)
+{
+ Collector *collector = (Collector *)data;
+ if (info->type() == RESOLVER_INFO_TYPE_NEEDED_BY) {
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ if (needed_by->items().size() >= 1) {
+ PoolItem_Ref item = info->affected();
+ PoolItemList itemList = needed_by->items();
+
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); iter++) {
+ ItemCapKind capKind( *iter, needed_by->capability(), needed_by->capKind() );
+ collector->isSelectedBy.insert (make_pair( item, capKind));
+
+ ItemCapKind capKindReverse( item, needed_by->capability(), needed_by->capKind() );
+ collector->selects.insert (make_pair( *iter, capKindReverse));
+ }
+
+ }
+ }
+}
+
+void
+Resolver::collectResolverInfo(void)
+{
+ ResolverContext_Ptr collectContext = context(); // best context or failed context
+ if ( collectContext != NULL
+ && _isSelectedBy.empty()
+ && _selects.empty()) {
+ Collector collector;
+ collectContext->foreachInfo (PoolItem(), RESOLVER_INFO_PRIORITY_VERBOSE, collector_cb_needed, &collector);
+ _isSelectedBy = collector.isSelectedBy;
+ _selects = collector.selects;
+ }
+}
+
+
+const ItemCapKindList Resolver::isSelectedBy (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _isSelectedBy.find(item); iter != _isSelectedBy.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _isSelectedBy.end();
+ }
+ }
+ return ret;
+}
+
+const ItemCapKindList Resolver::selects (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _selects.find(item); iter != _selects.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _selects.end();
+ }
+ }
+ return ret;
+}
+
+//----------------------------------------------------------------------------------------------------
ResolverContext_Ptr
Resolver::context (void) const
{
Modified: trunk/libzypp/zypp/solver/detail/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.h Fri Jun 22 15:27:34 2007
@@ -54,6 +54,27 @@
/////////////////////////////////////////////////////////////////////
namespace detail
{ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ItemCapKind
+ //
+ /** */
+ struct ItemCapKind
+ {
+ public:
+ Capability cap; //Capability which has triggerd this selection
+ Dep capKind; //Kind of that capability
+ PoolItem_Ref item; //Item which has triggered this selection
+
+ ItemCapKind( PoolItem i, Capability c, Dep k)
+ : cap( c )
+ , capKind( k )
+ , item( i )
+ { }
+ };
+ typedef std::multimap<PoolItem_Ref,ItemCapKind> ItemCapKindMap;
+ typedef std::list<ItemCapKind> ItemCapKindList;
///////////////////////////////////////////////////////////////////
//
@@ -90,7 +111,10 @@
// list of problematic items after doUpgrade()
PoolItemList _update_items;
-
+ // Additional information about the solverrun
+ ItemCapKindMap _isSelectedBy;
+ ItemCapKindMap _selects;
+
CapSet _extra_caps;
CapSet _extra_conflicts;
@@ -138,6 +162,9 @@
bool doesObsoleteCapability (PoolItem_Ref candidate, const Capability & cap);
bool doesObsoleteItem (PoolItem_Ref candidate, PoolItem_Ref installed);
+ void collectResolverInfo (void);
+
+
public:
Resolver (const ResPool & pool);
@@ -237,6 +264,12 @@
// reset all SOLVER transaction in pool
void undo(void);
+ // Get more information about the solverrun
+ // Which item will be triggerd by another item or triggers an item for
+ // installation
+ const ItemCapKindList isSelectedBy (const PoolItem_Ref item);
+ const ItemCapKindList selects (const PoolItem_Ref item);
+
// only for testsuite
void reset (const bool resetValidResults = false);
Modified: trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resol…
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h (original)
+++ trunk/libzypp/zypp/solver/detail/ResolverInfoNeededBy.h Fri Jun 22 15:27:34 2007
@@ -65,7 +65,8 @@
virtual std::string message (void) const;
virtual ResolverInfo_Ptr copy (void) const;
void setCapability (const Capability & cap, const Dep & capKind) { _cap = cap; _capKind = capKind; }
-;
+ Dep capKind() const {return _capKind;}
+ Capability capability() const {return _cap;};
};
///////////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5828 - in /branches/REFACTORING-10_3/libzypp/zypp: Repository.cc Repository.h repo/RepositoryImpl.cc repo/RepositoryImpl.h
by mlandres@svn.opensuse.org 22 Jun '07
by mlandres@svn.opensuse.org 22 Jun '07
22 Jun '07
Author: mlandres
Date: Fri Jun 22 13:47:48 2007
New Revision: 5828
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5828&view=rev
Log:
remove unneeded friends and fix constness
Modified:
branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
branches/REFACTORING-10_3/libzypp/zypp/Repository.h
branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.cc Fri Jun 22 13:47:48 2007
@@ -41,38 +41,38 @@
Repository::NumericId Repository::numericId() const
{ return _pimpl->numericId(); }
- const ResStore & Repository::resolvables()
+ const ResStore & Repository::resolvables() const
{
return _pimpl->resolvables();
}
-
- const RepoInfo Repository::info() const
+
+ const RepoInfo & Repository::info() const
{
return _pimpl->info();
}
-
+
const std::list<packagedelta::PatchRpm> &
Repository::patchRpms() const
{
return _pimpl->patchRpms();
}
-
+
const std::list<packagedelta::DeltaRpm> &
Repository::deltaRpms() const
{
return _pimpl->deltaRpms();
}
-
+
std::ostream & operator<<( std::ostream & str, const Repository & obj )
{
return str << "[" << obj.info().alias() << "]" << endl;
}
-
+
bool operator==( const Repository & lhs, const Repository & rhs )
{
return (lhs.info().alias() == rhs.info().alias());
}
-
+
bool operator<( const Repository & lhs, const Repository & rhs )
{
return (lhs.info().alias() < rhs.info().alias());
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.h Fri Jun 22 13:47:48 2007
@@ -14,7 +14,7 @@
namespace zypp
{
class ResStore;
-
+
namespace repo
{
DEFINE_PTR_TYPE(RepositoryImpl);
@@ -23,24 +23,19 @@
class Repository : private base::SafeBool<Repository>
{
- public:
- friend std::ostream & operator<<( std::ostream & str, const Repository & obj );
- friend bool operator==( const Repository & lhs, const Repository & rhs );
- friend bool operator<( const Repository & lhs, const Repository & rhs );
-
public:
typedef repo::RepositoryImpl Impl;
typedef repo::RepositoryImpl_Ptr Impl_Ptr;
public:
- /**
+ /**
* \short Default ctor: noRepository.
* \see RepoManager::createFromCache.
*/
Repository();
- /**
+ /**
* A dummy Repository (Id \c 0) providing nothing, doing nothing.
*/
static const Repository noRepository;
@@ -59,23 +54,23 @@
/**
* \short Get the resolvables for repo
*/
- const zypp::ResStore & resolvables();
+ const zypp::ResStore & resolvables() const;
/**
* \short Repository info used to create this repository
*/
- const RepoInfo info() const;
+ const RepoInfo & info() const;
/**
* \short Patch RPMs the repository provides
*/
const std::list<packagedelta::PatchRpm> & patchRpms() const;
-
+
/**
* \short Delta RPMs the repository provides
*/
const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
-
+
private:
friend base::SafeBool<Repository>::operator bool_type() const;
/** \ref SafeBool test. */
@@ -97,10 +92,13 @@
RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
};
+ /** \relates Repository */
std::ostream & operator<<( std::ostream & str, const Repository & obj );
+ /** \relates Repository */
bool operator==( const Repository & lhs, const Repository & rhs );
+ /** \relates Repository */
bool operator<( const Repository & lhs, const Repository & rhs );
-
+
}
#endif
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.cc Fri Jun 22 13:47:48 2007
@@ -11,7 +11,7 @@
}
-const RepoInfo RepositoryImpl::info() const
+const RepoInfo & RepositoryImpl::info() const
{
return _info;
}
@@ -36,7 +36,7 @@
{
return _patchRpms;
}
-
+
const std::list<packagedelta::DeltaRpm> &
RepositoryImpl::deltaRpms() const
{
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepositoryImpl.h Fri Jun 22 13:47:48 2007
@@ -29,34 +29,34 @@
{
friend std::ostream & operator<<( std::ostream & str, const RepositoryImpl & obj );
public:
-
+
/**
* \short Ctor.
* \param info What is known about this source at construction time.
*
*/
RepositoryImpl( const RepoInfo &info = RepoInfo() );
-
+
+ /**
+ * \short Dtor
+ */
+ ~RepositoryImpl();
+
/**
* \short Information about this repository
* You can't change this information after creation.
* Use \ref RepoManager for that.
*/
- const RepoInfo info() const;
-
- /**
- * \short Dtor
- */
- ~RepositoryImpl();
+ const RepoInfo & info() const;
const ResStore & resolvables() const;
- struct null {};
-
const std::list<packagedelta::PatchRpm> & patchRpms() const;
const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
-
+
public:
+ struct null {};
+
/** Offer default Impl. */
static RepositoryImpl_Ptr nullimpl()
{
@@ -68,13 +68,13 @@
Repository selfRepository()
{ return Repository( this ); }
+
protected:
- RepoInfo _info;
-
ResStore _store;
-
std::list<packagedelta::PatchRpm> _patchRpms;
std::list<packagedelta::DeltaRpm> _deltaRpms;
+ private:
+ RepoInfo _info;
};
}
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 10:14:52 2007
New Revision: 5827
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5827&view=rev
Log:
enabled zypper info commands
Modified:
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5827&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Jun 22 10:14:52 2007
@@ -462,7 +462,7 @@
"This command has no additional options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if") {
+ else if (command == ZypperCommand::INFO) {
static struct option info_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -476,7 +476,7 @@
"This command has no additional options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "patch-info") {
+ else if (command == ZypperCommand::RUG_PATCH_INFO) {
static struct option patch_info_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -933,7 +933,8 @@
// -----------------------------( info )------------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if" || command_str == "patch-info") {
+ else if (command == ZypperCommand::INFO ||
+ command == ZypperCommand::RUG_PATCH_INFO) {
if (ghelp || arguments.size() == 0) {
cerr << specific_help;
return !ghelp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 09:52:56 2007
New Revision: 5826
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5826&view=rev
Log:
made help texts consistent
Modified:
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5826&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Jun 22 09:52:56 2007
@@ -98,7 +98,7 @@
"\tpatch-check, pchk\tCheck for patches\n"
"\tpatches, pch\t\tList patches\n"
"\tlist-updates, lu\tList updates\n"
- "\tupdate, up\t\tUpdate packages\n"
+ "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
"\tinfo, if\t\tShow full information for packages\n"
"\tpatch-info\t\tShow full information for patches\n"
"");
@@ -252,10 +252,14 @@
};
specific_options = install_options;
specific_help = _(
+ "install [options] <name> ...\n"
+ "\n"
+ "'install' - Install resolvabe(s) with specified name(s).\n"
+ "\n"
" Command options:\n"
- "\t--catalog,-c\t\tOnly from this catalog (under development)\n"
- "\t--type,-t\t\tType of resolvable (default: package)\n"
- "\t--no-confirm,-y\tDo not require user confirmation\n"
+ "\t--catalog,-c\t\t\tOnly from this catalog (under development)\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: package)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
);
}
else if (command == ZypperCommand::REMOVE) {
@@ -267,9 +271,13 @@
};
specific_options = remove_options;
specific_help = _(
+ "remove [options] <name> ...\n"
+ "\n"
+ "'remove' - Remove resolvabe(s) with specified name(s).\n"
+ "\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: package)\n"
- "\t--no-confirm,-y\tDo not require user confirmation\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: package)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
);
}
else if (command == ZypperCommand::ADD_REPO) {
@@ -283,7 +291,7 @@
};
specific_options = service_add_options;
specific_help = _(
- "service-add [options] URI [alias]\n"
+ "service-add [options] <URI> <alias>\n"
"\n"
"Add a service (installation source) to the system."
"\n"
@@ -306,7 +314,7 @@
"\n"
"List all defined system services (installation sources)."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::REMOVE_REPO) {
@@ -316,11 +324,11 @@
};
specific_options = service_delete_options;
specific_help = _(
- "service-delete [options] <URI|alias>\n"
+ "service-delete [options] <alias>\n"
"\n"
"Remove service (installation source) from the system."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "service-rename" || command_str == "sr") {
@@ -330,11 +338,11 @@
};
specific_options = service_rename_options;
specific_help = _(
- "service-rename [options] <URI|alias> <new-alias>\n"
+ "service-rename [options] <alias> <new-alias>\n"
"\n"
"Assign new alias to the service specified by URI or current alias."
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::REFRESH) {
@@ -344,9 +352,11 @@
};
specific_options = refresh_options;
specific_help = _(
- "zypper refresh\n"
+ "refresh\n"
"\n"
"Refresh all installation sources found in the system.\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::LIST_UPDATES) {
@@ -362,10 +372,10 @@
"List all available updates\n"
"\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: patch)\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: patch)\n"
);
}
- else if (command == ZypperCommand::NONE) { //command_str == "update" || command_str == "up") {
+ else if (command == ZypperCommand::UPDATE) {
static struct option update_options[] = {
{"type", required_argument, 0, 't'},
{"no-confirm", no_argument, 0, 'y'},
@@ -375,9 +385,12 @@
};
specific_options = update_options;
specific_help = _(
+ "'update' - Update all installed resolvables with newer versions, where applicable.\n"
+ "\n"
" Command options:\n"
- "\t--type,-t\t\tType of resolvable (default: patch)\n"
- "\t--no-confirm,-y\t\tDo not require user confirmation\n"
+ "\n"
+ "\t--type,-t <resolvable_type>\tType of resolvable (default: patch)\n"
+ "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
"\t--skip-interactive\t\tSkip interactive updates\n"
);
}
@@ -400,7 +413,7 @@
};
specific_options = search_options;
specific_help = _(
- "zypper [global-options] search [options] [querystring...]\n"
+ "search [options] [querystring...]\n"
"\n"
"'search' - Search for packages matching given search strings\n"
"\n"
@@ -432,7 +445,7 @@
"\n"
"Check for available patches\n"
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::SHOW_PATCHES) {
@@ -446,7 +459,7 @@
"\n"
"List all available patches\n"
"\n"
- "This command has no options.\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "info" || command_str == "if") {
@@ -456,9 +469,11 @@
};
specific_options = info_options;
specific_help = _(
- "zypper [global-options] info [name...]\n"
+ "info <name> ...\n"
"\n"
"'info' -- Show full information for packages\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::NONE) {//command_str == "patch-info") {
@@ -468,9 +483,11 @@
};
specific_options = patch_info_options;
specific_help = _(
- "zypper [global-options] patch-info [patchname...]\n"
+ "patch-info <patchname> ...\n"
"\n"
"'patch-info' -- Show detailed information for patches\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
else if (command == ZypperCommand::MOO) {
@@ -480,9 +497,11 @@
};
specific_options = moo_options;
specific_help = _(
- "zypper [global-options] moo\n"
+ "moo\n"
"\n"
"'moo' - Show an animal\n"
+ "\n"
+ "This command has no additional options.\n"
);
}
@@ -562,6 +581,8 @@
if (command == ZypperCommand::MOO)
{
+ if (ghelp) { cout << specific_help << endl; return !ghelp; }
+
cout << " \\\\\\\\\\\n \\\\\\\\\\\\\\__o\n__\\\\\\\\\\\\\\'/_" << endl;
return ZYPPER_EXIT_OK;
}
@@ -701,7 +722,7 @@
{
if (command == ZypperCommand::INSTALL) {
if (ghelp || arguments.size() < 1) {
- cerr << "install [options] name...\n" << specific_help;
+ cerr << specific_help;
return !ghelp;
}
@@ -710,9 +731,7 @@
if (command == ZypperCommand::REMOVE) {
if (ghelp || arguments.size() < 1) {
- cerr << "remove [options] name...\n"
- << specific_help
- ;
+ cerr << specific_help;
return !ghelp;
}
@@ -887,13 +906,8 @@
// -----------------------------( update )----------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "update" || command_str == "up") {
- if (ghelp) {
- cerr << "update [options]\n"
- << specific_help
- ;
- return !ghelp;
- }
+ else if (command == ZypperCommand::UPDATE) {
+ if (ghelp) { cerr << specific_help; return !ghelp; }
string skind = copts.count("type")? copts["type"].front() :
gSettings.is_rug_compatible? "package" : "patch";
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
Author: jkupec
Date: Fri Jun 22 09:29:21 2007
New Revision: 5825
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5825&view=rev
Log:
- fixed consistency of <required> and [optional] arguments
- improved update command description
- changed sa, sr descriptions + some other minor changes
Modified:
trunk/zypper/doc/zypper.8
Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=5825&r1=…
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Fri Jun 22 09:29:21 2007
@@ -47,47 +47,47 @@
.TP
-.B info (if) [name] ...
+.B info (if) <name> ...
Displays full info for the specified packages.
.TP
-.B install (in) [name] ...
+.B install (in) <name> ...
Install resolvables.
.TP
-\fI\-c, \-\-catalog\fR
+\fI\-c, \-\-catalog\fR <catalog>
Only from this catalog (FIXME not implemented yet)
.TP
-\fI\-t, \-\-type\fR [resolvable]
+\fI\-t, \-\-type\fR <resolvable_type>
Type of resolvable (default: package)
.TP
.I \-y, \-\-no-confirm
Don't require user confirmation.
.TP
-.B list-updates (lu)
+.B list-updates (lu) [options]
List available updates.
.TP
-\fI\-t, --type\fR
+\fI\-t, --type\fR <resolvable_type>
Type of resolvable (default: patch)
See also the NOTE at
.BR update .
.TP
-.B remove (rm) [name]..
+.B remove (rm) <name> ...
Remove resolvables.
.TP
-\fI\-t, -\-type\fR [resolvable]
+\fI\-t, -\-type\fR <resolvable_type>
Type of resolvable (default: package)
.TP
.I \-y, \-\-no-confirm
Don't require user confirmation.
.TP
-.B update (up)
-Update resolvables.
+.B update (up) [options]
+Update all installed resolvables with newer versions, where applicable.
.TP
-\fI\-t, -\-type\fR [resolvable]
+\fI\-t, -\-type\fR <resolvable_type>
Type of resolvable (default: patch)
.TP
.I \-y, \-\-no-confirm
@@ -167,7 +167,7 @@
installed and not applicable ones.
.TP
-.B patch-info [name] ...
+.B patch-info <name> ...
Displays full info for the specified patches.
.LP
@@ -186,7 +186,7 @@
installation source is a repository is a service is a catalog.
.TP
-.B service-add (sa) <URI> [alias]
+.B service-add (sa) <URI> <alias>
Add a new service (installation source).
.TP
\fI\-r, -\-repo\fR <FILE.repo>
@@ -202,7 +202,7 @@
Do not automatically refresh the metadata.
.TP
-.B service-delete (sd) <URI|alias|number>
+.B service-delete (sd) <alias>
Delete a service (installation source).
.TP
@@ -214,7 +214,7 @@
rug compatibility mode: if \fI-r\fR global option is set, zypper doesn't include 'Enabled' and 'Refresh' columns and prints rug's 'Status' column with values "Active" or "Disabled" instead.
.TP
-.B service-rename (sr) <URI|alias|number> <new-alias>
+.B service-rename (sr) <alias> <new-alias>
Rename a service (installation source).
.TP
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5824 - in /branches/REFACTORING-10_3/libzypp/zypp: ./ cache/ repo/cached/
by mlandres@svn.opensuse.org 21 Jun '07
by mlandres@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: mlandres
Date: Thu Jun 21 17:26:12 2007
New Revision: 5824
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5824&view=rev
Log:
Backup (Introduce CacheAttributes and start fixing the cached resolvable implementations.)
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 17:26:12 2007
@@ -874,6 +874,7 @@
${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h
cache/CacheInitializer.cc
cache/CacheException.cc
+ cache/Attribute.cc
cache/CacheTypes.cc
cache/ResolvableQuery.cc
cache/CacheStore.cc
@@ -882,6 +883,8 @@
)
SET( zypp_cache_HEADERS
+ cache/Attribute.h
+ cache/CacheAttributes.h
cache/CacheTypes.h
cache/CacheInitializer.h
cache/CacheException.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc Thu Jun 21 17:26:12 2007
@@ -10,6 +10,7 @@
#include "zypp/cache/CacheInitializer.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/cache/CacheException.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp;
@@ -201,36 +202,36 @@
void CacheStore::appendResObjectAttributes( const data::RecordId &rid,
const data::ResObject_Ptr & res )
{
- appendTranslatedStringAttribute( rid, "ResObject", "description", res->description );
- appendTranslatedStringAttribute( rid, "ResObject", "summary", res->summary );
- appendNumericAttribute( rid, "ResObject", "installedSize", res->installedSize );
- appendNumericAttribute( rid, "ResObject", "buildTime", res->buildTime );
- appendBooleanAttribute( rid, "ResObject", "installOnly", res->installOnly );
- appendStringAttribute( rid, "ResObject", "vendor", res->vendor );
- appendTranslatedStringAttribute( rid, "ResObject", "licenseToConfirm", res->licenseToConfirm );
- appendTranslatedStringAttribute( rid, "ResObject", "insnotify", res->insnotify );
- appendTranslatedStringAttribute( rid, "ResObject", "delnotify", res->delnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
+ appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
+ appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
+ appendNumericAttribute( rid, attrResObjectBuildTime(), res->buildTime );
+ appendBooleanAttribute( rid, attrResObjectInstallOnly(), res->installOnly );
+ appendStringAttribute( rid, attrResObjectVendor(), res->vendor );
+ appendTranslatedStringAttribute( rid, attrResObjectLicenseToConfirm(), res->licenseToConfirm );
+ appendTranslatedStringAttribute( rid, attrResObjectInsnotify(), res->insnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDelnotify(), res->delnotify );
}
void CacheStore::appendPackageBaseAttributes( const RecordId & pkgid,
const data::Packagebase_Ptr & package )
{
- appendStringAttribute( pkgid, "Package", "checksum", package->repositoryLocation.fileChecksum.checksum() );
- appendStringAttribute( pkgid, "Package", "checksumType", package->repositoryLocation.fileChecksum.type() );
- appendStringAttribute( pkgid, "Package", "buildhost", package->buildhost );
- appendStringAttribute( pkgid, "Package", "distribution", package->distribution );
- appendStringAttribute( pkgid, "Package", "license", package->license );
- appendStringAttribute( pkgid, "Package", "group", package->packager );
- appendStringAttribute( pkgid, "Package", "url", package->url );
- appendStringAttribute( pkgid, "Package", "operatingSystem", package->operatingSystem );
- appendStringAttribute( pkgid, "Package", "prein", package->prein );
- appendStringAttribute( pkgid, "Package", "postin", package->postin );
- appendStringAttribute( pkgid, "Package", "preun", package->preun );
- appendStringAttribute( pkgid, "Package", "postun", package->postun );
- appendStringContainerAttribute( pkgid, "Package", "keywords", package->keywords.begin(), package->keywords.end() );
- appendStringContainerAttribute( pkgid, "Package", "authors", package->authors.begin(), package->authors.end() );
- appendStringAttribute( pkgid, "Package", "location", package->repositoryLocation.filePath.asString() );
+ appendStringAttribute( pkgid, attrPackageChecksum(), package->repositoryLocation.fileChecksum.checksum() );
+ appendStringAttribute( pkgid, attrPackageChecksumType(), package->repositoryLocation.fileChecksum.type() );
+ appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
+ appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution );
+ appendStringAttribute( pkgid, attrPackageLicense(), package->license );
+ appendStringAttribute( pkgid, attrPackageGroup(), package->packager );
+ appendStringAttribute( pkgid, attrPackageUrl(), package->url );
+ appendStringAttribute( pkgid, attrPackageOperatingSystem(), package->operatingSystem );
+ appendStringAttribute( pkgid, attrPackagePrein(), package->prein );
+ appendStringAttribute( pkgid, attrPackagePostin(), package->postin );
+ appendStringAttribute( pkgid, attrPackagePreun(), package->preun );
+ appendStringAttribute( pkgid, attrPackagePostun(), package->postun );
+ appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() );
+ appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() );
+ appendStringAttribute( pkgid, attrPackageLocation(), package->repositoryLocation.filePath.asString() );
}
RecordId CacheStore::consumePackage( const RecordId & repository_id,
@@ -264,10 +265,10 @@
appendResObjectAttributes( id, patch );
// patch attributes
- appendNumericAttribute( id, "Patch", "timestamp", patch->timestamp );
- appendStringAttribute( id, "Patch", "category", patch->category );
- appendBooleanAttribute( id, "Patch", "rebootNeeded", patch->rebootNeeded );
- appendBooleanAttribute( id, "Patch", "affectsPkgManager", patch->affectsPkgManager );
+ appendNumericAttribute( id, attrPatchTimestamp(), patch->timestamp );
+ appendStringAttribute( id, attrPatchCategory(), patch->category );
+ appendBooleanAttribute( id, attrPatchRebootNeeded(), patch->rebootNeeded );
+ appendBooleanAttribute( id, attrPatchAffectsPkgManager(), patch->affectsPkgManager );
DBG << "got patch " << patch->name << ", atoms: ";
@@ -333,7 +334,7 @@
NVRA( message->name, message->edition, message->arch ), message->deps );
appendResObjectAttributes( id, message );
- appendTranslatedStringAttribute( id, "Message", "text", message->text );
+ appendTranslatedStringAttribute( id, attrMessageText(), message->text );
return id;
}
@@ -344,14 +345,14 @@
NVRA( script->name, script->edition, script->arch ), script->deps );
appendResObjectAttributes( id, script );
- appendStringAttribute( id, "Script", "doScript", script->doScript );
- appendStringAttribute( id, "Script", "doScriptLocation", script->doScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "doScriptChecksum", script->doScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "doScriptChecksumType", script->doScriptLocation.fileChecksum.type() );
- appendStringAttribute( id, "Script", "undoScript", script->undoScript );
- appendStringAttribute( id, "Script", "undoScriptLocation", script->undoScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "undoScriptChecksum", script->undoScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "undoScriptChecksumType", script->undoScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptDoScript(), script->doScript );
+ appendStringAttribute( id, attrScriptDoScriptLocation(), script->doScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptDoScriptChecksum(), script->doScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptDoScriptChecksumType(), script->doScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptUndoScript(), script->undoScript );
+ appendStringAttribute( id, attrScriptUndoScriptLocation(), script->undoScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksum(), script->undoScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksumType(), script->undoScriptLocation.fileChecksum.type() );
return id;
}
@@ -362,11 +363,11 @@
NVRA( pattern->name, pattern->edition, pattern->arch ), pattern->deps );
appendResObjectAttributes( id, pattern );
- appendBooleanAttribute( id, "Pattern", "isDefault", pattern->isDefault );
- appendBooleanAttribute( id, "Pattern", "userVisible", pattern->userVisible );
- appendTranslatedStringAttribute( id, "Pattern", "category", pattern->category );
- appendStringAttribute( id, "Pattern", "icon", pattern->icon );
- appendStringAttribute( id, "Pattern", "order", pattern->order );
+ appendBooleanAttribute( id, attrPatternIsDefault(), pattern->isDefault );
+ appendBooleanAttribute( id, attrPatternUserVisible(), pattern->userVisible );
+ appendTranslatedStringAttribute( id, attrPatternCategory(), pattern->category );
+ appendStringAttribute( id, attrPatternIcon(), pattern->icon );
+ appendStringAttribute( id, attrPatternOrder(), pattern->order );
return id;
}
@@ -377,15 +378,15 @@
NVRA( product->name, product->edition, product->arch ), product->deps );
appendResObjectAttributes( id, product );
- appendTranslatedStringAttribute( id, "Product", "shortName", product->shortName );
- appendTranslatedStringAttribute( id, "Product", "longName", product->longName );
- appendStringContainerAttribute( id, "Product", "flags", product->flags.begin(), product->flags.end() );
- appendStringAttribute( id, "Product", "releasenotesUrl", product->releasenotesUrl.asString() );
- appendStringContainerAttribute( id, "Product", "updateUrls", product->updateUrls );
- appendStringContainerAttribute( id, "Product", "extraUrls", product->extraUrls );
- appendStringContainerAttribute( id, "Product", "optionalUrls", product->optionalUrls );
- appendStringAttribute( id, "Product", "distributionName", product->distributionName );
- appendStringAttribute( id, "Product", "distributionEdition", product->distributionEdition.asString() );
+ appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
+ appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
+ appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
+ appendStringAttribute( id, attrProductReleasenotesUrl(), product->releasenotesUrl.asString() );
+ appendStringContainerAttribute( id, attrProductUpdateUrls(), product->updateUrls );
+ appendStringContainerAttribute( id, attrProductExtraUrls(), product->extraUrls );
+ appendStringContainerAttribute( id, attrProductOptionalUrls(), product->optionalUrls );
+ appendStringAttribute( id, attrProductDistributionName(), product->distributionName );
+ appendStringAttribute( id, attrProductDistributionEdition(), product->distributionEdition.asString() );
return id;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h Thu Jun 21 17:26:12 2007
@@ -28,6 +28,7 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/RepoStatus.h"
#include "zypp/ProgressData.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -385,6 +386,9 @@
*/
data::RecordId lookupOrAppendType( const std::string &klass,
const std::string &name );
+ /** \overload */
+ data::RecordId lookupOrAppendType( const Attribute &attr )
+ { return lookupOrAppendType( attr.klass, attr.name ); }
/**
* Returns the record id of a repository (Source)
@@ -426,6 +430,11 @@
const std::string &klass,
const std::string &name,
int value );
+ /** \overload */
+ void appendNumericAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ int value )
+ { appendNumericAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a translated string value to a resolvable
@@ -438,6 +447,11 @@
const std::string &klass,
const std::string &name,
const TranslatedText &text );
+ /** \overload */
+ void appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const TranslatedText &text )
+ { appendTranslatedStringAttribute( resolvable_id, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -452,6 +466,12 @@
const std::string &klass,
const std::string &name,
const std::string &text );
+ /** \overload */
+ void appendStringAttributeTranslation( const data::RecordId &resolvable_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &text )
+ { appendStringAttributeTranslation( resolvable_id, locale, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -464,6 +484,11 @@
const std::string &klass,
const std::string &name,
const std::string &value );
+ /** \overload */
+ void appendStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const std::string &value )
+ { appendStringAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a string value to a resolvable
@@ -475,7 +500,6 @@
const data::RecordId &type_id,
const std::string &value );
-
/**
* Append strings from _Iterator to a resolvable.
*
@@ -501,6 +525,13 @@
std::string value = str::join(begin, end, ZConfig().cacheDBSplitJoinSeparator());
appendStringAttribute( resolvable_id, klass, name, value );
}
+ /** \overload */
+ template <class _Iterator>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ _Iterator begin,
+ _Iterator end )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, begin, end ); }
/**
* Append strings from a _Container to a resolvable.
@@ -516,6 +547,12 @@
const std::string &name,
const _Container & container )
{ appendStringContainerAttribute( resolvable_id, klass, name, container.begin(), container.end() ); }
+ /** \overload */
+ template <class _Container>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const _Container & container )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, container ); }
/**
* Update a known repository checksum and timestamp
@@ -676,6 +713,12 @@
const std::string & klass,
const std::string & name,
bool value);
+ /** \overload */
+ void appendBooleanAttribute( const data::RecordId & resolvable_id,
+ const Attribute& attr,
+ bool value)
+ { appendBooleanAttribute( resolvable_id, attr.klass, attr.name, value ); }
+
/** \name Detail Attributes Inserters
* These functions are used by ResolvableConsumer interface functions
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h Thu Jun 21 17:26:12 2007
@@ -8,6 +8,7 @@
#include "zypp/Pathname.h"
#include "zypp/data/ResolvableData.h"
#include "zypp/data/RecordId.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -15,7 +16,7 @@
///////////////////////////////////////////////////////////////////
namespace cache
{ /////////////////////////////////////////////////////////////////
-
+
/**
* The resolvable query class allows you to query for resolvable
* data and properties from the cache.
@@ -28,16 +29,16 @@
* first parameter is the resolvable id.
* second parameter is a \ref data::ResObjectData object with the resource
*/
- typedef function<bool( const data::RecordId &,
+ typedef function<bool( const data::RecordId &,
data::ResObject_Ptr )> ProcessResolvable;
-
+
/**
* Constructor
*
* \param dbdir Cache location path
*/
ResolvableQuery( const Pathname &dbdir );
-
+
/**
* Query by record id
* \param record_id Resolvable id to query
@@ -45,7 +46,7 @@
*/
void query( const data::RecordId &record_id,
ProcessResolvable fnc );
-
+
/**
* Query by matching text
* \param text text to match
@@ -53,7 +54,7 @@
*/
void query( const std::string &text,
ProcessResolvable fnc );
-
+
/**
* Queries a specifc attribute for a resolvable
*
@@ -68,6 +69,11 @@
const std::string &klass,
const std::string &name,
int default_value = -1 );
+ /** \overload */
+ int queryNumericAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ int default_value = -1 )
+ { return queryNumericAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -84,6 +90,11 @@
const std::string &klass,
const std::string &name,
bool default_value = false );
+ /** \overload */
+ bool queryBooleanAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ bool default_value = false )
+ { return queryBooleanAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -100,7 +111,12 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries a specifc attribute translation
* for a resolvable.
@@ -118,7 +134,13 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttributeTranslation( const data::RecordId &record_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttributeTranslation( record_id, locale, attr.klass, attr.name, default_value ); }
+
/**
* Queries all translations for a specific attribute
* in a resolvable.
@@ -127,14 +149,19 @@
* \param klass Attribute Class
* \param name Attribute Name
*
- * \return all attribute translations or a empty
+ * \return all attribute translations or a empty
* \ref TranslatedString if no record is found.
*/
TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
const std::string &klass,
const std::string &name,
- const TranslatedText &default_vaue = TranslatedText() );
-
+ const TranslatedText &default_value = TranslatedText() );
+ /** \overload */
+ TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const TranslatedText &default_value = TranslatedText() )
+ { return queryTranslatedStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries for a specific container attribute
* in a resolvable.
@@ -152,14 +179,20 @@
const std::string &name,
_OutputIterator result )
{
-
+
std::string all = queryStringAttribute( record_id, klass, name);
//FIXME use zypp separator
str::split( all, result );
}
-
-
-
+ /** \overload */
+ template<class _OutputIterator>
+ void queryStringContainerAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ _OutputIterator result )
+ { queryStringContainerAttribute( record_id, attr.klass, attr.name, result ); }
+
+
+
private:
/** Implementation. */
class Impl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,11 +12,11 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "AtomImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
-using namespace::zypp::repo;
+//using namespace::zypp::repo;
///////////////////////////////////////////////////////////////////
namespace zypp { namespace repo { namespace cached {
@@ -46,53 +46,52 @@
TranslatedText AtomImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText AtomImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText AtomImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText AtomImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText AtomImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor AtomImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
-
ByteCount AtomImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount AtomImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool AtomImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date AtomImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date AtomImpl::installtime() const
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "MessageImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText MessageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText MessageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText MessageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText MessageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText MessageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor MessageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount MessageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount MessageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool MessageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date MessageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date MessageImpl::installtime() const
@@ -111,14 +112,14 @@
TranslatedText MessageImpl::text() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Message", "text" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrMessageText() );
}
Patch::constPtr MessageImpl::patch() const
{
return 0;
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,7 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PackageImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -49,53 +49,55 @@
TranslatedText PackageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PackageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PackageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PackageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PackageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PackageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PackageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PackageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PackageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PackageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PackageImpl::installtime() const
@@ -115,33 +117,35 @@
std::string PackageImpl::buildhost() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "buildhost" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageBuildhost() );
}
std::string PackageImpl::distribution() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "distribution" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageDistribution() );
}
Label PackageImpl::license() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "license" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLicense() );
}
std::string PackageImpl::packager() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "packager" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePackager() );
}
PackageGroup PackageImpl::group() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "group" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageGroup() );
}
PackageImpl::Keywords PackageImpl::keywords() const
{
PackageImpl::Keywords keywords;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "keywords", std::inserter(keywords, keywords.begin()) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageKeywords(), std::inserter(keywords, keywords.begin()) );
return keywords;
}
@@ -152,37 +156,37 @@
Pathname PackageImpl::location() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "location" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocation() );
}
std::string PackageImpl::url() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "url" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageUrl() );
}
std::string PackageImpl::os() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "operatingSystem" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageOperatingSystem() );
}
Text PackageImpl::prein() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "prein" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePrein() );
}
Text PackageImpl::postin() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postin" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostin() );
}
Text PackageImpl::preun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "preun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePreun() );
}
Text PackageImpl::postun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostun() );
}
ByteCount PackageImpl::sourcesize() const
@@ -198,7 +202,7 @@
list<string> PackageImpl::authors() const
{
list<string> authors;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "authors", back_inserter(authors) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageAuthors(), back_inserter(authors) );
return authors;
}
@@ -211,7 +215,7 @@
// {
// return std::list<DeltaRpm>();
// }
-//
+//
// std::list<PatchRpm> PackageImpl::patchRpms() const
// {
// return std::list<PatchRpm>();
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatchImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatchImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatchImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatchImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatchImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatchImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatchImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatchImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatchImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatchImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatchImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatchImpl::installtime() const
@@ -114,36 +115,41 @@
std::string PatchImpl::id() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "id" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchId() );
}
Date PatchImpl::timestamp() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "Patch", "timestamp" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPatchTimestamp() );
}
std::string PatchImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "category" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchCategory() );
}
bool PatchImpl::reboot_needed() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "rebootNeeded" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchRebootNeeded() );
}
bool PatchImpl::affects_pkg_manager() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "affectsPkgManager" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchAffectsPkgManager() );
}
bool PatchImpl::interactive() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "interactive" );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchInteractive() );
}
PatchImpl::AtomList PatchImpl::all_atoms() const
{
+#warning DUBIOUS ATTRIBUTE
return PatchImpl::AtomList();
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatternImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatternImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatternImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatternImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatternImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatternImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatternImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatternImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatternImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatternImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatternImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatternImpl::installtime() const
@@ -114,43 +115,45 @@
bool PatternImpl::isDefault() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternIsDefault() );
}
bool PatternImpl::userVisible() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "userVisible" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternUserVisible() );
}
TranslatedText PatternImpl::category() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrPatternCategory() );
}
Pathname PatternImpl::icon() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "icon" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternIcon() );
}
Pathname PatternImpl::script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "script" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternScript() );
}
Label PatternImpl::order() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "order" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternOrder() );
}
//std::set<std::string> install_packages( const Locale & lang = Locale("") ) const;
// const CapSet & PatternImpl::includes() const
// {
-//
+//
// }
-//
+//
// const CapSet & PatternImpl::extends() const
// {
-//
+//
// }
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ProductImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ProductImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ProductImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ProductImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ProductImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ProductImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ProductImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ProductImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ProductImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ProductImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ProductImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ProductImpl::installtime() const
@@ -111,55 +112,59 @@
std::string ProductImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "category" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductCategory() );
}
Url ProductImpl::releaseNotesUrl() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "releaseNotesUrl" );
+#warning DUBIOUS ATTRIBUTE
+ return Url();
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleaseNotesUrl() );
}
std::list<Url> ProductImpl::updateUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "updateUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductUpdateUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::extraUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "extraUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductExtraUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::optionalUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "optionalUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductOptionalUrls(), back_inserter(urls) );
return urls;
}
list<string> ProductImpl::flags() const
{
list<string> flags;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "flags", back_inserter(flags) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductFlags(), back_inserter(flags) );
return flags;
}
TranslatedText ProductImpl::shortName() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Product", "shortName" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrProductShortName() );
}
std::string ProductImpl::distributionName() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionName" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionName() );
}
Edition ProductImpl::distributionEdition() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionEdition" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionEdition() );
}
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc Thu Jun 21 17:26:12 2007
@@ -31,6 +31,7 @@
#include "zypp/repo/cached/MessageImpl.h"
#include "zypp/repo/cached/ScriptImpl.h"
#include "zypp/repo/cached/AtomImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace zypp::detail;
using namespace zypp::cache;
@@ -76,7 +77,7 @@
debug::Measure m("create resolvables");
CapFactory capfactory;
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -84,7 +85,7 @@
sqlite3_command cmd( con, "select id,name,version,release,epoch,arch,kind from resolvables where repository_id=:repository_id;");
cmd.bind(":repository_id", _repository_id);
map<data::RecordId, pair<Resolvable::Kind, NVRAD> > nvras;
-
+
sqlite3_reader reader = cmd.executereader();
while(reader.read())
{
@@ -97,11 +98,11 @@
_type_cache.archFor(reader.getint(5)),
deps ) );
}
-
+
MIL << "Done reading resolvables nvra" << endl;
-
+
read_capabilities( con, nvras);
-
+
for ( map<data::RecordId, pair<Resolvable::Kind, NVRAD> >::const_iterator it = nvras.begin(); it != nvras.end(); ++it )
{
if ( it->second.first == ResTraits<Package>::kind )
@@ -147,7 +148,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
//extract_packages_from_directory( _store, thePath, selfRepositoryRef(), true );
-
+
}
static CheckSum encoded_string_to_checksum( const std::string &encoded )
@@ -166,7 +167,7 @@
void RepoImpl::createPatchAndDeltas()
{
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -179,14 +180,14 @@
string pp_bv_query =
"SELECT version, release, epoch "
"FROM patch_packages_baseversions WHERE patch_package_id = :patch_package_id";
-
+
string delta_query =
// 0 1 2 3 4 5 6 7 8 9 10
"SELECT id, media_nr, location, checksum, download_size, build_time, baseversion_version, baseversion_release, baseversion_epoch, baseversion_checksum, baseversion_build_time "
// 11
", baseversion_sequence_info "
"FROM delta_packages WHERE repository_id=:repository_id;";
-
+
// bind the master repo id to the query
sqlite3_command deltas_cmd( con, delta_query);
deltas_cmd.bind(":repository_id", _repository_id);
@@ -196,7 +197,7 @@
zypp::OnMediaLocation on_media;
on_media.medianr(reader.getint(1));
on_media.filename(reader.getstring(2));
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -206,10 +207,10 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
packagedelta::DeltaRpm::BaseVersion baseversion;
baseversion.edition( Edition(reader.getstring(6), reader.getstring(7), reader.getstring(8) ) );
-
+
checksum_string = reader.getstring(9);
checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -220,15 +221,15 @@
baseversion.checksum(checksum);
baseversion.buildtime(reader.getint(10));
baseversion.sequenceinfo(reader.getstring(11));
-
+
zypp::packagedelta::DeltaRpm delta;
delta.location( on_media );
delta.baseversion( baseversion );
delta.buildtime(reader.getint(5));
-
+
//impl->addDeltaRpm(delta);
}
-
+
// patch rpms
// bind the master package id to the query
// bind the master repo id to the query
@@ -240,11 +241,11 @@
while ( reader.read() )
{
long long patch_package_id = reader.getint64(0);
-
+
zypp::OnMediaLocation on_media;
on_media.medianr( reader.getint(1) );
on_media.filename( reader.getstring(2) );
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -254,20 +255,20 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
zypp::packagedelta::PatchRpm patch;
patch.location( on_media );
patch.buildtime(reader.getint(5));
-
+
pp_bv_cmd.bind( ":patch_package_id", patch_package_id );
-
+
sqlite3_reader bv_reader = pp_bv_cmd.executereader();
while (bv_reader.read())
{
packagedelta::PatchRpm::BaseVersion baseversion = packagedelta::PatchRpm::BaseVersion( bv_reader.getstring(0) , bv_reader.getstring(1), bv_reader.getint(2) );
patch.baseversion(baseversion);
}
-
+
//impl->addPatchRpm(patch);
}
}
@@ -275,7 +276,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
}
-
+
ResolvableQuery RepoImpl::resolvableQuery()
{
return _rquery;
@@ -284,12 +285,12 @@
void RepoImpl::read_capabilities( sqlite3_connection &con, map<data::RecordId, pair<Resolvable::Kind, NVRAD> > &nvras )
{
CapFactory capfactory;
-
-
+
+
// precompile statements
-
-
-
+
+
+
// map<data::RecordId, capability::CapabilityImpl::Ptr> named_caps;
// sqlite3_command select_named_cmd( con, "select v.id, c.refers_kind, n.name, v.version, v.release, v.epoch, v.relation named_capabilities v, capabilities c, names n where v.name_id=n.id and c.id=ncc.capability_id and ncc.named_capability_id=v.id;");
// {
@@ -297,38 +298,38 @@
// sqlite3_reader reader = select_named_cmd.executereader();
// while ( reader.read() )
// {
-//
+//
// }
// }
sqlite3_command select_named_cmd( con, "select v.refers_kind, n.name, v.version, v.release, v.epoch, v.relation, v.dependency_type, v.resolvable_id from named_capabilities v, names n where v.name_id=n.id;");
sqlite3_command select_file_cmd( con, "select fc.refers_kind, dn.name, fn.name, fc.dependency_type, fc.resolvable_id from file_capabilities fc, files f, dir_names dn, file_names fn where f.id=fc.file_id and f.dir_name_id=dn.id and f.file_name_id=fn.id;");
-
+
{
debug::Measure mnc("read named capabilities");
sqlite3_reader reader = select_named_cmd.executereader();
while ( reader.read() )
{
-
+
Resolvable::Kind refer = _type_cache.kindFor(reader.getint(0));
Rel rel = _type_cache.relationFor(reader.getint(5));
-
+
data::RecordId rid = reader.getint64(7);
-
+
if ( rel == zypp::Rel::NONE )
{
capability::NamedCap *ncap = new capability::NamedCap( refer, reader.getstring(1) );
- zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
+ zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
}
else
{
capability::VersionedCap *vcap = new capability::VersionedCap( refer, reader.getstring(1), /* rel */ rel, Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
}
}
}
-
+
{
debug::Measure mnf("read file capabilities");
sqlite3_reader reader = select_file_cmd.executereader();
@@ -338,10 +339,10 @@
capability::FileCap *fcap = new capability::FileCap( refer, reader.getstring(1) + "/" + reader.getstring(2) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(3));
data::RecordId rid = reader.getint64(4);
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
}
}
-
+
MIL << nvras.size() << " capabilities" << endl;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ScriptImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ScriptImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ScriptImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ScriptImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ScriptImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ScriptImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ScriptImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ScriptImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ScriptImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ScriptImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ScriptImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ScriptImpl::installtime() const
@@ -111,19 +112,21 @@
Pathname ScriptImpl::do_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "doScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptDoScript() );
}
Pathname ScriptImpl::undo_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "undoScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptUndoScript() );
}
bool ScriptImpl::undo_available() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Script", "undoAvailable", false );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrScriptUndoAvailable(), false );
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/TranslatedText.h"
#include "zypp/base/String.h"
#include "zypp/base/Logger.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -28,6 +29,7 @@
//
///////////////////////////////////////////////////////////////////
+#warning STILL A DUMMY IMPLEMENTATION
/** Default ctor
*/
SrcPackageImpl::SrcPackageImpl (Repository repo)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5823 - in /branches/REFACTORING-10_3/libzypp-bindings: ./ examples/ruby/ swig/
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 17:17:15 2007
New Revision: 5823
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5823&view=rev
Log:
some updates
Added:
branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i
branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i
branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i
branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i
branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i
Removed:
branches/REFACTORING-10_3/libzypp-bindings/swig/Source.i
branches/REFACTORING-10_3/libzypp-bindings/swig/SourceFactory.i
Modified:
branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt
branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i
branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i
branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i
branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i
branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i
Modified: branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/CMakeLists.txt Thu Jun 21 17:17:15 2007
@@ -32,7 +32,7 @@
INCLUDE(CPack)
#FIND_PACKAGE(SWIG REQUIRED)
-
+MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}")
FIND_PROGRAM(SWIG_EXECUTABLE
NAMES swig-1.3 swig
PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
Added: branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/examples/ruby/play_with_repos.rb Thu Jun 21 17:17:15 2007
@@ -0,0 +1,18 @@
+
+require 'rzypp'
+include Rzypp
+
+a = Arch.new("i386")
+puts a.to_s
+#exit
+
+z = ZYppFactory::instance.get_zypp
+
+manager = RepoManager.new
+
+manager.known_repositories.each do | repo |
+ repo.base_urls.each do | url |
+ puts url.to_s
+ end
+end
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Capability.i Thu Jun 21 17:17:15 2007
@@ -44,11 +44,7 @@
/** accessors needed by solver/zmd */
/** Deprecated */
std::string index() const;
- /** Deprecated, defaults to Rel::NONE */
- Rel op() const;
- /** Deprecated, defaults to Edition::noedition */
- Edition edition() const;
-
+
private:
typedef capability::CapabilityImpl Impl;
typedef capability::CapabilityImpl_Ptr Impl_Ptr ;
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoInfo.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,144 @@
+
+%template(UrlSet) std::set<Url>;
+
+class RepoInfo
+ {
+ friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
+
+ public:
+ RepoInfo();
+ ~RepoInfo();
+
+ /**
+ * unique identifier for this source. If not specified
+ * It should be generated from the base url.
+ *
+ * Normally, in a .repo file the section name is used
+ * ( [somerepo] )
+ */
+ std::string alias() const;
+
+ /**
+ * A Url under which the metadata are located, or a set of mirrors.
+ *
+ * This can't be empty in order the repository to be valid
+ * unless the download of the mirror list succeeds and it
+ * contains a valid url.
+ */
+ std::set<Url> baseUrls() const;
+
+ /**
+ * Url of a file which contains a list of Urls
+ * If empty, the base url will be used.
+ */
+ Url mirrorListUrl() const;
+
+ typedef std::set<Url>::const_iterator urls_const_iterator;
+
+ /**
+ * iterator that points at begin of repository urls
+ */
+ urls_const_iterator baseUrlsBegin() const;
+
+ /**
+ * iterator that points at end of repository urls
+ */
+ urls_const_iterator baseUrlsEnd() const;
+
+ /**
+ * If enabled is false, then this repository must be ignored as if does
+ * not exists, except when checking for duplicate alias.
+ */
+ boost::tribool enabled() const;
+
+ /**
+ * If true, the repostory must be refreshed before creating resolvables
+ * from it
+ */
+ boost::tribool autorefresh() const;
+
+ /**
+ * Type of repository,
+ *
+ */
+ repo::RepoType type() const;
+
+ /**
+ * \short Repository short label
+ *
+ * Short label or description of the repository, to be used on
+ * the user interface.
+ * ie: "SUSE Linux 10.2 updates"
+ */
+ std::string name() const;
+
+ /**
+ * \short File where this repo was read from
+ *
+ * \note could be an empty pathname for repo
+ * infos created in memory.
+ */
+ Pathname filepath() const;
+
+ /**
+ * Add a base url. \see baseUrls
+ * \param url The base url for the repository.
+ *
+ * To edit or remove urls, create a new RepoInfo instead.
+ */
+ RepoInfo & addBaseUrl( const Url &url );
+
+ /**
+ * Set mirror list url. \see mirrorListUrl
+ * \param url The base url for the list
+ */
+ RepoInfo & setMirrorListUrl( const Url &url );
+
+ /**
+ * enable or disable the repository \see enabled
+ * \param enabled
+ */
+ RepoInfo & setEnabled( boost::tribool enabled );
+
+ /**
+ * enable or disable autorefresh \see autorefresh
+ * \param enabled
+ */
+ RepoInfo & setAutorefresh( boost::tribool autorefresh );
+
+ /**
+ * set the repository alias \see alias
+ * \param alias
+ */
+ RepoInfo & setAlias( const std::string &alias );
+
+ /**
+ * set the repository type \see type
+ * \param t
+ */
+ RepoInfo & setType( const repo::RepoType &t );
+
+ /**
+ * set the repository name \see name
+ * \param name
+ */
+ RepoInfo & setName( const std::string &name );
+
+ /**
+ * \short set the repository filepath
+ * \param path File path
+ */
+ RepoInfo & setFilepath( const Pathname &filename );
+
+ std::ostream & dumpOn( std::ostream & str ) const;
+
+ std::ostream & dumpRepoOn( std::ostream & str ) const;
+
+ class Impl;
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
+ typedef std::list<RepoInfo> RepoInfoList;
+ %template(RepoInfoList) std::list<RepoInfo>;
+
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoManager.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,57 @@
+
+ std::list<RepoInfo> readRepoFile(const Url & repo_file);
+
+ struct RepoManagerOptions
+ {
+ RepoManagerOptions();
+
+ Pathname repoCachePath;
+ Pathname repoRawCachePath;
+ Pathname knownReposPath;
+ };
+
+ class RepoManager
+ {
+ public:
+ RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
+ ~RepoManager();
+
+ enum RawMetadataRefreshPolicy
+ {
+ RefreshIfNeeded,
+ RefreshForced
+ };
+
+ enum CacheBuildPolicy
+ {
+ BuildIfNeeded,
+ BuildForced
+ };
+
+ enum RepoRemovePolicy
+ {
+
+ };
+
+ std::list<RepoInfo> knownRepositories() const;
+ void refreshMetadata( const RepoInfo &info,
+ RawMetadataRefreshPolicy policy = RefreshIfNeeded,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void cleanMetadata( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void buildCache( const RepoInfo &info,
+ CacheBuildPolicy policy = BuildIfNeeded,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void cleanCache( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ bool isCached( const RepoInfo &info ) const;
+ Repository createFromCache( const RepoInfo &info,const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ repo::RepoType probe( const Url &url );
+ void addRepository( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void addRepositories( const Url &url,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void removeRepository( const RepoInfo & info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+
+ };
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoStatus.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,57 @@
+class RepoStatus
+ {
+ friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
+
+ public:
+
+ /**
+ * Checksum of the repository.
+ * Usually the checksum of the index, but any
+ * checksum that changes when the repository changes
+ * in any way is sufficient.
+ */
+ std::string checksum() const;
+
+ /**
+ * timestamp of the repository. If the repository
+ * changes, it has to be updated as well with the
+ * new timestamp.
+ */
+ Date timestamp() const;
+
+ /**
+ * set the repository checksum \see checksum
+ * \param checksum
+ */
+ RepoStatus & setChecksum( const std::string &checksum );
+
+ /**
+ * set the repository timestamp \see timestamp
+ * \param timestamp
+ */
+ RepoStatus & setTimestamp( const Date ×tamp );
+
+ /** Implementation */
+ class Impl;
+
+ public:
+ /** Default ctor */
+ RepoStatus();
+
+ /**
+ * \short Status from a single file
+ * As most repository state is represented
+ * by the status of the index file, you can
+ * construct the status from a file.
+ */
+ RepoStatus( const Pathname &file );
+
+ /** Dtor */
+ ~RepoStatus();
+
+ public:
+
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
\ No newline at end of file
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/RepoType.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,26 @@
+
+struct RepoType
+ {
+ static const RepoType RPMMD;
+ static const RepoType YAST2;
+ //static const RepoType NONE;
+
+ enum Type
+ {
+ NONE_e,
+ RPMMD_e,
+ YAST2_e
+ };
+
+ RepoType(Type type) : _type(type) {}
+
+ explicit RepoType(const std::string & strval_r);
+
+ const Type toEnum() const { return _type; }
+
+ RepoType::Type parse(const std::string & strval_r);
+
+ const std::string & asString() const;
+
+ Type _type;
+ };
\ No newline at end of file
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Repository.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,15 @@
+
+ class Repository : private base::SafeBool<Repository>
+ {
+ public:
+ Repository();
+ static const Repository noRepository;
+ public:
+ typedef unsigned long NumericId;
+ NumericId numericId() const;
+ const zypp::ResStore & resolvables();
+ const RepoInfo info() const;
+ const std::list<packagedelta::PatchRpm> & patchRpms() const;
+ const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
+ };
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/ResObject.i Thu Jun 21 17:17:15 2007
@@ -19,8 +19,8 @@
Vendor vendor() const;
ByteCount size() const;
ByteCount archivesize() const;
- Source_Ref source() const;
- unsigned sourceMediaNr() const;
+ Repository repository() const;
+ unsigned mediaNr() const;
bool installOnly() const;
Date buildtime() const;
Date installtime() const;
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/Url.i Thu Jun 21 17:17:15 2007
@@ -10,3 +10,8 @@
%typemap(freearg) const Url & {
delete $1;
}
+
+%typemap(out) Url {
+ VALUE rburlstr = rb_str_new2($1.asString().c_str());
+ $result = rburlstr ;
+}
\ No newline at end of file
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/ruby.i Thu Jun 21 17:17:15 2007
@@ -1,5 +1,12 @@
-%rename("asString") foo(to_s);
+%rename("asString") to_s;
+
+#define auto_string( cl ) \
+%extend cl { \
+ std::string to_s() { \
+ return self->asString();\
+ } \
+}
#define iter( cl, storetype ) \
%mixin cl "Enumerable"; \
@@ -25,6 +32,19 @@
} \
}
+#define auto_iterator( cl, storetype ) \
+%mixin cl "Enumerable"; \
+%extend cl { \
+ void each() { \
+ cl::iterator i = self->begin(); \
+ while ( i != self->end() ) { \
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(storetype), 0)); \
+ ++i; \
+ } \
+ } \
+}
+
+
%extend Target {
void each_by_kind( const ResObject::Kind & kind_r )
{
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/std_list.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,533 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * std_list.i
+ *
+ * SWIG typemaps for std::list
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// ------------------------------------------------------------------------
+// std::list
+//
+// The aim of all that follows would be to integrate std::list with
+// Ruby as much as possible, namely, to allow the user to pass and
+// be returned Ruby arrays
+// const declarations are used to guess the intent of the function being
+// exported; therefore, the following rationale is applied:
+//
+// -- f(std::list<T>), f(const std::list<T>&), f(const std::list<T>*):
+// the parameter being read-only, either a Ruby array or a
+// previously wrapped std::list<T> can be passed.
+// -- f(std::list<T>&), f(std::list<T>*):
+// the parameter must be modified; therefore, only a wrapped std::list
+// can be passed.
+// -- std::list<T> f():
+// the list is returned by copy; therefore, a Ruby array of T:s
+// is returned which is most easily used in other Ruby functions
+// -- std::list<T>& f(), std::list<T>* f(), const std::list<T>& f(),
+// const std::list<T>* f():
+// the list is returned by reference; therefore, a wrapped std::list
+// is returned
+// ------------------------------------------------------------------------
+
+%{
+#include <list>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+// exported class
+
+namespace std {
+
+ %mixin list "Enumerable";
+
+ template<class T> class list {
+ %typemap(in) list<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ $1.push_back(*x);
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T>& (std::list<T> temp),
+ const list<T>* (std::list<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp.push_back(*x);
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+
+ void each() {
+ for ( std::list<T>::const_iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+
+
+ %typemap(out) list<T> {
+ $result = rb_ary_new2($1.size());
+ unsigned int i = 0;
+ for ( std::list<T>::iterator it = $1.begin();
+ it != $1.end();
+ ++it )
+ {
+ T* x = new T((*it));
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 1));
+ ++i;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T>&,
+ const list<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, const T& value);
+ list(const list<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(const T& x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T& __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, const T& x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+ // Partial specialization for lists of pointers. [ beazley ]
+
+ %mixin list<T*> "Enumerable";
+ template<class T> class list<T*> {
+ %typemap(in) list<T*> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::list<T* >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ (($1_type &)$1)[i] = x;
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T*>& (std::list<T*> temp),
+ const list<T*>* (std::list<T*> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::list<T* >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp[i] = x;
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) list<T*> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++) {
+ T* x = (($1_type &)$1)[i];
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T*> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T*>&,
+ const list<T*>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, T * &value);
+ list(const list<T*> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(T* x);
+ %extend {
+ /*
+ T* pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T* x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T* __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, T* x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+
+ // specializations for built-ins
+
+ %define specialize_std_list(T,CHECK,CONVERT_FROM,CONVERT_TO)
+ %mixin list<T> "Enumerable";
+ template<> class list<T> {
+ %typemap(in) list<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::list<T >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ (($1_type &)$1)[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected list<" #T ">)");
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const list<T>& (std::list<T> temp),
+ const list<T>* (std::list<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::list<T >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ temp[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected list<" #T ">)");
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) list<T> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++)
+ rb_ary_store($result,i,CONVERT_TO((($1_type &)$1)[i]));
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) list<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const list<T>&,
+ const list<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped list? */
+ std::list<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ list();
+ list(unsigned int size);
+ list(unsigned int size, const T& value);
+ list(const list<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) push_back;
+ void push_back(T x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty list");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ void __setitem__(int i, T x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("list index out of range");
+ }
+ */
+ void each() {
+ for ( std::list<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+ %enddef
+
+ specialize_std_list(bool,SWIG_BOOL_P,SWIG_RB2BOOL,SWIG_BOOL2RB);
+ specialize_std_list(char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(unsigned long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_list(double,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_list(float,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_list(std::string,SWIG_STRING_P,SWIG_RB2STR,SWIG_STR2RB);
+
+}
+
Added: branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i (added)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/std_set.i Thu Jun 21 17:17:15 2007
@@ -0,0 +1,527 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * std_set.i
+ *
+ * SWIG typemaps for std::set
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// ------------------------------------------------------------------------
+// std::set
+//
+// The aim of all that follows would be to integrate std::set with
+// Ruby as much as possible, namely, to allow the user to pass and
+// be returned Ruby arrays
+// const declarations are used to guess the intent of the function being
+// exported; therefore, the following rationale is applied:
+//
+// -- f(std::set<T>), f(const std::set<T>&), f(const std::set<T>*):
+// the parameter being read-only, either a Ruby array or a
+// previously wrapped std::set<T> can be passed.
+// -- f(std::set<T>&), f(std::set<T>*):
+// the parameter must be modified; therefore, only a wrapped std::set
+// can be passed.
+// -- std::set<T> f():
+// the set is returned by copy; therefore, a Ruby array of T:s
+// is returned which is most easily used in other Ruby functions
+// -- std::set<T>& f(), std::set<T>* f(), const std::set<T>& f(),
+// const std::set<T>* f():
+// the set is returned by reference; therefore, a wrapped std::set
+// is returned
+// ------------------------------------------------------------------------
+
+%{
+#include <set>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+// exported class
+
+namespace std {
+
+ %mixin set "Enumerable";
+
+ template<class T> class set {
+ %typemap(in) set<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ $1.insert(*x);
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T>& (std::set<T> temp),
+ const set<T>* (std::set<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp.insert(*x);
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T *) &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+
+
+ %typemap(out) set<T> {
+ $result = rb_ary_new2($1.size());
+ unsigned int i = 0;
+ for ( std::set<T>::iterator it = $1.begin();
+ it != $1.end();
+ ++it )
+ {
+ T* x = new T((*it));
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 1));
+ ++i;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T>&,
+ const set<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(const T& x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T& __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, const T& x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T *)&(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+ // Partial specialization for sets of pointers. [ beazley ]
+
+ %mixin set<T*> "Enumerable";
+ template<class T> class set<T*> {
+ %typemap(in) set<T*> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::set<T* >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ (($1_type &)$1)[i] = x;
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T*>& (std::set<T*> temp),
+ const set<T*>* (std::set<T*> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::set<T* >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ T* x;
+ SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1);
+ temp[i] = x;
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) set<T*> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++) {
+ T* x = (($1_type &)$1)[i];
+ rb_ary_store($result,i,
+ SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T*> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T*>&,
+ const set<T*>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ T* x;
+ VALUE o = RARRAY($input)->ptr[0];
+ if ((SWIG_ConvertPtr(o,(void **) &x,
+ $descriptor(T *),0)) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T* >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T*> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(T* x);
+ %extend {
+ /*
+ T* pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T* x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T* __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, T* x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = (T*) &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+
+
+ // specializations for built-ins
+
+ %define specialize_std_set(T,CHECK,CONVERT_FROM,CONVERT_TO)
+ %mixin set<T> "Enumerable";
+ template<> class set<T> {
+ %typemap(in) set<T> {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ $1 = std::set<T >(size);
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ (($1_type &)$1)[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected set<" #T ">)");
+ }
+ } else {
+ void *ptr;
+ SWIG_ConvertPtr($input, &ptr, $&1_descriptor, 1);
+ $1 = *(($&1_type) ptr);
+ }
+ }
+ %typemap(in) const set<T>& (std::set<T> temp),
+ const set<T>* (std::set<T> temp) {
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ temp = std::set<T >(size);
+ $1 = &temp;
+ for (unsigned int i=0; i<size; i++) {
+ VALUE o = RARRAY($input)->ptr[i];
+ if (CHECK(o))
+ temp[i] = (T)(CONVERT_FROM(o));
+ else
+ rb_raise(rb_eTypeError,
+ "wrong argument type"
+ " (expected set<" #T ">)");
+ }
+ } else {
+ SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);
+ }
+ }
+ %typemap(out) set<T> {
+ $result = rb_ary_new2($1.size());
+ for (unsigned int i=0; i<$1.size(); i++)
+ rb_ary_store($result,i,CONVERT_TO((($1_type &)$1)[i]));
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) set<T> {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $&1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ %typecheck(SWIG_TYPECHECK_VECTOR) const set<T>&,
+ const set<T>* {
+ /* native sequence? */
+ if (rb_obj_is_kind_of($input,rb_cArray)) {
+ unsigned int size = RARRAY($input)->len;
+ if (size == 0) {
+ /* an empty sequence can be of any type */
+ $1 = 1;
+ } else {
+ /* check the first element only */
+ VALUE o = RARRAY($input)->ptr[0];
+ if (CHECK(o))
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ } else {
+ /* wrapped set? */
+ std::set<T >* v;
+ if (SWIG_ConvertPtr($input,(void **) &v,
+ $1_descriptor,0) != -1)
+ $1 = 1;
+ else
+ $1 = 0;
+ }
+ }
+ public:
+ set();
+ set(const set<T> &);
+
+ %rename(__len__) size;
+ unsigned int size() const;
+ %rename("empty?") empty;
+ bool empty() const;
+ void clear();
+ %rename(push) insert;
+ void insert(T x);
+ %extend {
+ /*
+ T pop() throw (std::out_of_range) {
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty set");
+ T x = self->back();
+ self->pop_back();
+ return x;
+ }
+ T __getitem__(int i) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i += size;
+ if (i>=0 && i<size)
+ return (*self)[i];
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ void __setitem__(int i, T x) throw (std::out_of_range) {
+ int size = int(self->size());
+ if (i<0) i+= size;
+ if (i>=0 && i<size)
+ (*self)[i] = x;
+ else
+ throw std::out_of_range("set index out of range");
+ }
+ */
+ void each() {
+ for ( std::set<T>::iterator it = self->begin();
+ it != self->end();
+ ++it )
+ {
+ T* x = &(*it);
+ rb_yield(SWIG_NewPointerObj((void *) x,
+ $descriptor(T *), 0));
+ }
+ }
+ }
+ };
+ %enddef
+
+ specialize_std_set(bool,SWIG_BOOL_P,SWIG_RB2BOOL,SWIG_BOOL2RB);
+ specialize_std_set(char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned char,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned int,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned short,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(unsigned long,FIXNUM_P,FIX2INT,INT2NUM);
+ specialize_std_set(double,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_set(float,SWIG_FLOAT_P,SWIG_NUM2DBL,rb_float_new);
+ specialize_std_set(std::string,SWIG_STRING_P,SWIG_RB2STR,SWIG_STR2RB);
+
+}
+
Modified: branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp-bind…
==============================================================================
--- branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i (original)
+++ branches/REFACTORING-10_3/libzypp-bindings/swig/zypp.i Thu Jun 21 17:17:15 2007
@@ -1,5 +1,4 @@
%module rzypp
-%include std_string.i
%{
/* Includes the header in the wrapper code */
@@ -12,8 +11,6 @@
#include <zypp/ZYpp.h>
#include <zypp/Pathname.h>
#include "zypp/base/ReferenceCounted.h"
- #include "zypp/SourceFactory.h"
- #include "zypp/Source.h"
#include "zypp/ResObject.h"
#include "zypp/Target.h"
#include "zypp/target/TargetImpl.h"
@@ -21,19 +18,20 @@
#include "zypp/CapFactory.h"
#include "zypp/Package.h"
#include "zypp/ResFilters.h"
-#include "zypp/source/OnMediaLocation.h"
+#include "zypp/OnMediaLocation.h"
+ #include "zypp/Repository.h"
+ #include "zypp/RepoManager.h"
+ #include "zypp/repo/RepoType.h"
#include "zypp/MediaSetAccess.h"
using namespace boost;
using namespace zypp;
+ using namespace zypp::repo;
using namespace zypp::resfilter;
+ typedef std::set<Url> UrlSet;
%}
-#ifdef SWIGRUBY
-%include "ruby.i"
-#endif
-
%rename("+") "operator+";
%rename("<<") "operator<<";
%rename("!=") "operator!=";
@@ -57,6 +55,13 @@
};
%include "Pathname.i"
+%include "Url.i"
+
+%include std_string.i
+%include "stl.i"
+%include "std_list.i"
+%include "std_set.i"
+
%include "Arch.i"
%include "ResStore.i"
%include "Edition.i"
@@ -64,8 +69,11 @@
%include "Date.i"
%include "Resolvable.i"
%include "ByteCount.i"
-%include "Source.i"
-%include "SourceFactory.i"
+%include "RepoType.i"
+%include "Repository.i"
+%include "RepoInfo.i"
+%include "RepoManager.i"
+%include "RepoStatus.i"
%include "ResObject.i"
%include "TranslatedText.i"
%include "CheckSum.i"
@@ -85,11 +93,18 @@
%include "ResPool.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
-%include "Url.i"
%include "MediaSetAccess.i"
+
+#ifdef SWIGRUBY
+%include "ruby.i"
+#endif
+
+
/* define iterators using swig macros */
iter2( ResStore, ResObject::Ptr )
+auto_iterator( std::list<RepoInfo>, RepoInfo )
+%alias Arch::asString "to_s";
class ZYpp
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5822 - in /trunk/zypper/src: zypp-checkpatches.cc zypper-info.cc zypper-media-callbacks.h zypper-misc.cc zypper-search.h zypper-source-callbacks.h zypper-tabulator.cc zypper-updates.cc zypper.cc
by jkupec@svn.opensuse.org 21 Jun '07
by jkupec@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: jkupec
Date: Thu Jun 21 17:10:10 2007
New Revision: 5822
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5822&view=rev
Log:
adapted to libzypp after removing the old API (libzypp r5820, branch
REFACTORING-10_3)
Modified:
trunk/zypper/src/zypp-checkpatches.cc
trunk/zypper/src/zypper-info.cc
trunk/zypper/src/zypper-media-callbacks.h
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper-source-callbacks.h
trunk/zypper/src/zypper-tabulator.cc
trunk/zypper/src/zypper-updates.cc
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypp-checkpatches.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypp-checkpatches.cc?…
==============================================================================
--- trunk/zypper/src/zypp-checkpatches.cc (original)
+++ trunk/zypper/src/zypp-checkpatches.cc Thu Jun 21 17:10:10 2007
@@ -9,6 +9,7 @@
/* (c) Novell Inc. */
+#include <fcntl.h>
#include <iostream>
#include <fstream>
@@ -17,6 +18,7 @@
#include <zypp/base/Gettext.h>
#include <zypp/target/store/PersistentStorage.h>
#include <zypp/RepoManager.h>
+#include <zypp/PathInfo.h>
#include "checkpatches-keyring-callbacks.h"
#include "zypper.h"
Modified: trunk/zypper/src/zypper-info.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-info.cc?rev=58…
==============================================================================
--- trunk/zypper/src/zypper-info.cc (original)
+++ trunk/zypper/src/zypper-info.cc Thu Jun 21 17:10:10 2007
@@ -81,7 +81,7 @@
*/
void printPkgInfo(const PoolItem & pool_item, const PoolItem & ins_pool_item) {
- cout << _("Catalog: ") << pool_item.resolvable()->source().alias() << endl;
+ cout << _("Catalog: ") << pool_item.resolvable()->repository().info().alias() << endl;
cout << _("Name: ") << pool_item.resolvable()->name() << endl;
cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
Modified: trunk/zypper/src/zypper-media-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-media-callback…
==============================================================================
--- trunk/zypper/src/zypper-media-callbacks.h (original)
+++ trunk/zypper/src/zypper-media-callbacks.h Thu Jun 21 17:10:10 2007
@@ -21,7 +21,6 @@
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "AliveCursor.h"
@@ -33,7 +32,7 @@
{
struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport<MediaChangeReport>
- {
+ {/*
virtual MediaChangeReport::Action requestMedia( zypp::Source_Ref source, unsigned mediumNr, MediaChangeReport::Error error, const std::string & description )
{
cout << "Please insert media [" << description << "] # " << mediumNr << ". Retry [y/n]: " << endl;
@@ -43,6 +42,7 @@
return MediaChangeReport::ABORT;
}
+ */
};
// progress for downloading a file
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=58…
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Thu Jun 21 17:10:10 2007
@@ -435,7 +435,7 @@
cout_vv << format(_("(%d resolvables found)")) % store.size() << endl;
}
- catch ( const repo::RepoNotCachedException &e )
+ catch (const Exception & e)
{
ZYPP_CAUGHT(e);
cerr << format(_("Problem loading data from '%s'")) % repo.alias();
@@ -553,7 +553,7 @@
Patch::constPtr patch = asKind<Patch>(res);
TableRow tr;
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -589,7 +589,7 @@
if (true) {
TableRow tr (cols);
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -726,7 +726,7 @@
// candstat.setToBeInstalled (ResStatus::USER);
ResObject::constPtr res = ci->resolvable();
TableRow tr (cols);
- tr << "v" << res->source ().alias ();
+ tr << "v" << res->repository().info().alias();
if (gSettings.is_rug_compatible)
tr << ""; // Bundle
tr << res->name ()
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=5…
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Thu Jun 21 17:10:10 2007
@@ -262,7 +262,7 @@
}
// add other fields to the result table
- row << pool_item.resolvable()->source().alias()
+ row << pool_item.resolvable()->repository().info().alias()
// TODO what about rug's Bundle?
<< (gSettings.is_rug_compatible ? "" : pool_item.resolvable()->kind().asString())
<< pool_item.resolvable()->name()
Modified: trunk/zypper/src/zypper-source-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-source-callbac…
==============================================================================
--- trunk/zypper/src/zypper-source-callbacks.h (original)
+++ trunk/zypper/src/zypper-source-callbacks.h Thu Jun 21 17:10:10 2007
@@ -20,7 +20,6 @@
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "zypper-callbacks.h"
@@ -28,8 +27,7 @@
namespace ZmartRecipients
{
///////////////////////////////////////////////////////////////////
-#ifndef LIBZYPP_1xx
- // progress for probing a source
+/* // progress for probing a source
struct ProbeSourceReceive : public zypp::callback::ReceiveReport<zypp::source::ProbeSourceReport>
{
virtual void start(const zypp::Url &url)
@@ -37,7 +35,7 @@
cout << "Determining " << url << " source type..." << endl;
}
- virtual void failedProbe( const zypp::Url &/*url*/, const std::string & type )
+ virtual void failedProbe( const zypp::Url &/*url*//*, const std::string & type )
{
cout << ".. not " << type << endl;
}
@@ -47,7 +45,7 @@
cout << url << " is type " << type << endl;
}
- virtual void finish(const zypp::Url &/*url*/, Error error, const std::string & reason )
+ virtual void finish(const zypp::Url &/*url*//*, Error error, const std::string & reason )
{
if ( error == INVALID )
{
@@ -56,10 +54,10 @@
}
}
- virtual bool progress(const zypp::Url &/*url*/, int /*value*/)
+ virtual bool progress(const zypp::Url &/*url*//*, int /*value*//*)
{ return true; }
- virtual Action problem( const zypp::Url &/*url*/, Error error, const std::string & description )
+ virtual Action problem( const zypp::Url &/*url*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
@@ -67,8 +65,7 @@
return ABORT;
}
};
-#endif
-
+ */
// progress for downloading a resolvable
struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<zypp::source::DownloadResolvableReport>
{
@@ -203,7 +200,7 @@
}
};
-#ifndef LIBZYPP_1xx
+/*
struct SourceReportReceiver : public zypp::callback::ReceiveReport<zypp::source::SourceReport>
{
virtual void start( zypp::Source_Ref source, const std::string & task )
@@ -225,14 +222,14 @@
return true;
}
- virtual Action problem( zypp::Source_Ref /*source*/, Error error, const std::string & description )
+ virtual Action problem( zypp::Source_Ref /*source*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
return (Action) read_action_ari ();
}
- virtual void finish( zypp::Source_Ref /*source*/, const std::string & task, Error error, const std::string & reason )
+ virtual void finish( zypp::Source_Ref /*source*//*, const std::string & task, Error error, const std::string & reason )
{
display_step(100);
// many of these, avoid newline
@@ -246,8 +243,7 @@
std::string _task;
zypp::Source_Ref _source;
};
-#endif
-
+*/
///////////////////////////////////////////////////////////////////
}; // namespace ZmartRecipients
///////////////////////////////////////////////////////////////////
@@ -255,27 +251,21 @@
class SourceCallbacks {
private:
-#ifndef LIBZYPP_1xx
- ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
- ZmartRecipients::SourceReportReceiver _SourceReport;
-#endif
+// ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
+// ZmartRecipients::SourceReportReceiver _SourceReport;
ZmartRecipients::DownloadResolvableReportReceiver _downloadReport;
public:
SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.connect();
- _SourceReport.connect();
-#endif
+// _sourceProbeReport.connect();
+// _SourceReport.connect();
_downloadReport.connect();
}
~SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.disconnect();
- _SourceReport.disconnect();
-#endif
+// _sourceProbeReport.disconnect();
+// _SourceReport.disconnect();
_downloadReport.disconnect();
}
Modified: trunk/zypper/src/zypper-tabulator.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-tabulator.cc?r…
==============================================================================
--- trunk/zypper/src/zypper-tabulator.cc (original)
+++ trunk/zypper/src/zypper-tabulator.cc Thu Jun 21 17:10:10 2007
@@ -5,7 +5,7 @@
TableStyle Table::defaultStyle = Ascii;
static
-char * lines[][3] = {
+const char * lines[][3] = {
{ "|", "-", "+"}, ///< Ascii
// utf 8. TODO wchars?
{ "\xE2\x94\x82", "\xE2\x94\x80", "\xE2\x94\xBC"}, ///< light
@@ -38,7 +38,7 @@
void TableRow::dumpTo (ostream &stream, const vector<unsigned>& widths,
TableStyle st) const {
- char * vline = lines[st][0];
+ const char * vline = lines[st][0];
bool seen_first = false;
container::const_iterator
@@ -90,8 +90,8 @@
}
void Table::dumpRule (ostream &stream) const {
- char * hline = lines[_style][1];
- char * cross = lines[_style][2];
+ const char * hline = lines[_style][1];
+ const char * cross = lines[_style][2];
bool seen_first = false;
Modified: trunk/zypper/src/zypper-updates.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-updates.cc?rev…
==============================================================================
--- trunk/zypper/src/zypper-updates.cc (original)
+++ trunk/zypper/src/zypper-updates.cc Thu Jun 21 17:10:10 2007
@@ -102,8 +102,8 @@
out << " <update category=\"" << patch ->category() << "\" name=\"" << patch->name() << "\" edition=\"" << patch->edition() << "\"" << ">" << std::endl;
out << " <summary>" << xml_escape(patch->summary()) << "</summary>" << endl;
out << " <description>" << xml_escape(patch->description()) << "</description>" << endl;
- if ( patch->source() != Source_Ref::noSource )
- out << "<source url=\"" << patch->source().url() << "\" alias=\"" << patch->source().alias() << "\"/>" << std::endl;
+ if ( patch->repository() != Repository::noRepository )
+ out << "<source url=\"" << *(patch->repository().info().baseUrlsBegin()) << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << std::endl;
out << "</update>" << endl;
count++;
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5822&r1…
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Thu Jun 21 17:10:10 2007
@@ -435,7 +435,7 @@
"This command has no options.\n"
);
}
- else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") {
+ else if (command == ZypperCommand::SHOW_PATCHES) {
static struct option patches_options[] = {
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
@@ -844,7 +844,7 @@
// --------------------------( patches )------------------------------------
- else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") {
+ else if (command == ZypperCommand::SHOW_PATCHES) {
if (ghelp) {
cerr << specific_help;
return !ghelp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5821 - in /trunk/zypper/src: zypper-command.cc zypper-command.h
by jkupec@svn.opensuse.org 21 Jun '07
by jkupec@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: jkupec
Date: Thu Jun 21 17:07:22 2007
New Revision: 5821
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5821&view=rev
Log:
SHOW_PATCHES added
Modified:
trunk/zypper/src/zypper-command.cc
trunk/zypper/src/zypper-command.h
Modified: trunk/zypper/src/zypper-command.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.cc?rev…
==============================================================================
--- trunk/zypper/src/zypper-command.cc (original)
+++ trunk/zypper/src/zypper-command.cc Thu Jun 21 17:07:22 2007
@@ -29,6 +29,7 @@
const ZypperCommand ZypperCommand::INFO(ZypperCommand::INFO_e);
const ZypperCommand ZypperCommand::LIST_UPDATES(ZypperCommand::LIST_UPDATES_e);
const ZypperCommand ZypperCommand::PATCH_CHECK(ZypperCommand::PATCH_CHECK_e);
+const ZypperCommand ZypperCommand::SHOW_PATCHES(ZypperCommand::SHOW_PATCHES_e);
const ZypperCommand ZypperCommand::HELP(ZypperCommand::HELP_e);
const ZypperCommand ZypperCommand::SHELL(ZypperCommand::SHELL_e);
@@ -62,6 +63,7 @@
_table["info"] = _table["if"] = ZypperCommand::INFO_e;
_table["list-updates"] = _table["lu"] = ZypperCommand::LIST_UPDATES_e;
_table["patch-check"] = _table["pchk"] = ZypperCommand::PATCH_CHECK_e;
+ _table["patches"] = _table["pch"] = ZypperCommand::SHOW_PATCHES_e;
_table["help"] = ZypperCommand::HELP_e;
_table["shell"] = _table["sh"] = ZypperCommand::SHELL_e;
Modified: trunk/zypper/src/zypper-command.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.h?rev=…
==============================================================================
--- trunk/zypper/src/zypper-command.h (original)
+++ trunk/zypper/src/zypper-command.h Thu Jun 21 17:07:22 2007
@@ -23,6 +23,7 @@
static const ZypperCommand INFO;
static const ZypperCommand LIST_UPDATES;
static const ZypperCommand PATCH_CHECK;
+ static const ZypperCommand SHOW_PATCHES;
static const ZypperCommand HELP;
static const ZypperCommand SHELL;
@@ -52,6 +53,7 @@
INFO_e,
LIST_UPDATES_e,
PATCH_CHECK_e,
+ SHOW_PATCHES_e,
HELP_e,
SHELL_e,
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5820 - /branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 14:01:49 2007
New Revision: 5820
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5820&view=rev
Log:
install
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 14:01:49 2007
@@ -161,11 +161,6 @@
Selection.h
Signature.h
SilentCallbacks.h
- Source.h
- SourceCache.h
- SourceFactory.h
- SourceFeed.h
- SourceManager.h
SrcPackage.h
SysContent.h
SystemResObject.h
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5819 - in /branches/REFACTORING-10_3/libzypp/zypp: CMakeLists.txt RepositoryFactory.cc RepositoryFactory.h
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 13:55:46 2007
New Revision: 5819
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5819&view=rev
Log:
compile
Removed:
branches/REFACTORING-10_3/libzypp/zypp/RepositoryFactory.cc
branches/REFACTORING-10_3/libzypp/zypp/RepositoryFactory.h
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 13:55:46 2007
@@ -86,7 +86,6 @@
RepoInfo.cc
RepoStatus.cc
RepoManager.cc
- RepositoryFactory.cc
)
SET( zypp_HEADERS
@@ -188,7 +187,6 @@
RepoInfo.h
RepoStatus.h
RepoManager.h
- RepositoryFactory.h
)
INSTALL( FILES ${zypp_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/zypp" )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5818 - in /branches/REFACTORING-10_3/libzypp: doc/autodoc/ tests/zypp/ tools/ tools/registration/ zypp/ zypp/detail/ zypp/parser/ zypp/parser/tagfile/ zypp/parser/xmlstore/ zypp/parser/yum/ zypp/p...
by dmacvicar@svn.opensuse.org 21 Jun '07
by dmacvicar@svn.opensuse.org 21 Jun '07
21 Jun '07
Author: dmacvicar
Date: Thu Jun 21 12:09:24 2007
New Revision: 5818
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5818&view=rev
Log:
- everything compiles. Only query-pool disabled for now
Added:
branches/REFACTORING-10_3/libzypp/zypp/repo/Applydeltarpm.cc
- copied, changed from r5803, trunk/libzypp/zypp/source/Applydeltarpm.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/Applydeltarpm.h
- copied unchanged from r5803, trunk/libzypp/zypp/source/Applydeltarpm.h
branches/REFACTORING-10_3/libzypp/zypp/repo/PackageDelta.cc
- copied, changed from r5803, trunk/libzypp/zypp/source/PackageDelta.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/PackageDelta.h
- copied unchanged from r5803, trunk/libzypp/zypp/source/PackageDelta.h
branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.cc
- copied, changed from r5803, trunk/libzypp/zypp/source/SUSEMediaVerifier.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.h
- copied, changed from r5803, trunk/libzypp/zypp/source/SUSEMediaVerifier.h
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/
- copied from r5803, trunk/libzypp/zypp/source/plaindir/
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/.cvsignore
- copied unchanged from r5817, trunk/libzypp/zypp/source/plaindir/.cvsignore
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.cc
- copied, changed from r5817, trunk/libzypp/zypp/source/plaindir/PlaindirImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.h
- copied, changed from r5817, trunk/libzypp/zypp/source/plaindir/PlaindirImpl.h
Removed:
branches/REFACTORING-10_3/libzypp/zypp/Source.cc
branches/REFACTORING-10_3/libzypp/zypp/Source.h
branches/REFACTORING-10_3/libzypp/zypp/SourceCache.cc
branches/REFACTORING-10_3/libzypp/zypp/SourceCache.h
branches/REFACTORING-10_3/libzypp/zypp/SourceFactory.cc
branches/REFACTORING-10_3/libzypp/zypp/SourceFactory.h
branches/REFACTORING-10_3/libzypp/zypp/SourceFeed.cc
branches/REFACTORING-10_3/libzypp/zypp/SourceFeed.h
branches/REFACTORING-10_3/libzypp/zypp/SourceManager.cc
branches/REFACTORING-10_3/libzypp/zypp/SourceManager.h
branches/REFACTORING-10_3/libzypp/zypp/parser/SAXParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/SAXParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/tagfile/
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMFileListParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMFileListParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMGroupParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMGroupParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMOtherParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMOtherParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMParserData.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMParserData.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatchParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatchParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatchesParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatchesParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatternParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPatternParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPrimaryParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMPrimaryParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMProductParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMProductParser.h
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMRepomdParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/yum/YUMRepomdParser.h
branches/REFACTORING-10_3/libzypp/zypp/source/Applydeltarpm.cc
branches/REFACTORING-10_3/libzypp/zypp/source/Applydeltarpm.h
branches/REFACTORING-10_3/libzypp/zypp/source/Builtin.h
branches/REFACTORING-10_3/libzypp/zypp/source/MediaSet.cc
branches/REFACTORING-10_3/libzypp/zypp/source/MediaSet.h
branches/REFACTORING-10_3/libzypp/zypp/source/PackageDelta.cc
branches/REFACTORING-10_3/libzypp/zypp/source/PackageDelta.h
branches/REFACTORING-10_3/libzypp/zypp/source/PackageProvider.cc
branches/REFACTORING-10_3/libzypp/zypp/source/PackageProvider.h
branches/REFACTORING-10_3/libzypp/zypp/source/SUSEMediaVerifier.cc
branches/REFACTORING-10_3/libzypp/zypp/source/SUSEMediaVerifier.h
branches/REFACTORING-10_3/libzypp/zypp/source/SourceImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/source/SourceImpl.h
branches/REFACTORING-10_3/libzypp/zypp/source/SourceInfo.cc
branches/REFACTORING-10_3/libzypp/zypp/source/SourceInfo.h
branches/REFACTORING-10_3/libzypp/zypp/source/SourceProvideFile.cc
branches/REFACTORING-10_3/libzypp/zypp/source/SourceProvideFile.h
branches/REFACTORING-10_3/libzypp/zypp/source/plaindir/
branches/REFACTORING-10_3/libzypp/zypp/source/susetags/
branches/REFACTORING-10_3/libzypp/zypp/source/yum/
Modified:
branches/REFACTORING-10_3/libzypp/doc/autodoc/Doxyfile.cmake
branches/REFACTORING-10_3/libzypp/tests/zypp/RepoManager_test.cc
branches/REFACTORING-10_3/libzypp/tools/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/tools/registration/zypp-query-pool.cc
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/CapFilters.h
branches/REFACTORING-10_3/libzypp/zypp/FileChecker.h
branches/REFACTORING-10_3/libzypp/zypp/KeyRing.cc
branches/REFACTORING-10_3/libzypp/zypp/MediaSetAccess.cc
branches/REFACTORING-10_3/libzypp/zypp/Package.cc
branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
branches/REFACTORING-10_3/libzypp/zypp/Repository.h
branches/REFACTORING-10_3/libzypp/zypp/ResFilters.h
branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc
branches/REFACTORING-10_3/libzypp/zypp/ResObject.h
branches/REFACTORING-10_3/libzypp/zypp/ResPool.h
branches/REFACTORING-10_3/libzypp/zypp/Resolvable.cc
branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc
branches/REFACTORING-10_3/libzypp/zypp/VendorAttr.cc
branches/REFACTORING-10_3/libzypp/zypp/ZYpp.cc
branches/REFACTORING-10_3/libzypp/zypp/ZYpp.h
branches/REFACTORING-10_3/libzypp/zypp/ZYppCallbacks.h
branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h
branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc
branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h
branches/REFACTORING-10_3/libzypp/zypp/parser/IniParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.h
branches/REFACTORING-10_3/libzypp/zypp/pool/GetResolvablesToInsDel.cc
branches/REFACTORING-10_3/libzypp/zypp/pool/PoolTraits.h
branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.h
branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/RepoProvideFile.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ProductImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ScriptImpl.h
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.cc
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.h
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.cc
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.h
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverInfo.cc
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverQueue.cc
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.cc
branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.h
branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.cc
branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.h
branches/REFACTORING-10_3/libzypp/zypp/target/TargetImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.h
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/Backend.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.cc
branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.cc
branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.cc
branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLAtomImpl.h
branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLProductImpl.h
branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.h
Modified: branches/REFACTORING-10_3/libzypp/doc/autodoc/Doxyfile.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/doc/…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/doc/autodoc/Doxyfile.cmake (original)
+++ branches/REFACTORING-10_3/libzypp/doc/autodoc/Doxyfile.cmake Thu Jun 21 12:09:24 2007
@@ -201,8 +201,8 @@
GROUP_GRAPHS = NO
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = NO
-INCLUDED_BY_GRAPH = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
Modified: branches/REFACTORING-10_3/libzypp/tests/zypp/RepoManager_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/test…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/tests/zypp/RepoManager_test.cc (original)
+++ branches/REFACTORING-10_3/libzypp/tests/zypp/RepoManager_test.cc Thu Jun 21 12:09:24 2007
@@ -10,6 +10,7 @@
#include "zypp/PublicKey.h"
#include "zypp/TmpPath.h"
#include "zypp/ResStore.h"
+#include "zypp/PathInfo.h"
#include "zypp/RepoManager.h"
Modified: branches/REFACTORING-10_3/libzypp/tools/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/tool…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/tools/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/tools/CMakeLists.txt Thu Jun 21 12:09:24 2007
@@ -1,3 +1,3 @@
-ADD_SUBDIRECTORY( registration )
+#ADD_SUBDIRECTORY( registration )
ADD_SUBDIRECTORY( package-manager )
ADD_SUBDIRECTORY( cachetools )
\ No newline at end of file
Modified: branches/REFACTORING-10_3/libzypp/tools/registration/zypp-query-pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/tool…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/tools/registration/zypp-query-pool.cc (original)
+++ branches/REFACTORING-10_3/libzypp/tools/registration/zypp-query-pool.cc Thu Jun 21 12:09:24 2007
@@ -5,7 +5,7 @@
#include <zypp/ZYpp.h>
#include <zypp/zypp_detail/ZYppReadOnlyHack.h>
#include <zypp/ZYppFactory.h>
-#include <zypp/SourceManager.h>
+#include <zypp/RepoManager.h>
#include <zypp/base/Logger.h>
#include <zypp/base/Exception.h>
#include <zypp/base/Algorithm.h>
@@ -80,7 +80,7 @@
MIL << "query_pool kind '" << kind << "', repository '" << repository << "'" << endl;
- SourceManager_Ptr manager = SourceManager::sourceManager();
+ RepoManager manager;
if (!system)
{
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 12:09:24 2007
@@ -4,10 +4,6 @@
ADD_DEFINITIONS(-DLOCALEDIR=\\\"/usr/share/libzypp\\\" -DTEXTDOMAIN=\\\"zypp\\\" )
-IF(ZYPP_REFACTORING)
- ADD_DEFINITIONS(-DZYPP_REFACTORING)
-ENDIF(ZYPP_REFACTORING)
-
ADD_EXECUTABLE(mkarray ${CMAKE_SOURCE_DIR}/zypp/cache/schema/mkarray.c )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
#FILE(WRITE filename "message to write"... )
@@ -54,11 +50,6 @@
Package.cc
Pathname.cc
ProgressData.cc
- Source.cc
- SourceFactory.cc
- SourceManager.cc
- SourceCache.cc
- SourceFeed.cc
SrcPackage.cc
SysContent.cc
Target.cc
@@ -433,7 +424,6 @@
parser/IniParser.cc
parser/IniDict.cc
parser/LibXMLHelper.cc
- parser/SAXParser.cc
parser/XMLNodeIterator.cc
parser/RepoFileReader.cc
)
@@ -445,7 +435,6 @@
parser/IniDict.h
parser/LibXMLHelper.h
parser/ParserProgress.h
- parser/SAXParser.h
parser/XMLNodeIterator.h
parser/xml_parser_assert.h
parser/RepoFileReader.h
@@ -481,19 +470,6 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/susetags
)
-SET( zypp_parser_tagfile_SRCS
- parser/tagfile/TagFileParser.cc
-)
-
-SET( zypp_parser_tagfile_HEADERS
- parser/tagfile/TagFileParser.h
-)
-
-INSTALL( FILES
- ${zypp_parser_tagfile_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/tagfile
-)
-
SET( zypp_parser_xml_SRCS
parser/xml/Node.cc
parser/xml/ParseDef.cc
@@ -547,16 +523,6 @@
)
SET( zypp_parser_yum_SRCS
- parser/yum/YUMFileListParser.cc
- parser/yum/YUMGroupParser.cc
- parser/yum/YUMOtherParser.cc
- parser/yum/YUMParserData.cc
- parser/yum/YUMPatchParser.cc
- parser/yum/YUMPatchesParser.cc
- parser/yum/YUMPatternParser.cc
- parser/yum/YUMPrimaryParser.cc
- parser/yum/YUMProductParser.cc
- parser/yum/YUMRepomdParser.cc
parser/yum/RepoParser.cc
parser/yum/FileReaderBaseImpl.cc
parser/yum/RepomdFileReader.cc
@@ -570,17 +536,6 @@
)
SET( zypp_parser_yum_HEADERS
- parser/yum/YUMFileListParser.h
- parser/yum/YUMGroupParser.h
- parser/yum/YUMOtherParser.h
- parser/yum/YUMParser.h
- parser/yum/YUMParserData.h
- parser/yum/YUMPatchParser.h
- parser/yum/YUMPatchesParser.h
- parser/yum/YUMPatternParser.h
- parser/yum/YUMPrimaryParser.h
- parser/yum/YUMProductParser.h
- parser/yum/YUMRepomdParser.h
parser/yum/RepoParser.h
parser/yum/RepoParserOpts.h
parser/yum/FileReaderBase.h
@@ -704,111 +659,17 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/solver/detail
)
-SET( zypp_source_SRCS
- source/Applydeltarpm.cc
- source/MediaSet.cc
- source/PackageDelta.cc
- source/PackageProvider.cc
- source/SourceImpl.cc
- source/SourceInfo.cc
- source/SourceProvideFile.cc
- source/SUSEMediaVerifier.cc
-)
-
-SET( zypp_source_HEADERS
- source/Applydeltarpm.h
- source/Builtin.h
- source/MediaSet.h
- source/PackageDelta.h
- source/PackageProvider.h
- source/SourceImpl.h
- source/SourceInfo.h
- source/SourceProvideFile.h
- source/SUSEMediaVerifier.h
-)
-
-INSTALL( FILES
- ${zypp_source_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/source
-)
-
-SET( zypp_source_plaindir_SRCS
- source/plaindir/PlaindirImpl.cc
-)
-
-SET( zypp_source_plaindir_HEADERS
- source/plaindir/PlaindirImpl.h
-)
-
-INSTALL( FILES
- ${zypp_source_plaindir_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/source/plaindir
-)
-
-SET( zypp_source_susetags_SRCS
- source/susetags/MediaMetadataParser.cc
- source/susetags/MediaPatchesMetadataParser.cc
- source/susetags/PackagesLangParser.cc
- source/susetags/PackagesParser.cc
- source/susetags/PatternTagFileParser.cc
- source/susetags/ProductMetadataParser.cc
- source/susetags/SelectionTagFileParser.cc
- source/susetags/SuseTagsImpl.cc
- source/susetags/SuseTagsPackageImpl.cc
- source/susetags/SuseTagsPatternImpl.cc
- source/susetags/SuseTagsProductImpl.cc
- source/susetags/SuseTagsSelectionImpl.cc
- source/susetags/SuseTagsSrcPackageImpl.cc
-)
-
-SET( zypp_source_susetags_HEADERS
- source/susetags/MediaMetadataParser.h
- source/susetags/MediaPatchesMetadataParser.h
- source/susetags/PackagesLangParser.h
- source/susetags/PackagesParser.h
- source/susetags/PatternTagFileParser.h
- source/susetags/ProductMetadataParser.h
- source/susetags/SelectionTagFileParser.h
- source/susetags/SuseTagsImpl.h
- source/susetags/SuseTagsPackageImpl.h
- source/susetags/SuseTagsPatternImpl.h
- source/susetags/SuseTagsProductImpl.h
- source/susetags/SuseTagsSelectionImpl.h
- source/susetags/SuseTagsSrcPackageImpl.h
-)
-
-INSTALL( FILES
- ${zypp_source_susetags_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/source/susetags
-)
-
-SET( zypp_source_yum_SRCS
- source/yum/YUMAtomImpl.cc
- source/yum/YUMGroupImpl.cc
- source/yum/YUMMessageImpl.cc
- source/yum/YUMPackageImpl.cc
- source/yum/YUMPatchImpl.cc
- source/yum/YUMPatternImpl.cc
- source/yum/YUMProductImpl.cc
- source/yum/YUMScriptImpl.cc
- source/yum/YUMSourceImpl.cc
-)
-
-SET( zypp_source_yum_HEADERS
- source/yum/YUMAtomImpl.h
- source/yum/YUMGroupImpl.h
- source/yum/YUMMessageImpl.h
- source/yum/YUMPackageImpl.h
- source/yum/YUMPatchImpl.h
- source/yum/YUMPatternImpl.h
- source/yum/YUMProductImpl.h
- source/yum/YUMScriptImpl.h
- source/yum/YUMSourceImpl.h
+SET( zypp_repo_plaindir_SRCS
+ repo/plaindir/PlaindirImpl.cc
+)
+
+SET( zypp_repo_plaindir_HEADERS
+ repo/plaindir/PlaindirImpl.h
)
INSTALL( FILES
- ${zypp_source_yum_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/source/yum
+ ${zypp_repo_plaindir_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/repo/plaindir
)
SET( zypp_target_SRCS
@@ -1067,6 +928,9 @@
repo/PackageProvider.cc
repo/RepoProvideFile.cc
repo/DeltaCandidates.cc
+ repo/Applydeltarpm.cc
+ repo/PackageDelta.cc
+ repo/SUSEMediaVerifier.cc
)
SET( zypp_repo_HEADERS
@@ -1076,6 +940,9 @@
repo/PackageProvider.h
repo/RepoProvideFile.h
repo/DeltaCandidates.h
+ repo/Applydeltarpm.h
+ repo/PackageDelta.h
+ repo/SUSEMediaVerifier.h
)
INSTALL( FILES
@@ -1150,16 +1017,12 @@
${zypp_cache_SRCS}
${zypp_cache_sqlite3x_SRCS}
${zypp_pool_SRCS}
-${zypp_parser_tagfile_SRCS}
${zypp_parser_susetags_SRCS}
-${zypp_parser_yum2_SRCS}
${zypp_parser_xmlstore_SRCS}
${zypp_parser_xml_SRCS}
${zypp_parser_yum_SRCS}
${zypp_parser_SRCS}
-${zypp_source_plaindir_SRCS}
-${zypp_source_yum_SRCS}
-${zypp_source_susetags_SRCS}
+${zypp_repo_plaindir_SRCS}
${zypp_source_SRCS}
${zypp_data_SRCS}
${zypp_media_proxyinfo_SRCS}
@@ -1185,7 +1048,7 @@
)
SET( zypp_lib_HEADERS
-${zypp_source_plaindir_HEADERS}
+${zypp_repo_plaindir_HEADERS}
${zypp_target_store_xml_HEADERS}
${zypp_parser_tagfile_HEADERS}
${zypp_parser_susetags_HEADERS}
@@ -1235,9 +1098,8 @@
SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} )
# override some defaults
-SET_LOGGROUP( "plaindir" ${zypp_source_plaindir_SRCS} )
+SET_LOGGROUP( "plaindir" ${zypp_repo_plaindir_SRCS} )
SET_LOGGROUP( "xmlstore" ${zypp_target_store_xml_SRCS} )
-SET_LOGGROUP( "tagfile" ${zypp_parser_tagfile_SRCS} )
#SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} )
#SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} )
#SET_LOGGROUP( "group" ${zypp_capability_SRCS} )
Modified: branches/REFACTORING-10_3/libzypp/zypp/CapFilters.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CapFilters.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CapFilters.h Thu Jun 21 12:09:24 2007
@@ -14,6 +14,7 @@
#include "zypp/base/Functional.h"
#include "zypp/Capability.h"
+#include "zypp/ResObject.h"
///////////////////////////////////////////////////////////////////
namespace zypp
Modified: branches/REFACTORING-10_3/libzypp/zypp/FileChecker.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/FileChecker.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/FileChecker.h Thu Jun 21 12:09:24 2007
@@ -16,7 +16,7 @@
#include <list>
#include "zypp/base/Exception.h"
#include "zypp/base/Function.h"
-#include "zypp/Pathname.h"
+#include "zypp/PathInfo.h"
#include "zypp/CheckSum.h"
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/KeyRing.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/KeyRing.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/KeyRing.cc Thu Jun 21 12:09:24 2007
@@ -21,7 +21,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/IOStream.h"
#include "zypp/base/String.h"
-#include "zypp/Pathname.h"
+#include "zypp/PathInfo.h"
#include "zypp/KeyRing.h"
#include "zypp/ExternalProgram.h"
#include "zypp/TmpPath.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/MediaSetAccess.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/MediaSetAccess.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/MediaSetAccess.cc Thu Jun 21 12:09:24 2007
@@ -11,6 +11,7 @@
#include <fstream>
#include "zypp/base/LogTools.h"
+#include "zypp/base/UserRequestException.h"
#include "zypp/ZYppCallbacks.h"
#include "zypp/MediaSetAccess.h"
#include "zypp/PathInfo.h"
@@ -146,7 +147,7 @@
else if ( user == media::MediaChangeReport::IGNORE )
{
DBG << "Skipping" << endl;
- ZYPP_THROW ( source::SkipRequestedException("User-requested skipping of a file") );
+ ZYPP_THROW ( SkipRequestException("User-requested skipping of a file") );
}
else if ( user == media::MediaChangeReport::EJECT )
{
@@ -250,7 +251,7 @@
user = checkonly ? media::MediaChangeReport::ABORT :
report->requestMedia (
- Source_Ref::noSource,
+ Repository::noRepository,
media_nr,
reason,
excp.asUserString()
@@ -266,7 +267,7 @@
else if ( user == media::MediaChangeReport::IGNORE )
{
DBG << "Skipping" << endl;
- ZYPP_THROW ( source::SkipRequestedException("User-requested skipping of a file") );
+ ZYPP_THROW ( SkipRequestException("User-requested skipping of a file") );
}
else if ( user == media::MediaChangeReport::EJECT )
{
Modified: branches/REFACTORING-10_3/libzypp/zypp/Package.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Package.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Package.cc Thu Jun 21 12:09:24 2007
@@ -10,7 +10,6 @@
*
*/
#include "zypp/Package.h"
-#include "zypp/source/SourceImpl.h"
#include "zypp/base/Exception.h"
using namespace std;
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.cc Thu Jun 21 12:09:24 2007
@@ -63,6 +63,19 @@
return _pimpl->deltaRpms();
}
+ std::ostream & operator<<( std::ostream & str, const Repository & obj )
+ {
+ return str << "[" << obj.info().alias() << "]" << endl;
+ }
+
+ bool operator==( const Repository & lhs, const Repository & rhs )
+ {
+ return (lhs.info().alias() == rhs.info().alias());
+ }
+ bool operator<( const Repository & lhs, const Repository & rhs )
+ {
+ return (lhs.info().alias() < rhs.info().alias());
+ }
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/Repository.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Repository.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Repository.h Thu Jun 21 12:09:24 2007
@@ -7,11 +7,14 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/base/SafeBool.h"
-#include "zypp/ResStore.h"
+//#include "zypp/ResStore.h"
#include "zypp/RepoInfo.h"
+#include "zypp/repo/PackageDelta.h"
namespace zypp
{
+ class ResStore;
+
namespace repo
{
DEFINE_PTR_TYPE(RepositoryImpl);
@@ -56,7 +59,7 @@
/**
* \short Get the resolvables for repo
*/
- const ResStore & resolvables();
+ const zypp::ResStore & resolvables();
/**
* \short Repository info used to create this repository
@@ -94,6 +97,10 @@
RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
};
+ std::ostream & operator<<( std::ostream & str, const Repository & obj );
+ bool operator==( const Repository & lhs, const Repository & rhs );
+ bool operator<( const Repository & lhs, const Repository & rhs );
+
}
#endif
Modified: branches/REFACTORING-10_3/libzypp/zypp/ResFilters.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ResFilters.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ResFilters.h Thu Jun 21 12:09:24 2007
@@ -18,14 +18,15 @@
#include "zypp/Resolvable.h"
#include "zypp/CapFilters.h"
-#include "zypp/Source.h"
-
#include "zypp/PoolItem.h"
#include "zypp/CapAndItem.h"
+//#include "zypp/Repository.h"
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+ class Repository;
///////////////////////////////////////////////////////////////////
namespace resfilter
{ /////////////////////////////////////////////////////////////////
@@ -187,19 +188,19 @@
};
- /** Select ResObject by source. */
- struct BySource : public ResObjectFilterFunctor
+ /** Select ResObject by repository. */
+ struct ByRepository : public ResObjectFilterFunctor
{
- BySource( Source_Ref source_r )
- : _source( source_r )
+ ByRepository( Repository repository_r )
+ : _repository( repository_r )
{}
bool operator()( ResObject::constPtr p ) const
{
- return p->source() == _source;
+ return p->repository() == _repository;
}
- Source_Ref _source;
+ Repository _repository;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc Thu Jun 21 12:09:24 2007
@@ -10,7 +10,6 @@
*
*/
#include "zypp/ResObject.h"
-#include "zypp/source/SourceImpl.h"
#include "zypp/Repository.h"
#include "zypp/detail/ResObjectImplIf.h"
@@ -45,7 +44,7 @@
//
std::ostream & ResObject::dumpOn( std::ostream & str ) const
{
- str << "[S" << source().numericId() << ":" << sourceMediaNr() << "]";
+ str << "[S" << repository().numericId() << ":" << mediaNr() << "]";
return Resolvable::dumpOn( str );
}
@@ -79,12 +78,6 @@
ByteCount ResObject::archivesize() const
{ return pimpl().archivesize(); }
- Source_Ref ResObject::source() const
- { return pimpl().source(); }
-
- unsigned ResObject::sourceMediaNr() const
- { return pimpl().sourceMediaNr(); }
-
Repository ResObject::repository() const
{ return pimpl().repository(); }
@@ -100,9 +93,6 @@
Date ResObject::installtime() const
{ return pimpl().installtime(); }
- ZmdId ResObject::zmdid () const
- { return pimpl().zmdid(); }
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/ResObject.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ResObject.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ResObject.h Thu Jun 21 12:09:24 2007
@@ -16,8 +16,10 @@
#include "zypp/detail/ResObjectImplIf.h"
#include "zypp/Resolvable.h"
+//#include "zypp/Repository.h"
#include "zypp/TranslatedText.h"
#include "zypp/NeedAType.h"
+#include "zypp/Date.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -26,7 +28,7 @@
class ImplConnect;
class ResObjectImplIf;
}
- class Source_Ref;
+
class Repository;
class ByteCount;
@@ -100,11 +102,6 @@
/**
* Source providing this resolvable
*/
- /*ZYPP_DEPRECATED */ Source_Ref source() const;
-
- /**
- * Source providing this resolvable
- */
Repository repository() const;
/**
@@ -112,18 +109,6 @@
* 0 if no media access is required.
*/
unsigned mediaNr() const;
-
- /**
- * Media number where the resolvable is located
- * 0 if no media access is required.
- */
- /* ZYPP_DEPRECATED */ unsigned sourceMediaNr() const;
-
- /**
- * \deprecated Use sourceMediaNr
- */
- /* ZYPP_DEPRECATED */ unsigned mediaId() const
- { return sourceMediaNr(); }
/**
* \TODO FIXME what is this?
@@ -141,11 +126,6 @@
*/
Date installtime() const;
- /**
- * \deprecated No replacement.
- */
- ZYPP_DEPRECATED ZmdId zmdid () const;
-
protected:
/** Ctor */
ResObject( const Kind & kind_r,
Modified: branches/REFACTORING-10_3/libzypp/zypp/ResPool.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ResPool.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ResPool.h Thu Jun 21 12:09:24 2007
@@ -72,7 +72,7 @@
public:
/** \name Iterate through all ResObjects of a certain kind. */
//@{
- typedef resfilter::ByKind ByKind;
+ typedef zypp::resfilter::ByKind ByKind;
typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
@@ -140,7 +140,7 @@
/**
* Handling additional conflicts. E.G. do not install anything which provides "foo":
*
- * \code
+ * \code75
* CapSet capset;
* capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
*
Modified: branches/REFACTORING-10_3/libzypp/zypp/Resolvable.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/Resolvable.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/Resolvable.cc Thu Jun 21 12:09:24 2007
@@ -15,7 +15,6 @@
#include "zypp/detail/ResolvableImpl.h"
#include "zypp/ResObject.h"
-#include "zypp/Source.h"
using namespace std;
Modified: branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc Thu Jun 21 12:09:24 2007
@@ -10,7 +10,6 @@
*
*/
#include "zypp/SrcPackage.h"
-#include "zypp/source/SourceImpl.h"
#include "zypp/base/Exception.h"
using namespace std;
Modified: branches/REFACTORING-10_3/libzypp/zypp/VendorAttr.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/VendorAttr.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/VendorAttr.cc Thu Jun 21 12:09:24 2007
@@ -25,6 +25,7 @@
#include "zypp/base/IOStream.h"
#include "zypp/base/String.h"
+#include "zypp/PathInfo.h"
#include "zypp/VendorAttr.h"
#include "zypp/ZYppFactory.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/ZYpp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ZYpp.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ZYpp.cc Thu Jun 21 12:09:24 2007
@@ -81,9 +81,6 @@
//
///////////////////////////////////////////////////////////////////
- //SourceFeed_Ref ZYpp::sourceFeed() const
- //{ return _pimpl->sourceFeed(); }
-
void ZYpp::addResolvables (const ResStore& store, bool installed)
{
_pimpl->addResolvables (store, installed);
Modified: branches/REFACTORING-10_3/libzypp/zypp/ZYpp.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ZYpp.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ZYpp.h Thu Jun 21 12:09:24 2007
@@ -38,7 +38,6 @@
class ZYppFactory;
class ResPool;
class ResPoolProxy;
- class SourceFeed_Ref;
class ResStore;
class Locale;
class KeyRing;
@@ -72,9 +71,6 @@
*/
ResPoolProxy poolProxy() const;
- /** */
- //SourceFeed_Ref sourceFeed() const;
-
void addResolvables (const ResStore& store, bool installed = false);
void removeResolvables (const ResStore& store);
Modified: branches/REFACTORING-10_3/libzypp/zypp/ZYppCallbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/ZYppCallbacks.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/ZYppCallbacks.h Thu Jun 21 12:09:24 2007
@@ -14,7 +14,7 @@
#include "zypp/Callback.h"
#include "zypp/Resolvable.h"
-#include "zypp/Source.h"
+#include "zypp/Repository.h"
#include "zypp/Pathname.h"
#include "zypp/Message.h"
#include "zypp/Url.h"
@@ -114,7 +114,7 @@
};
// progress for probing a source
- struct ProbeSourceReport : public callback::ReportBase
+ struct ProbeRepoReport : public callback::ReportBase
{
enum Action {
ABORT, // abort and return error
@@ -140,7 +140,7 @@
virtual Action problem( const Url &/*url*/, Error /*error*/, const std::string &/*description*/ ) { return ABORT; }
};
- struct SourceCreateReport : public callback::ReportBase
+ struct RepoCreateReport : public callback::ReportBase
{
enum Action {
ABORT, // abort and return error
@@ -174,7 +174,7 @@
{}
};
- struct SourceReport : public callback::ReportBase
+ struct RepoReport : public callback::ReportBase
{
enum Action {
ABORT, // abort and return error
@@ -189,18 +189,18 @@
INVALID // th source is invalid
};
- virtual void start( Source_Ref /*source*/, const std::string &/*task*/ ) {}
+ virtual void start( Repository /*source*/, const std::string &/*task*/ ) {}
virtual bool progress( int /*value*/ )
{ return true; }
virtual Action problem(
- Source_Ref /*source*/
+ Repository /*source*/
, Error /*error*/
, const std::string &/*description*/ )
{ return ABORT; }
virtual void finish(
- Source_Ref /*source*/
+ Repository /*source*/
, const std::string &/*task*/
, Error /*error*/
, const std::string &/*reason*/ )
@@ -236,7 +236,7 @@
};
virtual Action requestMedia(
- Source_Ref /*source*/
+ Repository /*source*/
, unsigned /*mediumNr*/
, Error /*error*/
, const std::string &/*description*/
Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h Thu Jun 21 12:09:24 2007
@@ -21,7 +21,7 @@
#include "zypp/Changelog.h"
#include "zypp/DiskUsage.h"
#include "zypp/PackageKeyword.h"
-#include "zypp/source/PackageDelta.h"
+#include "zypp/repo/PackageDelta.h"
///////////////////////////////////////////////////////////////////
namespace zypp
Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc Thu Jun 21 12:09:24 2007
@@ -10,8 +10,6 @@
*
*/
#include "zypp/detail/ResObjectImplIf.h"
-#include "zypp/source/SourceImpl.h"
-#include "zypp/SourceFactory.h"
#include "zypp/Repository.h"
///////////////////////////////////////////////////////////////////
@@ -50,18 +48,12 @@
ByteCount ResObjectImplIf::archivesize() const
{ return ByteCount(); }
- Source_Ref ResObjectImplIf::source() const
- { return Source_Ref::noSource; }
-
Repository ResObjectImplIf::repository() const
{ return Repository::noRepository; }
unsigned ResObjectImplIf::mediaNr() const
{ return 0; }
- unsigned ResObjectImplIf::sourceMediaNr() const
- { return 0; }
-
bool ResObjectImplIf::installOnly() const
{ return false; }
@@ -71,9 +63,6 @@
Date ResObjectImplIf::installtime() const
{ return Date(); }
- ZmdId ResObjectImplIf::zmdid() const
- { return 0; }
-
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h Thu Jun 21 12:09:24 2007
@@ -18,7 +18,7 @@
#include "zypp/base/Deprecated.h"
#include "zypp/detail/ResImplTraits.h"
#include "zypp/detail/ResObjectFactory.h"
-
+#include "zypp/Repository.h"
#include "zypp/Locale.h"
#include "zypp/ByteCount.h"
#include "zypp/Date.h"
@@ -34,7 +34,6 @@
{ /////////////////////////////////////////////////////////////////
class Resolvable;
- class Source_Ref;
class Repository;
///////////////////////////////////////////////////////////////////
@@ -93,15 +92,6 @@
*/
virtual unsigned mediaNr() const PURE_VIRTUAL;
- /** Backlink to the source providing this. */
- virtual Source_Ref source() const PURE_VIRTUAL;
-
- /** Number of the source media that provides the data
- * required for installation. Zero, if no media access
- * is required.
- */
- virtual unsigned sourceMediaNr() const PURE_VIRTUAL;
-
/** */
virtual bool installOnly() const PURE_VIRTUAL;
@@ -110,9 +100,6 @@
/** Time of installation, or \c 0 */
virtual Date installtime() const;
-
- /** Id used inside ZMD */
- ZYPP_DEPRECATED virtual ZmdId zmdid() const PURE_VIRTUAL;
//@}
public:
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/IniParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/IniParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/IniParser.cc Thu Jun 21 12:09:24 2007
@@ -69,7 +69,7 @@
void IniParser::parse( const InputStream & input_r, const ProgressData::ReceiverFnc & progress )
{
boost::regex rxSection("^\\[(.+)\\]$");
- boost::regex rxKeyValue("^(.+)[[:space:]]*=[[:space:]]*(.+)$");
+ boost::regex rxKeyValue("^(.*[^[:space:]])[ [:space:]]*=[[:space:]]*(.+)$");
MIL << "Start parsing " << input_r << endl;
_inputname = input_r.name();
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.cc Thu Jun 21 12:09:24 2007
@@ -18,7 +18,7 @@
#include <libxml/tree.h>
#include <zypp/base/Logger.h>
#include <zypp/parser/xmlstore/schemanames.h>
-
+#include "zypp/repo/RepoType.h"
#include "XMLSourceCacheParser.h"
using namespace std;
@@ -30,8 +30,8 @@
XMLSourceCacheParser::XMLSourceCacheParser()
{ }
- XMLSourceCacheParser::XMLSourceCacheParser(SourceInfo_Ptr &entry)
- : zypp::parser::XMLNodeIterator<SourceInfo_Ptr>(entry)
+ XMLSourceCacheParser::XMLSourceCacheParser(RepoInfo_Ptr &entry)
+ : zypp::parser::XMLNodeIterator<RepoInfo_Ptr>(entry)
{ }
@@ -47,11 +47,11 @@
}
// do the actual processing
- SourceInfo_Ptr
+ RepoInfo_Ptr
XMLSourceCacheParser::process(const xmlTextReaderPtr reader)
{
assert(reader);
- SourceInfo_Ptr dataPtr( new source::SourceInfo );
+ RepoInfo_Ptr dataPtr( new RepoInfo );
xmlNodePtr dataNode = xmlTextReaderExpand(reader);
assert(dataNode);
@@ -80,15 +80,7 @@
}
else if (name == "type")
{
- dataPtr->setType(_helper.content(child));
- }
- else if (name == "product-dir")
- {
- dataPtr->setPath(_helper.content(child));
- }
- else if (name == "cache-dir")
- {
- dataPtr->setCacheDir(_helper.content(child));
+ dataPtr->setType(repo::RepoType(_helper.content(child)));
}
else if (name == "alias")
{
@@ -96,7 +88,7 @@
}
else if (name == "url")
{
- dataPtr->setUrl(_helper.content(child));
+ dataPtr->addBaseUrl(_helper.content(child));
}
else
{
@@ -110,7 +102,7 @@
XMLSourceCacheParser::XMLSourceCacheParser(std::istream &is, const std::string &baseUrl)
- : zypp::parser::XMLNodeIterator<SourceInfo_Ptr>(is, baseUrl, SOURCESCHEMA)
+ : zypp::parser::XMLNodeIterator<RepoInfo_Ptr>(is, baseUrl, SOURCESCHEMA)
{
fetchNext();
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/xmlstore/XMLSourceCacheParser.h Thu Jun 21 12:09:24 2007
@@ -13,7 +13,7 @@
#ifndef XMLSourceCacheParser_h
#define XMLSourceCacheParser_h
-#include <zypp/source/SourceInfo.h>
+#include <zypp/RepoInfo.h>
#include <zypp/parser/XMLNodeIterator.h>
#include <zypp/parser/LibXMLHelper.h>
#include <list>
@@ -24,7 +24,7 @@
{
namespace xmlstore
{
- typedef shared_ptr<source::SourceInfo> SourceInfo_Ptr;
+ typedef shared_ptr<RepoInfo> RepoInfo_Ptr;
/*
* Use this class as an iterator that produces, one after one,
@@ -46,18 +46,18 @@
* You can query the exit status with errorStatus().
*/
- class XMLSourceCacheParser : public zypp::parser::XMLNodeIterator<SourceInfo_Ptr>
+ class XMLSourceCacheParser : public zypp::parser::XMLNodeIterator<RepoInfo_Ptr>
{
public:
XMLSourceCacheParser(std::istream &is, const std::string &baseUrl);
XMLSourceCacheParser();
- XMLSourceCacheParser(SourceInfo_Ptr & entry);
+ XMLSourceCacheParser(RepoInfo_Ptr & entry);
virtual ~XMLSourceCacheParser();
private:
virtual bool isInterested(const xmlNodePtr nodePtr);
- virtual SourceInfo_Ptr process(const xmlTextReaderPtr reader);
- void parseSourceList(SourceInfo_Ptr dataPtr, xmlNodePtr node);
+ virtual RepoInfo_Ptr process(const xmlTextReaderPtr reader);
+ void parseSourceList(RepoInfo_Ptr dataPtr, xmlNodePtr node);
zypp::parser::LibXMLHelper _helper;
};
} // namespace parser
Modified: branches/REFACTORING-10_3/libzypp/zypp/pool/GetResolvablesToInsDel.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/pool/GetResolvablesToInsDel.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/pool/GetResolvablesToInsDel.cc Thu Jun 21 12:09:24 2007
@@ -225,15 +225,15 @@
if (!cobj)
continue;
- if ( ! cobj->sourceMediaNr() ) {
+ if ( ! cobj->mediaNr() ) {
XXX << "No media access required for " << *cit << endl;
order.setInstalled( *cit );
other_list.push_back( *cit );
continue;
}
- if ( cobj->source().numericId() == last_prio &&
- cobj->sourceMediaNr() == last_medianum ) {
+ if ( cobj->repository().numericId() == last_prio &&
+ cobj->mediaNr() == last_medianum ) {
// prefer packages on current media.
XXX << "Stay with current media " << *cit << endl;
last_list.push_back( *cit );
@@ -247,12 +247,12 @@
if ( order_r == ORDER_BY_MEDIANR )
{
- if ( cobj->sourceMediaNr() < best_medianum ) {
+ if ( cobj->mediaNr() < best_medianum ) {
best_list.clear(); // new best
- } else if ( cobj->sourceMediaNr() == best_medianum ) {
- if ( cobj->source().numericId() < best_prio ) {
+ } else if ( cobj->mediaNr() == best_medianum ) {
+ if ( cobj->repository().numericId() < best_prio ) {
best_list.clear(); // new best
- } else if ( cobj->source().numericId() == best_prio ) {
+ } else if ( cobj->repository().numericId() == best_prio ) {
XXX << "Add to best list " << *cit << endl;
best_list.push_back( *cit ); // same as best -> add
continue;
@@ -265,12 +265,12 @@
}
else // default: ORDER_BY_SOURCE
{
- if ( cobj->source().numericId() < best_prio ) {
+ if ( cobj->repository().numericId() < best_prio ) {
best_list.clear(); // new best
- } else if ( cobj->source().numericId() == best_prio ) {
- if ( cobj->sourceMediaNr() < best_medianum ) {
+ } else if ( cobj->repository().numericId() == best_prio ) {
+ if ( cobj->mediaNr() < best_medianum ) {
best_list.clear(); // new best
- } else if ( cobj->sourceMediaNr() == best_medianum ) {
+ } else if ( cobj->mediaNr() == best_medianum ) {
XXX << "Add to best list " << *cit << endl;
best_list.push_back( *cit ); // same as best -> add
continue;
@@ -285,10 +285,10 @@
if ( best_list.empty() )
{
- XXX << "NEW BEST LIST [S" << cobj->source().numericId() << ":" << cobj->sourceMediaNr()
+ XXX << "NEW BEST LIST [S" << cobj->repository().numericId() << ":" << cobj->mediaNr()
<< "] (last [S" << best_prio << ":" << best_medianum << "])" << endl;
- best_prio = cobj->source().numericId();
- best_medianum = cobj->sourceMediaNr();
+ best_prio = cobj->repository().numericId();
+ best_medianum = cobj->mediaNr();
// first package or new best
XXX << "Add to best list " << *cit << endl;
best_list.push_back( *cit );
Modified: branches/REFACTORING-10_3/libzypp/zypp/pool/PoolTraits.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/pool/PoolTraits.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/pool/PoolTraits.h Thu Jun 21 12:09:24 2007
@@ -17,13 +17,15 @@
#include "zypp/PoolItem.h"
#include "zypp/Capability.h"
-#include "zypp/CapAndItem.h"
#include "zypp/Dep.h"
#include "zypp/ResStatus.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+
+ class CapAndItem;
+
///////////////////////////////////////////////////////////////////
namespace pool
{ /////////////////////////////////////////////////////////////////
@@ -77,7 +79,7 @@
typedef ItemContainerT::const_iterator byName_iterator;
// internal organization
- typedef std::list<CapAndItem> CapItemContainerT; // (why,who) pairs
+ typedef std::list<zypp::CapAndItem> CapItemContainerT; // (why,who) pairs
typedef std::map<std::string,CapItemContainerT> CapItemStoreT; // capability.index -> (why,who) pairs
typedef std::map<Dep,CapItemStoreT> DepCapItemContainerT; // Dep -> (capability.index -> (why,who) pairs)
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/Applydeltarpm.cc (from r5803, trunk/libzypp/zypp/source/Applydeltarpm.cc)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/Applydeltarpm.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/Applydeltarpm.cc Thu Jun 21 12:09:24 2007
@@ -13,7 +13,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
-#include "zypp/source/Applydeltarpm.h"
+#include "zypp/repo/Applydeltarpm.h"
#include "zypp/ExternalProgram.h"
#include "zypp/AutoDispose.h"
#include "zypp/PathInfo.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.cc Thu Jun 21 12:09:24 2007
@@ -28,7 +28,7 @@
public:
- Impl( const std::set<Repository> & repos )
+ Impl( const std::list<Repository> & repos )
: repos(repos)
{
@@ -39,7 +39,7 @@
Impl * clone() const
{ return new Impl( *this ); }
- std::set<Repository> repos;
+ std::list<Repository> repos;
};
///////////////////////////////////////////////////////////////////
@@ -49,7 +49,7 @@
return str << "DeltaCandidates::Impl";
}
- DeltaCandidates::DeltaCandidates(const std::set<Repository> & repos)
+ DeltaCandidates::DeltaCandidates(const std::list<Repository> & repos)
: _pimpl( new Impl(repos) )
{}
@@ -61,7 +61,7 @@
std::list<PatchRpm> candidates;
// query all repos
- for ( std::set<Repository>::const_iterator it = _pimpl->repos.begin();
+ for ( std::list<Repository>::const_iterator it = _pimpl->repos.begin();
it != _pimpl->repos.end();
++it )
{
@@ -83,7 +83,7 @@
std::list<DeltaRpm> candidates;
// query all repos
- for ( std::set<Repository>::const_iterator it = _pimpl->repos.begin();
+ for ( std::list<Repository>::const_iterator it = _pimpl->repos.begin();
it != _pimpl->repos.end();
++it )
{
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/DeltaCandidates.h Thu Jun 21 12:09:24 2007
@@ -11,7 +11,7 @@
#define ZYPP_REPO_DELTACANDIDATES_H
#include <iosfwd>
-#include <set>
+#include <list>
#include "zypp/base/PtrTypes.h"
#include "zypp/base/Function.h"
@@ -43,7 +43,7 @@
* \param repos Set of repositories providing patch and delta packages
* \param installed_callback Will be used to ask if a package is installed or not
*/
- DeltaCandidates( const std::set<Repository> & repos );
+ DeltaCandidates( const std::list<Repository> & repos );
/** Dtor */
~DeltaCandidates();
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/PackageDelta.cc (from r5803, trunk/libzypp/zypp/source/PackageDelta.cc)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/PackageDelta.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/PackageDelta.cc Thu Jun 21 12:09:24 2007
@@ -13,7 +13,7 @@
#include "zypp/base/LogTools.h"
-#include "zypp/source/PackageDelta.h"
+#include "zypp/repo/PackageDelta.h"
using std::endl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc Thu Jun 21 12:09:24 2007
@@ -18,8 +18,8 @@
#include "zypp/Repository.h"
#include "zypp/repo/PackageProvider.h"
#include "zypp/repo/RepoProvideFile.h"
-#include "zypp/source/Applydeltarpm.h"
-#include "zypp/source/PackageDelta.h"
+#include "zypp/repo/Applydeltarpm.h"
+#include "zypp/repo/PackageDelta.h"
#include "zypp/detail/ImplConnect.h"
#include "zypp/RepoInfo.h"
@@ -228,8 +228,9 @@
Pathname destination( Pathname::dirname( delta ) / defRpmFileName( _package ) );
/* just to ease testing with non remote sources */
- if ( ! _package->source().remote() )
- destination = Pathname("/tmp") / defRpmFileName( _package );
+ // FIXME removed API
+ //if ( ! _package->source().remote() )
+ // destination = Pathname("/tmp") / defRpmFileName( _package );
/**/
if ( ! applydeltarpm::provide( delta, destination,
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepoProvideFile.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepoProvideFile.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepoProvideFile.cc Thu Jun 21 12:09:24 2007
@@ -43,7 +43,7 @@
* We redirect the static report triggered from Repository::provideFile
* to feed the ProvideFilePolicy callbacks.
*/
- struct DownloadFileReportHack : public callback::ReceiveReport<source::SourceReport>
+ struct DownloadFileReportHack : public callback::ReceiveReport<source::RepoReport>
{
virtual bool progress( int value )
{
@@ -89,7 +89,7 @@
DownloadFileReportHack dumb;
dumb._redirect = bind( mem_fun_ref( &ProvideFilePolicy::progress ),
ref( policy_r ), _1 );
- callback::TempConnect<source::SourceReport> temp( dumb );
+ callback::TempConnect<source::RepoReport> temp( dumb );
Url url;
RepoInfo info = repo_r.info();
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.cc (from r5803, trunk/libzypp/zypp/source/SUSEMediaVerifier.cc)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/SUSEMediaVerifier.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.cc Thu Jun 21 12:09:24 2007
@@ -1,12 +1,12 @@
#include <fstream>
-#include "zypp/source/SUSEMediaVerifier.h"
+#include "zypp/repo/SUSEMediaVerifier.h"
using namespace std;
namespace zypp
{
-namespace source
+namespace repo
{
SUSEMediaVerifier::SUSEMediaVerifier(const std::string & vendor_r, const std::string & id_r, const media::MediaNr media_nr)
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.h (from r5803, trunk/libzypp/zypp/source/SUSEMediaVerifier.h)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/SUSEMediaVerifier.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/SUSEMediaVerifier.h Thu Jun 21 12:09:24 2007
@@ -7,7 +7,7 @@
namespace zypp
{
- namespace source
+ namespace repo
{
class SUSEMediaVerifier : public zypp::media::MediaVerifierBase
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc Thu Jun 21 12:09:24 2007
@@ -100,15 +100,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref AtomImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned AtomImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
virtual Repository repository() const;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc Thu Jun 21 12:09:24 2007
@@ -100,15 +100,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref MessageImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned MessageImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// MESSAGE
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc Thu Jun 21 12:09:24 2007
@@ -103,20 +103,6 @@
return Date();
}
-unsigned PackageImpl::repositoryMediaNr() const
-{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "repositoryMediaNr" );
-}
-
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref PackageImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned PackageImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h Thu Jun 21 12:09:24 2007
@@ -42,10 +42,7 @@
virtual bool installOnly() const;
virtual Date buildtime() const;
virtual Date installtime() const;
-
- virtual Source_Ref source() const;
- virtual unsigned mediaNr() const;
-
+
// PACKAGE
virtual CheckSum checksum() const;
virtual std::string buildhost() const;
@@ -68,9 +65,9 @@
virtual std::list<std::string> filenames() const;
/*virtual std::list<DeltaRpm> deltaRpms() const;
virtual std::list<PatchRpm> patchRpms() const;
- */
- virtual unsigned repositoryMediaNr() const;
-
+ */
+ virtual unsigned mediaNr() const;
+
virtual Repository repository() const;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc Thu Jun 21 12:09:24 2007
@@ -103,15 +103,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref PatchImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned PatchImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// PATCH
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc Thu Jun 21 12:09:24 2007
@@ -103,15 +103,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref PatternImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned PatternImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// PATTERN
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc Thu Jun 21 12:09:24 2007
@@ -100,15 +100,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref ProductImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned ProductImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// PRODUCT
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc Thu Jun 21 12:09:24 2007
@@ -100,15 +100,6 @@
return Date();
}
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref ScriptImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned ScriptImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// SCRIPT
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc Thu Jun 21 12:09:24 2007
@@ -30,18 +30,18 @@
/** Default ctor
*/
-SrcPackageImpl::SrcPackageImpl (Source_Ref source_r)
- : _source (source_r)
+SrcPackageImpl::SrcPackageImpl (Repository repo)
+ : _repository(repo)
, _install_only(false)
, _size_installed(0)
, _size_archive(0)
, _data_loaded(false)
{}
-Source_Ref
-SrcPackageImpl::source() const
+Repository
+SrcPackageImpl::repository() const
{
- return _source;
+ return _repository;
}
/** Package summary */
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.h Thu Jun 21 12:09:24 2007
@@ -11,7 +11,7 @@
#define CachedRepoSrcPackageImpl_H
#include "zypp/detail/PackageImpl.h"
-#include "zypp/Source.h"
+#include "zypp/Repository.h"
//#include <sqlite3.h>
///////////////////////////////////////////////////////////////////
@@ -29,7 +29,7 @@
{
public:
- SrcPackageImpl( Source_Ref source_r );
+ SrcPackageImpl( Repository repo );
virtual TranslatedText summary() const;
virtual TranslatedText description() const;
@@ -38,12 +38,10 @@
virtual ByteCount archivesize() const;
virtual Pathname location() const;
virtual bool installOnly() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
virtual Vendor vendor() const;
protected:
- Source_Ref _source;
TranslatedText _summary;
TranslatedText _description;
PackageGroup _group;
@@ -55,6 +53,7 @@
ByteCount _size_archive;
bool _data_loaded;
+ Repository repo;
};
/////////////////////////////////////////////////////////////////
} // ns cached
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.cc Thu Jun 21 12:09:24 2007
@@ -104,16 +104,6 @@
return _media_nr;
}
-
-//////////////////////////////////////////
-// DEPRECATED
-//////////////////////////////////////////
-
-Source_Ref MessageImpl::source() const
-{
- return Source_Ref::noSource;
-}
-
unsigned MessageImpl::mediaNr() const
{
return 1;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/MessageImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// MESSAGE
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h Thu Jun 21 12:09:24 2007
@@ -13,7 +13,6 @@
#define ZYPP_SOURCE_MEMORYPACKAGEIMPL_H
#include "zypp/detail/PackageImplIf.h"
-#include "zypp/Source.h"
#include "zypp/data/ResolvableData.h"
#include "zypp/DiskUsage.h"
#include "zypp/CheckSum.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ProductImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ProductImpl.h Thu Jun 21 12:09:24 2007
@@ -17,7 +17,6 @@
#include "zypp/CheckSum.h"
#include "zypp/CapSet.h"
#include "zypp/detail/ProductImplIf.h"
-#include "zypp/Source.h"
#include "zypp/data/ResolvableData.h"
#include "zypp/TranslatedText.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ScriptImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ScriptImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/ScriptImpl.h Thu Jun 21 12:09:24 2007
@@ -43,7 +43,6 @@
virtual Date buildtime() const;
virtual Date installtime() const;
- virtual Source_Ref source() const;
virtual unsigned mediaNr() const;
// SCRIPT
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.cc (from r5817, trunk/libzypp/zypp/source/plaindir/PlaindirImpl.cc)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/plaindir/PlaindirImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.cc Thu Jun 21 12:09:24 2007
@@ -10,7 +10,8 @@
#include <iostream>
#include "zypp/base/Logger.h"
-#include "zypp/source/plaindir/PlaindirImpl.h"
+#include "zypp/repo/plaindir/PlaindirImpl.h"
+#include "zypp/PathInfo.h"
using std::endl;
using namespace std;
@@ -19,7 +20,7 @@
namespace zypp
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
-namespace source
+namespace repo
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
namespace plaindir
@@ -38,33 +39,24 @@
void PlaindirImpl::factoryInit()
{
- if ( ! ( (url().getScheme() == "file") || (url().getScheme() == "dir") ) )
- {
- ZYPP_THROW( Exception( "Plaindir only supports local paths, scheme [" + url().getScheme() + "] is not local" ) );
- }
-
- MIL << "Plaindir source initialized." << std::endl;
- MIL << " Url : " << url() << std::endl;
- MIL << " Path : " << path() << std::endl;
}
-void PlaindirImpl::createResolvables(Source_Ref source_r)
+void PlaindirImpl::createResolvables(Repository repo)
{
- Pathname thePath = Pathname(url().getPathName()) + path();
- MIL << "Going to read dir " << thePath << std::endl;
-
- extract_packages_from_directory( _store, thePath, selfSourceRef(), true );
+// Pathname thePath = Pathname(url().getPathName()) + path();
+// MIL << "Going to read dir " << thePath << std::endl;
+//
+// extract_packages_from_directory( _store, thePath, selfRepository(), true );
}
-int PlaindirImpl::extract_packages_from_directory (ResStore & store, const Pathname & path, Source_Ref source, bool recursive)
+int PlaindirImpl::extract_packages_from_directory (ResStore & store, const Pathname & path, Repository repo, bool recursive)
{
using target::rpm::RpmHeader;
-
Pathname filename;
PathInfo magic;
bool distro_magic, pkginfo_magic;
- DBG << "extract_packages_from_directory(.., " << path << ", " << source.alias() << ", " << recursive << ")" << endl;
+// DBG << "extract_packages_from_directory(.., " << path << ", " << repo.info().alias() << ", " << recursive << ")" << endl;
/*
Check for magic files that indicate how to treat the
@@ -101,12 +93,12 @@
PathInfo file_info( file_path );
if (recursive && file_info.isDir()) {
- extract_packages_from_directory( store, file_path, source, recursive );
+ extract_packages_from_directory( store, file_path, repo, recursive );
} else if (file_info.isFile() && file_path.extension() == ".rpm" ) {
RpmHeader::constPtr header = RpmHeader::readPackage( file_path, RpmHeader::NOSIGNATURE );
#warning FIX creation of Package from src.rpm header
- Package::Ptr package = target::rpm::RpmDb::makePackageFromHeader( header, NULL, *it, source );
+ Package::Ptr package = target::rpm::RpmDb::makePackageFromHeader( header, NULL, *it, repo );
if (package != NULL) {
DBG << "Adding package " << *package << endl;
store.insert( package );
Copied: branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.h (from r5817, trunk/libzypp/zypp/source/plaindir/PlaindirImpl.h)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- trunk/libzypp/zypp/source/plaindir/PlaindirImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/PlaindirImpl.h Thu Jun 21 12:09:24 2007
@@ -6,24 +6,22 @@
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/source/plaindir/PlaindirImpl.h
- *
-*/
-#ifndef ZYPP_SOURCE_PLAINDIR_PLAINDIRIMPL_H
-#define ZYPP_SOURCE_PLAINDIR_PLAINDIRIMPL_H
+
+#ifndef ZYPP_REPO_PLAINDIR_PLAINDIRIMPL_H
+#define ZYPP_REPO_PLAINDIR_PLAINDIRIMPL_H
#include <iosfwd>
#include <zypp/target/rpm/RpmHeader.h>
#include <zypp/target/rpm/RpmDb.h>
-#include "zypp/source/SourceImpl.h"
+#include "zypp/repo/RepositoryImpl.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- namespace source
+ namespace repo
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
namespace plaindir
@@ -34,7 +32,7 @@
// CLASS NAME : PlaindirImpl
//
/** */
- class PlaindirImpl : public SourceImpl
+ class PlaindirImpl : public repo::RepositoryImpl
{
public:
typedef intrusive_ptr<PlaindirImpl> Ptr;
@@ -61,9 +59,9 @@
* \throw EXCEPTION on fail
*/
virtual void factoryInit();
- virtual void createResolvables(Source_Ref source_r);
+ virtual void createResolvables(Repository repo);
- int extract_packages_from_directory (ResStore & store, const Pathname & path, Source_Ref source, bool recursive);
+ int extract_packages_from_directory (ResStore & store, const Pathname & path, Repository repo, bool recursive);
};
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.cc Thu Jun 21 12:09:24 2007
@@ -192,9 +192,9 @@
//---------------------------------------------------------------------------
void
-Resolver::addSubscribedSource (Source_Ref source)
+Resolver::addSubscribedSource (Repository repo)
{
- _subscribed.insert(source);
+ _subscribed.insert(repo);
}
void
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Resolver.h Thu Jun 21 12:09:24 2007
@@ -123,7 +123,7 @@
ResolverContext_Ptr _establish_context;
bool _timed_out;
- std::set<Source_Ref> _subscribed;
+ std::set<Repository> _subscribed;
Arch _architecture;
@@ -176,7 +176,7 @@
ResPool pool (void) const;
void setPool (const ResPool & pool) { _pool = pool; }
- void addSubscribedSource (Source_Ref source);
+ void addSubscribedSource (Repository source);
void addPoolItemToInstall (PoolItem_Ref item);
void addPoolItemsToInstallFromList (PoolItemList & rl);
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.cc Thu Jun 21 12:09:24 2007
@@ -267,7 +267,7 @@
misc_info->setOtherPoolItem (otherItem);
if (NVRA(item.resolvable()) == NVRA(otherItem.resolvable())
&& status.isBySolver() && statusOtherItem.isBySolver()) {
- // If there has already been selected another item by the solver (e.g. from another source)
+ // If there has already been selected another item by the solver (e.g. from another repo)
// we will take that.
// Bug 224698
addInfo( misc_info );
@@ -302,7 +302,7 @@
priority = 0;
else {
#endif
- priority = getSourcePriority (item->source());
+ priority = getRepoPriority (item->repository());
// }
if (priority < _min_priority) _min_priority = priority;
@@ -350,7 +350,7 @@
misc_info->setOtherPoolItem (otherItem);
if (NVRA(item.resolvable()) == NVRA(otherItem.resolvable())
&& status.isBySolver() && statusOtherItem.isBySolver()) {
- // If there has already been selected another item by the solver (e.g. from another source)
+ // If there has already been selected another item by the solver (e.g. from another repo)
// we will take that.
// Bug 224698
addInfo( misc_info );
@@ -404,7 +404,7 @@
priority = 0;
else {
#endif
- priority = getSourcePriority (item->source());
+ priority = getRepoPriority (item->repository());
// }
if (priority < _min_priority) _min_priority = priority;
@@ -1751,11 +1751,13 @@
int
-ResolverContext::getSourcePriority (Source_Ref source) const
+ResolverContext::getRepoPriority (Repository repo) const
{
- if (source.subscribed())
- return source.priority();
- return source.priorityUnsubscribed();
+#warning fix repo priority
+ return 0;
+// if (repo.subscribed())
+// return repo.priority();
+// return repository.priorityUnsubscribed();
}
//---------------------------------------------------------------------------
@@ -1780,17 +1782,17 @@
void
ResolverContext::collectCompareInfo (int & cmpVersion, // Version compare of ACCUMULATED items
- int & cmpSource, // compare of Sources
+ int & cmpRepo, // compare of Repositories
ResolverContext_Ptr compareContext)
{
- Source_Ref userSource; // Source Id of items which have been selected by the user for installation
- // It is empty, if there are different sources
- bool differentUserSources = false;
- Source_Ref userSourceCompare; // Source Id of items which have been selected by the user for installation
- // It is empty, if there are different sources
- bool differentUserCompareSources = false;
- SourceCounter thisMap; // Map of to be installed sources with an item counter
- SourceCounter compareMap; // Map of to be installed sources with an item counter
+ Repository userRepo; // Repo Id of items which have been selected by the user for installation
+ // It is empty, if there are different repos
+ bool differentUserRepos = false;
+ Repository userRepoCompare; // Repo Id of items which have been selected by the user for installation
+ // It is empty, if there are different repos
+ bool differentUserCompareRepos = false;
+ RepositoryCounter thisMap; // Map of to be installed repositorys with an item counter
+ RepositoryCounter compareMap; // Map of to be installed repositorys with an item counter
PoolItemList installList = getMarked(1);
PoolItemList compareList = compareContext->getMarked(1);; // List of comparing items which has to be installed
@@ -1799,30 +1801,30 @@
for ( PoolItemList::const_iterator thisIt = installList.begin();
thisIt != installList.end(); thisIt++ )
{
- // evaluate, if the user selected packages (items) has the same source
+ // evaluate, if the user selected packages (items) has the same repository
ResStatus status = getStatus (*thisIt);
if (status.isByUser()
|| thisIt->status().isByUser())
{
- if (userSource == Source_Ref::noSource
- && !differentUserSources)
+ if (userRepo == Repository::noRepository
+ && !differentUserRepos)
{
- userSource = thisIt->resolvable()->source();
+ userRepo = thisIt->resolvable()->repository();
}
- else if (userSource != thisIt->resolvable()->source())
+ else if (userRepo != thisIt->resolvable()->repository())
{
- differentUserSources = true; // there are other items of other sources which have been set by the user
+ differentUserRepos = true; // there are other items of other repositorys which have been set by the user
}
}
// collecting relationship between channels and installed items
- if (thisMap.find (thisIt->resolvable()->source()) == thisMap.end()) {
- thisMap[thisIt->resolvable()->source()] = 1;
+ if (thisMap.find (thisIt->resolvable()->repository()) == thisMap.end()) {
+ thisMap[thisIt->resolvable()->repository()] = 1;
}
else {
- thisMap[thisIt->resolvable()->source()] += 1;
+ thisMap[thisIt->resolvable()->repository()] += 1;
}
- _XDEBUG ("Count of left " << thisIt->resolvable()->source() << ": " << thisMap[thisIt->resolvable()->source()] << " : " << *(thisIt->resolvable()));
+ _XDEBUG ("Count of left " << thisIt->resolvable()->repository() << ": " << thisMap[thisIt->resolvable()->repository()] << " : " << *(thisIt->resolvable()));
// Comparing versions
while (itCompare != compareList.end() )
@@ -1834,29 +1836,29 @@
// Testcase: freshen-tests/exercise-7f-test
// Testcase: freshen-tests/exercise-7-test
cmpVersion += thisIt->resolvable()->edition().compare( itCompare->resolvable()->edition());
- _XDEBUG ("Version: " << *(thisIt->resolvable()) << "[" << thisIt->resolvable()->source() << "]" << endl
+ _XDEBUG ("Version: " << *(thisIt->resolvable()) << "[" << thisIt->resolvable()->repository() << "]" << endl
<< " <--> " << endl
- << "Version: " << *(itCompare->resolvable()) << "[" << itCompare->resolvable()->source() << "]"
+ << "Version: " << *(itCompare->resolvable()) << "[" << itCompare->resolvable()->repository() << "]"
<< " --> cmpVersion : " << cmpVersion);
- // evaluate if the user selected packages (items) has the same source
- ResObject::constPtr sourceItem = itCompare->resolvable();
+ // evaluate if the user selected packages (items) has the same repository
+ ResObject::constPtr repositoryItem = itCompare->resolvable();
ResStatus compStatus = compareContext->getStatus(*itCompare);
if (compStatus.isByUser()
|| itCompare->status().isByUser())
{
- if (userSourceCompare == Source_Ref::noSource
- && !differentUserCompareSources)
- userSourceCompare = sourceItem->source();
- else if (userSourceCompare != sourceItem->source())
- differentUserCompareSources = true; // there are other items of other sources which have been set by the user
+ if (userRepoCompare == Repository::noRepository
+ && !differentUserCompareRepos)
+ userRepoCompare = repositoryItem->repository();
+ else if (userRepoCompare != repositoryItem->repository())
+ differentUserCompareRepos = true; // there are other items of other repositorys which have been set by the user
}
// collecting relationship between channels and installed items
- if (compareMap.find (sourceItem->source()) == compareMap.end())
- compareMap[sourceItem->source()] = 1;
+ if (compareMap.find (repositoryItem->repository()) == compareMap.end())
+ compareMap[repositoryItem->repository()] = 1;
else
- compareMap[sourceItem->source()] += 1;
- _XDEBUG ("Count of right " << sourceItem->source() << ": " << compareMap[sourceItem->source()] << " : " << *(itCompare->resolvable()));
+ compareMap[repositoryItem->repository()] += 1;
+ _XDEBUG ("Count of right " << repositoryItem->repository() << ": " << compareMap[repositoryItem->repository()] << " : " << *(itCompare->resolvable()));
itCompare++;
} else if (cmp > 0 )
itCompare++;
@@ -1867,66 +1869,66 @@
// comparing the rest of the other install list
while (itCompare != compareList.end() )
{
- // evaluate if the user selected packages (items) has the same source
- ResObject::constPtr sourceItem = itCompare->resolvable();
+ // evaluate if the user selected packages (items) has the same repository
+ ResObject::constPtr repositoryItem = itCompare->resolvable();
ResStatus compStatus = compareContext->getStatus(*itCompare);
if (compStatus.isByUser()
|| itCompare->status().isByUser())
{
- if (userSourceCompare == Source_Ref::noSource
- && !differentUserCompareSources)
- userSourceCompare = sourceItem->source();
- else if (userSourceCompare != sourceItem->source())
- differentUserCompareSources = true; // there are other items of other sources which have been set by the user
+ if (userRepoCompare == Repository::noRepository
+ && !differentUserCompareRepos)
+ userRepoCompare = repositoryItem->repository();
+ else if (userRepoCompare != repositoryItem->repository())
+ differentUserCompareRepos = true; // there are other items of other repositorys which have been set by the user
}
// collecting relationship between channels and installed items
- if (compareMap.find (sourceItem->source()) == compareMap.end())
- compareMap[sourceItem->source()] = 1;
+ if (compareMap.find (repositoryItem->repository()) == compareMap.end())
+ compareMap[repositoryItem->repository()] = 1;
else
- compareMap[sourceItem->source()] += 1;
- _XDEBUG ("Count of right" << sourceItem->source() << ": " << compareMap[sourceItem->source()] << " : "
+ compareMap[repositoryItem->repository()] += 1;
+ _XDEBUG ("Count of right" << repositoryItem->repository() << ": " << compareMap[repositoryItem->repository()] << " : "
<< *(itCompare->resolvable()));
itCompare++;
}
- // evaluate cmpSource
- cmpSource = 0;
+ // evaluate cmpRepo
+ cmpRepo = 0;
int cmpCompare = 0;
- if (!differentUserSources)
+ if (!differentUserRepos)
{
// user selected items which has to be installed has only one channel;
- // cmpSource = number of items of that channel
- cmpSource = thisMap[userSource];
+ // cmpRepo = number of items of that channel
+ cmpRepo = thisMap[userRepo];
}
- if (!differentUserCompareSources) {
+ if (!differentUserCompareRepos) {
// user selected items which has to be installed has only one channel;
// cmpCompare = number of items of that channel
- cmpCompare = compareMap[userSourceCompare];
+ cmpCompare = compareMap[userRepoCompare];
}
- _XDEBUG ("cmpSource = " << cmpSource << " ; cmpCompare = " << cmpCompare << " ; sizeof compareMap:" << compareMap.size());
+ _XDEBUG ("cmpRepo = " << cmpRepo << " ; cmpCompare = " << cmpCompare << " ; sizeof compareMap:" << compareMap.size());
if (compareMap.size() == 1
&& thisMap.size() == 1
- && userSource == userSourceCompare) {
- // We have only one source from which all items will be instaled.
+ && userRepo == userRepoCompare) {
+ // We have only one repository from which all items will be instaled.
// So we will regards the complete amount of installed/updated packages
// Testcase basic-exercises/exercise-14-test
- cmpSource = 0;
+ cmpRepo = 0;
} else {
// The solutions has different channels with user selected items.
// Take the solution with the greater account of items in this channel
// Testcase basic-exercises/exercise-solution-order-test
- cmpSource = cmpSource - cmpCompare;
+ cmpRepo = cmpRepo - cmpCompare;
}
- if (cmpSource == 0)
+ if (cmpRepo == 0)
{
// less amount of channels are better
- cmpSource = compareMap.size() - thisMap.size();
+ cmpRepo = compareMap.size() - thisMap.size();
}
- _XDEBUG ("End comparing two solutions-------- Version compare: " << cmpVersion << " Source compare: "<< cmpSource);
+ _XDEBUG ("End comparing two solutions-------- Version compare: " << cmpVersion << " Repo compare: "<< cmpRepo);
}
int
@@ -1937,16 +1939,16 @@
// collecting all data for comparing both resultion results
int cmpVersion = 0; // Version compare of ACCUMULATED items
- int cmpSource = 0; // compare of Sources
+ int cmpRepo = 0; // compare of Repos
- collectCompareInfo (cmpVersion, cmpSource, context);
+ collectCompareInfo (cmpVersion, cmpRepo, context);
if (_preferHighestVersion) {
// comparing versions
cmp = cmpVersion;
DBG << "Comparing versions returned :" << cmp << endl;
if (cmp == 0) {
// High numbers are good... we don't want solutions containing low-priority channels.
- // Source priority which has been set externally
+ // Repo priority which has been set externally
cmp = num_cmp (_min_priority, context->_min_priority);
DBG << "Comparing priority returned :" << cmp << endl;
if (cmp == 0) {
@@ -1954,9 +1956,9 @@
cmp = rev_num_cmp (churn_factor (this), churn_factor (context));
DBG << "Comparing churn_factor returned :" << cmp << endl;
if (cmp == 0) {
- // Comparing sources regarding the items which has to be installed
- cmp = cmpSource;
- DBG << "Comparing sources returned :" << cmp << endl;
+ // Comparing repositorys regarding the items which has to be installed
+ cmp = cmpRepo;
+ DBG << "Comparing repositorys returned :" << cmp << endl;
if (cmp == 0) {
// High numbers are bad. Bigger #s means more penalties.
cmp = rev_num_cmp (_other_penalties, context->_other_penalties);
@@ -1972,16 +1974,16 @@
DBG << "Comparing churn_factor returned :" << cmp << endl;
if (cmp == 0) {
// High numbers are good... we don't want solutions containing low-priority channels.
- // Source priority which has been set externally
+ // Repo priority which has been set externally
cmp = num_cmp (_min_priority, context->_min_priority);
DBG << "Comparing priority returned :" << cmp << endl;
if (cmp == 0) {
cmp = cmpVersion;
DBG << "Comparing versions returned :" << cmp << endl;
if (cmp == 0) {
- // Comparing sources regarding the items which has to be installed
- cmp = cmpSource;
- DBG << "Comparing sources returned :" << cmp << endl;
+ // Comparing repositorys regarding the items which has to be installed
+ cmp = cmpRepo;
+ DBG << "Comparing repositorys returned :" << cmp << endl;
if (cmp == 0) {
// High numbers are bad. Bigger #s means more penalties.
cmp = rev_num_cmp (_other_penalties, context->_other_penalties);
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverContext.h Thu Jun 21 12:09:24 2007
@@ -29,7 +29,7 @@
#include "zypp/ResPool.h"
#include "zypp/PoolItem.h"
#include "zypp/Capability.h"
-#include "zypp/Source.h"
+#include "zypp/Repository.h"
#include "zypp/solver/detail/Types.h"
#include "zypp/solver/detail/ResolverInfo.h"
@@ -48,7 +48,7 @@
typedef void (*MarkedPoolItemFn) (PoolItem_Ref item, const ResStatus & status, void *data);
typedef void (*MarkedPoolItemPairFn) (PoolItem_Ref item1, const ResStatus & status1, PoolItem_Ref item2, const ResStatus & status2, void *data);
typedef std::multimap<PoolItem_Ref,Capability> IgnoreMap;
-typedef std::map<Source_Ref ,int> SourceCounter;
+typedef std::map<Repository ,int> RepositoryCounter;
///////////////////////////////////////////////////////////////////
//
@@ -319,7 +319,7 @@
void spew (void);
void spewInfo (void) const;
- int getSourcePriority (Source_Ref source) const;
+ int getRepoPriority (Repository source) const;
};
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverInfo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverInfo.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverInfo.cc Thu Jun 21 12:09:24 2007
@@ -23,7 +23,7 @@
#include <sstream>
#include "zypp/solver/detail/ResolverInfo.h"
-#include "zypp/Source.h"
+#include "zypp/Repository.h"
#include "zypp/Capability.h"
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
@@ -149,13 +149,13 @@
if (item->arch() != "") {
os << '.' << item->arch();
}
- Source_Ref s = item->source();
+ Repository s = item->repository();
if (s) {
- string alias = s.alias();
+ string alias = s.info().alias();
if (!alias.empty()
&& alias != "@system")
{
- os << '[' << s.alias() << ']';
+ os << '[' << s.info().alias() << ']';
}
}
return os.str();
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverQueue.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverQueue.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/ResolverQueue.cc Thu Jun 21 12:09:24 2007
@@ -319,10 +319,10 @@
QueueItemInstall_Ptr install_qitem = dynamic_pointer_cast<QueueItemInstall>(new_qitem);
/* Penalties are negative priorities */
- int penalty;
- Source_Ref src = install_qitem->item()->source();
- penalty = - src.priority();
-
+#warning FIX priorities
+ int penalty = 0;
+ Repository repo = install_qitem->item()->repository();
+ //penalty = - src.priority();
install_qitem->setOtherPenalty (penalty);
}
@@ -375,12 +375,12 @@
if (qitem->isInstall() && qitem2->isInstall()) {
PoolItem_Ref r = (dynamic_pointer_cast<QueueItemInstall>(qitem))->item();
PoolItem_Ref r2 = (dynamic_pointer_cast<QueueItemInstall>(qitem2))->item();
- Source_Ref source = r->source();
- Source_Ref source2 = r2->source();
+ Repository repo1 = r->repository();
+ Repository repo2 = r2->repository();
int priority, priority2;
- priority = _context->getSourcePriority( source );
- priority2 = _context->getSourcePriority( source2 );
+ priority = _context->getRepoPriority( repo1 );
+ priority2 = _context->getRepoPriority( repo2 );
if (priority != priority2 && r->name() == r2->name()) {
if (r->edition().compare(r2->edition()) == 0
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.cc Thu Jun 21 12:09:24 2007
@@ -222,7 +222,7 @@
zypp::base::LogControl::instance().logfile( "/var/log/YaST2/y2log" );
ResPool pool = resolver.pool();
- SourceTable sourceTable;
+ RepositoryTable repoTable;
PoolItemList items_to_install;
PoolItemList items_to_remove;
HelixResolvable system (dumpPath + "/solver-system.xml");
@@ -235,15 +235,15 @@
// system channel
system.addResolvable (res);
} else {
- // source channels
- ResObject::constPtr sourceItem = it->resolvable();
- Source_Ref source = sourceItem->source();
- if (sourceTable.find (source) == sourceTable.end()) {
- sourceTable[source] = new HelixResolvable(dumpPath + "/"
- + numstring(source.numericId())
+ // repo channels
+ ResObject::constPtr repoItem = it->resolvable();
+ Repository repo = repoItem->repository();
+ if (repoTable.find (repo) == repoTable.end()) {
+ repoTable[repo] = new HelixResolvable(dumpPath + "/"
+ + numstring(repo.numericId())
+ "-package.xml");
}
- sourceTable[source]->addResolvable (res);
+ repoTable[repo]->addResolvable (res);
}
if ( it->status().isToBeInstalled()
@@ -259,7 +259,7 @@
// writing control file "*-test.xml"
HelixControl control (dumpPath + "/solver-test.xml",
- sourceTable,
+ repoTable,
resolver.architecture());
for (PoolItemList::const_iterator iter = items_to_install.begin(); iter != items_to_install.end(); iter++) {
@@ -300,7 +300,7 @@
//---------------------------------------------------------------------------
HelixControl::HelixControl(const std::string & controlPath,
- const SourceTable & sourceTable,
+ const RepositoryTable & repoTable,
const Arch & systemArchitecture,
const std::string & systemPath)
:dumpFile (controlPath)
@@ -315,11 +315,11 @@
<< "<test>" << endl
<< "<setup arch=\"" << systemArchitecture << "\">" << endl
<< TAB << "<system file=\"" << systemPath << "\"/>" << endl;
- for ( SourceTable::const_iterator it = sourceTable.begin();
- it != sourceTable.end(); ++it ) {
- Source_Ref source = it->first;
- *file << TAB << "<channel file=\"" << numstring(source.numericId())
- << "-package.xml\" name=\"" << numstring(source.numericId())
+ for ( RepositoryTable::const_iterator it = repoTable.begin();
+ it != repoTable.end(); ++it ) {
+ Repository repo = it->first;
+ *file << TAB << "<channel file=\"" << numstring(repo.numericId())
+ << "-package.xml\" name=\"" << numstring(repo.numericId())
<< "\" />" << endl;
}
*file << "</setup>" << endl
@@ -343,8 +343,8 @@
void HelixControl::installResolvable(const ResObject::constPtr &resObject)
{
- Source_Ref source = resObject->source();
- *file << "<install channel=\"" << numstring(source.numericId()) << "\" kind=\"" << toLower (resObject->kind().asString()) << "\""
+ Repository repo = resObject->repository();
+ *file << "<install channel=\"" << numstring(repo.numericId()) << "\" kind=\"" << toLower (resObject->kind().asString()) << "\""
<< " name=\"" << resObject->name() << "\"" << " arch=\"" << resObject->arch().asString() << "\""
<< " version=\"" << resObject->edition().version() << "\"" << " release=\"" << resObject->edition().release() << "\""
<< " edition=\"" << resObject->edition().asString() << "\"" << "/>" << endl;
@@ -352,7 +352,7 @@
void HelixControl::deleteResolvable(const ResObject::constPtr &resObject)
{
- Source_Ref source = resObject->source();
+ Repository repo = resObject->repository();
*file << "<uninstall " << " kind=\"" << toLower (resObject->kind().asString()) << "\""
<< " name=\"" << resObject->name() << "\"" << "/>" << endl;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/solver/detail/Testcase.h Thu Jun 21 12:09:24 2007
@@ -76,7 +76,7 @@
};
DEFINE_PTR_TYPE(HelixResolvable);
-typedef std::map<Source_Ref, HelixResolvable_Ptr> SourceTable;
+typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
///////////////////////////////////////////////////////////////////
//
@@ -93,7 +93,7 @@
public:
HelixControl (const std::string & controlPath,
- const SourceTable & sourceTable,
+ const RepositoryTable & sourceTable,
const Arch & systemArchitecture,
const std::string & systemPath = "solver-system.xml");
HelixControl ();
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.cc Thu Jun 21 12:09:24 2007
@@ -13,7 +13,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/Exception.h"
-
+#include "zypp/PathInfo.h"
#include "zypp/target/CommitPackageCacheReadAhead.h"
using std::endl;
@@ -33,8 +33,8 @@
std::ostream & operator<<( std::ostream & str, const IMediaKey & obj )
{
- return str << "[S" << obj._source.numericId() << ":" << obj._mediaNr << "]"
- << " " << obj._source.alias();
+ return str << "[S" << obj._repository.numericId() << ":" << obj._mediaNr << "]"
+ << " " << obj._repository.info().alias();
}
///////////////////////////////////////////////////////////////////
@@ -64,10 +64,12 @@
//
bool CommitPackageCacheReadAhead::onInteractiveMedia( const PoolItem & pi ) const
{
- if ( pi->sourceMediaNr() == 0 ) // no media access at all
+ if ( pi->mediaNr() == 0 ) // no media access at all
return false;
- std::string scheme( pi->source().url().getScheme() );
- return ( scheme == "dvd" || scheme == "cd" );
+ //std::string scheme( pi->source().url().getScheme() );
+ //return ( scheme == "dvd" || scheme == "cd" );
+#warning "FIX CommitPackageCacheReadAhead::onInteractiveMedia"
+ return false;
}
///////////////////////////////////////////////////////////////////
@@ -158,8 +160,8 @@
// copy it to the cachedir
std::string destName( str::form( "S%lu_%u_%s",
- it->first->source().numericId(),
- it->first->sourceMediaNr(),
+ it->first->repository().numericId(),
+ it->first->mediaNr(),
fromSource.value().basename().c_str() ) );
ManagedFile fileInCache( _cacheDir->path() / destName,
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/CommitPackageCacheReadAhead.h Thu Jun 21 12:09:24 2007
@@ -18,7 +18,7 @@
#include "zypp/base/Exception.h"
#include "zypp/base/DefaultIntegral.h"
-#include "zypp/Source.h"
+#include "zypp/Repository.h"
#include "zypp/TmpPath.h"
#include "zypp/target/CommitPackageCacheImpl.h"
@@ -41,29 +41,29 @@
explicit
IMediaKey( const ResObject::constPtr & obj_r )
- : _source( obj_r->source() )
- , _mediaNr( obj_r->sourceMediaNr() )
+ : _repository( obj_r->repository() )
+ , _mediaNr( obj_r->mediaNr() )
{}
- IMediaKey( const Source_Ref & source_r, unsigned mediaNr_r )
- : _source( source_r )
+ IMediaKey( const Repository & repo, unsigned mediaNr_r )
+ : _repository( repo )
, _mediaNr( mediaNr_r )
{}
bool operator==( const IMediaKey & rhs ) const
- { return( _source == rhs._source && _mediaNr == rhs._mediaNr ); }
+ { return( _repository == rhs._repository && _mediaNr == rhs._mediaNr ); }
bool operator!=( const IMediaKey & rhs ) const
{ return ! operator==( rhs ); }
bool operator<( const IMediaKey & rhs ) const
{
- return( _source.numericId() < rhs._source.numericId()
- || ( _source.numericId() == rhs._source.numericId()
+ return( _repository.numericId() < rhs._repository.numericId()
+ || ( _repository.numericId() == rhs._repository.numericId()
&& _mediaNr < rhs._mediaNr ) );
}
- Source_Ref _source;
+ Repository _repository;
DefaultIntegral<unsigned,0> _mediaNr;
};
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/TargetImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/TargetImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/TargetImpl.cc Thu Jun 21 12:09:24 2007
@@ -19,6 +19,8 @@
#include "zypp/base/Exception.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/Gettext.h"
+#include "zypp/base/UserRequestException.h"
+
#include "zypp/PoolItem.h"
#include "zypp/Resolvable.h"
#include "zypp/ResObject.h"
@@ -27,7 +29,6 @@
#include "zypp/Selection.h"
#include "zypp/Script.h"
#include "zypp/Message.h"
-#include "zypp/Source.h"
#include "zypp/Url.h"
#include "zypp/CapMatchHelper.h"
@@ -41,12 +42,8 @@
#include "zypp/pool/GetResolvablesToInsDel.h"
#include "zypp/solver/detail/Helper.h"
-#ifdef ZYPP_REFACTORING
#include "zypp/repo/DeltaCandidates.h"
#include "zypp/repo/PackageProvider.h"
-#else
-#include "zypp/source/PackageProvider.h"
-#endif
using namespace std;
using namespace zypp;
@@ -226,26 +223,19 @@
/** Let the Source provide the package.
*/
- static ManagedFile sourceProvidePackage( const PoolItem & pi )
+ static ManagedFile repoProvidePackage( const PoolItem & pi )
{
// Redirect PackageProvider queries for installed editions
// (in case of patch/delta rpm processing) to rpmDb.
-#ifdef ZYPP_REFACTORING
repo::PackageProviderPolicy packageProviderPolicy;
-#else
- source::PackageProviderPolicy packageProviderPolicy;
-#endif
packageProviderPolicy.queryInstalledCB( QueryInstalledEditionHelper() );
Package::constPtr p = asKind<Package>(pi.resolvable());
-#ifdef ZYPP_REFACTORING
+
// FIXME no repo list
- std::set<Repository> repos;
+ std::list<Repository> repos;
repo::DeltaCandidates deltas(repos);
repo::PackageProvider pkgProvider( p, deltas, packageProviderPolicy );
-#else
- source::PackageProvider pkgProvider( p, packageProviderPolicy );
-#endif
return pkgProvider.providePackage();
}
@@ -432,7 +422,7 @@
ResObject::constPtr res( it->resolvable() );
if ( hitUnwantedMedia
- || ( res->sourceMediaNr() && res->sourceMediaNr() != policy_r.restrictToMedia() ) )
+ || ( res->mediaNr() && res->mediaNr() != policy_r.restrictToMedia() ) )
{
hitUnwantedMedia = true;
result._remaining.push_back( *it );
@@ -450,9 +440,9 @@
{
Resolvable::constPtr res( it->resolvable() );
Package::constPtr pkg( asKind<Package>(res) );
- if (pkg && policy_r.restrictToMedia() != pkg->sourceMediaNr()) // check medianr for packages only
+ if (pkg && policy_r.restrictToMedia() != pkg->mediaNr()) // check medianr for packages only
{
- XXX << "Package " << *pkg << ", wrong media " << pkg->sourceMediaNr() << endl;
+ XXX << "Package " << *pkg << ", wrong media " << pkg->mediaNr() << endl;
result._srcremaining.push_back( *it );
}
else
@@ -482,11 +472,11 @@
bool abort = false;
// remember the last used source (if any)
- Source_Ref lastUsedSource;
+ Repository lastUsedRepo;
// prepare the package cache.
CommitPackageCache packageCache( items_r.begin(), items_r.end(),
- root() / "tmp", sourceProvidePackage );
+ root() / "tmp", repoProvidePackage );
for (TargetImpl::PoolItemList::const_iterator it = items_r.begin(); it != items_r.end(); it++)
{
@@ -500,14 +490,14 @@
{
localfile = packageCache.get( it );
}
- catch ( const source::SkipRequestedException & e )
+ catch ( const SkipRequestException &e )
{
ZYPP_CAUGHT( e );
WAR << "Skipping package " << p << " in commit" << endl;
continue;
}
- lastUsedSource = p->source(); // remember the package source
+ lastUsedRepo = p->repository(); // remember the package source
#warning Exception handling
// create a installation progress report proxy
@@ -718,9 +708,9 @@
// In the case of 'commit any media', end of commit means we're completely
// done and don't need the source's media anyways.
- if (lastUsedSource)
+ if (lastUsedRepo)
{ // if a source was used
- lastUsedSource.release(); // release their medias
+ //lastUsedRepo.release(); // release their medias
}
if ( abort )
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc Thu Jun 21 12:09:24 2007
@@ -1109,7 +1109,9 @@
// make Package::Ptr from RpmHeader
// return NULL on error
//
-Package::Ptr RpmDb::makePackageFromHeader( const RpmHeader::constPtr header, set<string> * filerequires, const Pathname & location, Source_Ref source )
+Package::Ptr RpmDb::makePackageFromHeader( const RpmHeader::constPtr header,
+ set<string> * filerequires,
+ const Pathname & location, Repository repo )
{
if ( ! header )
return 0;
@@ -1127,7 +1129,7 @@
// create dataprovider
detail::ResImplTraits<RPMPackageImpl>::Ptr impl( new RPMPackageImpl( header ) );
- impl->setSource( source );
+ impl->setRepository( repo );
if (!location.empty())
impl->setLocation( location );
@@ -1248,7 +1250,7 @@
continue;
}
- Package::Ptr pptr = makePackageFromHeader( *iter, &_filerequires, location, Source_Ref() );
+ Package::Ptr pptr = makePackageFromHeader( *iter, &_filerequires, location, Repository() );
if ( ! pptr )
{
WAR << "Failed to make package from database header '" << name << "'" << endl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.h Thu Jun 21 12:09:24 2007
@@ -24,7 +24,6 @@
#include "zypp/ExternalProgram.h"
#include "zypp/Package.h"
-#include "zypp/Source.h"
#include "zypp/KeyRing.h"
#include "zypp/target/rpm/RpmHeader.h"
@@ -340,7 +339,9 @@
* return NULL on error
**/
- static Package::Ptr makePackageFromHeader( const RpmHeader::constPtr header, std::set<std::string> * filerequires, const Pathname & location, Source_Ref source );
+ static Package::Ptr makePackageFromHeader( const RpmHeader::constPtr header,
+ std::set<std::string> * filerequires,
+ const Pathname & location, Repository repo );
///////////////////////////////////////////////////////////////////
//
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc Thu Jun 21 12:09:24 2007
@@ -212,9 +212,9 @@
}
/** */
-Source_Ref RPMPackageImpl::source() const
+Repository RPMPackageImpl::repository() const
{
- return _source;
+ return _repository;
}
} // namespace rpm
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h Thu Jun 21 12:09:24 2007
@@ -13,7 +13,6 @@
#define ZYPP_TARGET_RPM_RPMPACKAGEIMPL_H
#include "zypp/detail/PackageImplIf.h"
-#include "zypp/Source.h"
#include "zypp/Changelog.h"
#include "zypp/target/rpm/RpmHeader.h"
@@ -91,16 +90,16 @@
/** */
virtual DiskUsage diskUsage() const;
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
/** for 'local' RPMs */
void setLocation (const Pathname & pathname)
{
_location = pathname;
}
- void setSource (Source_Ref source)
+ void setRepository (Repository repo)
{
- _source = source;
+ _repository = repo;
}
protected:
@@ -121,7 +120,7 @@
DiskUsage _disk_usage;
ByteCount _size;
ByteCount _archivesize;
- Source_Ref _source;
+ Repository _repository;
};
///////////////////////////////////////////////////////////////////
} // namespace rpm
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/Backend.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/Backend.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/Backend.h Thu Jun 21 12:09:24 2007
@@ -99,22 +99,6 @@
virtual std::set<std::string> flags( const std::string &key ) const = 0;
virtual bool hasFlag( const std::string &key, const std::string &flag ) const = 0;
- /////////////////////////////////////////////////////////
- // SOURCES API
- ////////////////////////////////////////////////////////
- /**
- * Query for installed Sources
- */
- virtual source::SourceInfoList storedSources() const = 0;
- /**
- * Query for installed Sources
- */
- virtual void storeSource(const source::SourceInfo &data) = 0;
- /**
- * Query for installed Sources
- */
- virtual void deleteSource(const std::string &alias) = 0;
-
private:
/** Pointer to implementation */
class Private;
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.cc Thu Jun 21 12:09:24 2007
@@ -165,28 +165,6 @@
return d->backend->hasFlag(key, flag);
}
-/////////////////////////////////////////////////////////
-// SOURCES API
-////////////////////////////////////////////////////////
-
-source::SourceInfoList
-PersistentStorage::storedSources() const
-{
- return d->backend->storedSources();
-}
-
-void
-PersistentStorage::storeSource(const source::SourceInfo &data)
-{
- d->backend->storeSource(data);
-}
-
-void
-PersistentStorage::deleteSource(const std::string &alias)
-{
- d->backend->deleteSource(alias);
-}
-
/******************************************************************
**
** FUNCTION NAME : operator<<
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/PersistentStorage.h Thu Jun 21 12:09:24 2007
@@ -21,9 +21,6 @@
#include <zypp/Url.h>
#include <zypp/Date.h>
#include <zypp/Patch.h>
-#include <zypp/source/SourceInfo.h>
-
-using namespace zypp::source;
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -116,22 +113,6 @@
std::set<std::string> flags( const std::string &key ) const;
bool hasFlag( const std::string &key, const std::string &flag ) const;
- /////////////////////////////////////////////////////////
- // SOURCES API
- ////////////////////////////////////////////////////////
- /**
- * Query for installed Sources
- */
- std::list<SourceInfo> storedSources() const;
- /**
- * Add a new installed source
- */
- void storeSource(const SourceInfo &data);
- /**
- * Delete an installed source
- */
- void deleteSource(const std::string &alias);
-
private:
class Private;
shared_ptr<Private> d;
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.cc Thu Jun 21 12:09:24 2007
@@ -17,11 +17,9 @@
#include "zypp/base/Logger.h"
#include "zypp/base/Exception.h"
#include "zypp/base/Random.h"
-
+#include "zypp/base/Gettext.h"
#include "zypp/CapFactory.h"
#include "zypp/Digest.h"
-#include "zypp/Source.h"
-#include "zypp/SourceManager.h"
#include "zypp/ExternalProgram.h"
#include "zypp/target/store/xml/XMLPatchImpl.h"
@@ -49,8 +47,6 @@
#include <zypp/ZYpp.h>
#include <zypp/PathInfo.h>
-#include "zypp/parser/xmlstore/XMLSourceCacheParser.h"
-
#include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp
#include "boost/filesystem/fstream.hpp" // ditto
@@ -1343,93 +1339,6 @@
return str;
}
-/////////////////////////////////////////////////////////
-// SOURCES API
-////////////////////////////////////////////////////////
-
-source::SourceInfoList
-XMLFilesBackend::storedSources() const
-{
- path source_p = path(d->root.asString()) / path(ZYPP_DB_DIR) / path ("sources");
- source::SourceInfoList sources;
- DBG << "Reading source cache in " << source_p.string() << std::endl;
- directory_iterator end_iter;
- // return empty list if the dir does not exist
- if ( !exists( source_p ) )
- {
- ERR << "path " << source_p.string() << " does not exists. Required to read source cache " << std::endl;
- return source::SourceInfoList();
- }
-
- for ( directory_iterator dir_itr( source_p ); dir_itr != end_iter; ++dir_itr )
- {
- DBG << "[source-list] - " << dir_itr->leaf() << std::endl;
- //sources.insert( sourceDataFromCacheFile( source_p + "/" + dir_itr->leaf() ) );
- std::string full_path = (source_p / dir_itr->leaf()).string();
- std::ifstream anIstream(full_path.c_str());
- zypp::parser::xmlstore::XMLSourceCacheParser iter(anIstream, "");
- for (; ! iter.atEnd(); ++iter) {
- source::SourceInfo data = **iter;
- sources.push_back(data);
- }
- }
- MIL << "done reading source cache" << std::endl;
- return sources;
-
-}
-
-void
-XMLFilesBackend::storeSource(const source::SourceInfo &data)
-{
- // serialize and save a file
- std::string xml = toXML(data);
- path source_p = path(d->root.asString()) / path(ZYPP_DB_DIR) / path ("sources");
-
- // generate a filename
- if (data.alias().size() == 0)
- {
- ZYPP_THROW(Exception("Cant save source with empty alias"));
- }
-
- //DBG << std::endl << xml << std::endl;
- std::ofstream file;
- //DBG << filename << std::endl;
- try
- {
- std::stringstream message_stream(data.alias());
- std::string full_path = (source_p / Digest::digest("MD5", message_stream)).string();
-
- file.open(full_path.c_str());
- file << xml;
- file.close();
- }
- catch ( std::exception &e )
- {
- ERR << "Error saving source " << data.alias() << " in the cache" << std::endl;
- ZYPP_THROW(Exception(e.what()));
- }
- updateTimestamp();
-}
-
-void
-XMLFilesBackend::deleteSource(const std::string &alias)
-{
- // just delete the files
- path source_p = path(d->root.asString()) / path(ZYPP_DB_DIR) / path ("sources");
- try
- {
- std::stringstream message_stream(alias);
- std::string full_path = (source_p / Digest::digest("MD5", message_stream)).string();
- remove(full_path);
- }
- catch ( std::exception &e )
- {
- ERR << "Error deleting source " << alias << " in the cache" << std::endl;
- ZYPP_THROW(Exception(e.what()));
- }
- updateTimestamp();
-}
-
/////////////////////////////////////////////////////////////////
} // namespace storage
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/XMLFilesBackend.h Thu Jun 21 12:09:24 2007
@@ -116,23 +116,6 @@
std::set<std::string> flagsFromFile( const std::string &filename ) const;
void updateTimestamp() const;
- /////////////////////////////////////////////////////////
- // SOURCES API
- ////////////////////////////////////////////////////////
- public:
- /**
- * Query for installed Sources
- */
- virtual source::SourceInfoList storedSources() const;
- /**
- * Query for installed Sources
- */
- virtual void storeSource(const source::SourceInfo &data);
- /**
- * Query for installed Sources
- */
- virtual void deleteSource(const std::string &alias);
-
protected:
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.cc Thu Jun 21 12:09:24 2007
@@ -17,7 +17,6 @@
#include "zypp/base/Logger.h"
#include "zypp/CapFactory.h"
-#include "zypp/Source.h"
#include "zypp/Url.h"
#include "zypp/ResObject.h"
@@ -350,7 +349,7 @@
out << " <distribution-name>" << xml_escape(obj->distributionName()) << "</distribution-name>" << endl;
out << " <distribution-edition>" << xml_escape(obj->distributionEdition().asString()) << "</distribution-edition>" << endl;
- out << " <source>" << xml_escape(obj->source().alias()) << "</source>" << endl;
+ out << " <source>" << xml_escape(obj->repository().info().alias()) << "</source>" << endl;
out << " <release-notes-url>" << xml_escape(obj->releaseNotesUrl().asString()) << "</release-notes-url>" << endl;
out << " <update-urls>" << endl;
@@ -459,23 +458,6 @@
return out.str();
}
-template<>
-string toXML( const source::SourceInfo &obj )
-{
- stringstream out;
- out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- out << "<source version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << endl;
- out << " <enabled>" << obj.enabled() << "</enabled>" << endl;
- out << " <auto-refresh>" << obj.autorefresh() << "</auto-refresh>" << endl;
- out << " <product-dir>" << obj.path() << "</product-dir>" << endl;
- out << " <cache-dir>" << obj.cacheDir() << "</cache-dir>" << endl;
- out << " <type>" << xml_escape(obj.type()) << "</type>" << endl;
- out << " <url>" << xml_escape(obj.url().asCompleteString()) << "</url>" << endl;
- out << " <alias>" << xml_escape(obj.alias()) << "</alias>" << endl;
- out << "</source>" << endl;
- return out.str();
-}
-
/////////////////////////////////////////////////////////////////
} // namespace storage
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/serialize.h Thu Jun 21 12:09:24 2007
@@ -116,9 +116,6 @@
template<>
std::string toXML( const Language::constPtr &obj );
-template<>
-std::string toXML( const source::SourceInfo &obj );
-
/////////////////////////////////////////////////////////////////
} // namespace storage
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLAtomImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLAtomImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLAtomImpl.h Thu Jun 21 12:09:24 2007
@@ -12,7 +12,6 @@
#ifndef ZYPP_TARGET_XMLSTORE_ATOMIMPL_H
#define ZYPP_TARGET_XMLSTORE_ATOMIMPL_H
-#include "zypp/source/SourceImpl.h"
#include "zypp/detail/AtomImpl.h"
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLProductImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/store/xml/XMLProductImpl.h Thu Jun 21 12:09:24 2007
@@ -12,7 +12,6 @@
#ifndef ZYPP_STORAGE_XMLPRODUCTIMPL_H
#define ZYPP_STORAGE_XMLPRODUCTIMPL_H
-#include "zypp/Source.h"
#include "zypp/detail/ProductImplIf.h"
///////////////////////////////////////////////////////////////////
@@ -94,8 +93,6 @@
TranslatedText _short_name;
std::string _dist_name;
Edition _dist_version;
-
- Source_Ref _source;
};
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.cc Thu Jun 21 12:09:24 2007
@@ -128,7 +128,6 @@
ZYppImpl::ZYppImpl()
: _textLocale( defaultTextLocale() )
, _pool()
- , _sourceFeed( _pool )
, _target(0)
, _resolver( new Resolver(_pool.accessor()) )
, _architecture( defaultArchitecture() )
Modified: branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp…
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/zypp_detail/ZYppImpl.h Thu Jun 21 12:09:24 2007
@@ -16,7 +16,6 @@
#include "zypp/TmpPath.h"
#include "zypp/ResPoolManager.h"
-#include "zypp/SourceFeed.h"
#include "zypp/Target.h"
#include "zypp/Resolver.h"
#include "zypp/Locale.h"
@@ -60,10 +59,6 @@
{ return _pool.proxy(); }
/** */
- SourceFeed_Ref sourceFeed() const
- { return _sourceFeed; }
-
- /** */
KeyRing_Ptr keyRing() const
{ return _keyring; }
@@ -151,8 +146,6 @@
/** */
ResPoolManager _pool;
/** */
- SourceFeed_Ref _sourceFeed;
- /** */
Target_Ptr _target;
/** */
Resolver_Ptr _resolver;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
20 Jun '07
Author: aschnell
Date: Wed Jun 20 19:47:55 2007
New Revision: 5817
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5817&view=rev
Log:
- fixed some typos
Modified:
trunk/libzypp/zypp/Arch.cc
trunk/libzypp/zypp/AutoDispose.h
trunk/libzypp/zypp/Callback.h
trunk/libzypp/zypp/Capability.h
trunk/libzypp/zypp/Fetcher.cc
trunk/libzypp/zypp/KeyRing.h
trunk/libzypp/zypp/NeedAType.h
trunk/libzypp/zypp/PoolItem.h
trunk/libzypp/zypp/ResObject.h
trunk/libzypp/zypp/UpgradeStatistics.h
trunk/libzypp/zypp/ZYpp.h
trunk/libzypp/zypp/base/Exception.h
trunk/libzypp/zypp/base/Functional.h
trunk/libzypp/zypp/base/Unit.h
trunk/libzypp/zypp/base/WatchFile.h
Modified: trunk/libzypp/zypp/Arch.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Arch.cc?rev=5817&r1…
==============================================================================
--- trunk/libzypp/zypp/Arch.cc (original)
+++ trunk/libzypp/zypp/Arch.cc Wed Jun 20 19:47:55 2007
@@ -70,7 +70,7 @@
return _archStr == targetEntry_r._archStr;
break;
}
- // This is a builtin: comatible if mentioned in targetEntry_r
+ // This is a builtin: compatible if mentioned in targetEntry_r
return targetEntry_r._compatBits & _idBit;
}
@@ -97,7 +97,7 @@
}
/** \relates Arch::CompatEntry ComaptSet ordering.
- * \note This is purely based on _archStr, as required by class ComaptSet.
+ * \note This is purely based on _archStr, as required by class CompatSet.
*/
inline bool operator<( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
{ return lhs._archStr < rhs._archStr; }
@@ -186,7 +186,7 @@
{
// _noarch must have _idBit 0.
// Other builtins have 1-bit set
- // and are intiialized done on the fly.
+ // and are initialized done on the fly.
_compatSet.insert( Arch::CompatEntry( _noarch, 0 ) );
///////////////////////////////////////////////////////////////////
// Define the CompatibleWith relation:
Modified: trunk/libzypp/zypp/AutoDispose.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/AutoDispose.h?rev=5…
==============================================================================
--- trunk/libzypp/zypp/AutoDispose.h (original)
+++ trunk/libzypp/zypp/AutoDispose.h Wed Jun 20 19:47:55 2007
@@ -36,7 +36,7 @@
* should be immutable, you should use <tt>AutoDispose\<const _Tp\></tt>.
*
* Pass a filename to the application and provide the appropriate
- * code to be exectued when the file is no longer needed:
+ * code to be executed when the file is no longer needed:
* \code
* struct FileCache
* {
Modified: trunk/libzypp/zypp/Callback.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Callback.h?rev=5817…
==============================================================================
--- trunk/libzypp/zypp/Callback.h (original)
+++ trunk/libzypp/zypp/Callback.h Wed Jun 20 19:47:55 2007
@@ -42,7 +42,7 @@
*
* That way the sending side does not need to know whether some receiver
* is listening. And it enables the receiver to return a reasonable value,
- * in case he's got no idea, what to else to return.
+ * in case he's got no idea, what else to return.
*
* \code
* struct Foo : public callback::ReportBase
@@ -98,10 +98,10 @@
* structure had to provide this value, so it's probabely better
* than anything you \e invent.
* \code
- * int somefunktion()
+ * int somefunction()
* {
* ...// don't know what to return?
- * return Foo::somefunktion();
+ * return Foo::somefunction();
* }
* \endcode
*
Modified: trunk/libzypp/zypp/Capability.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Capability.h?rev=58…
==============================================================================
--- trunk/libzypp/zypp/Capability.h (original)
+++ trunk/libzypp/zypp/Capability.h Wed Jun 20 19:47:55 2007
@@ -64,9 +64,9 @@
* \invariant Unified \c _pimpl asserted by CapFactory.
*
* \todo Need a trival return from matches. E.g. Conditional
- * cpabilities must be able to indicate that they should be
+ * capabilities must be able to indicate that they should be
* treated as if they were not present at all, if the precondition
- * does no apply. Same for the defaut Capability.
+ * does no apply. Same for the default Capability.
*/
class Capability
{
Modified: trunk/libzypp/zypp/Fetcher.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Fetcher.cc?rev=5817…
==============================================================================
--- trunk/libzypp/zypp/Fetcher.cc (original)
+++ trunk/libzypp/zypp/Fetcher.cc Wed Jun 20 19:47:55 2007
@@ -25,7 +25,7 @@
/**
* Class to encapsulate the \ref OnMediaLocation object
- * and the \ref FileChcker together
+ * and the \ref FileChecker together
*/
struct FetcherJob
{
Modified: trunk/libzypp/zypp/KeyRing.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.h?rev=5817&…
==============================================================================
--- trunk/libzypp/zypp/KeyRing.h (original)
+++ trunk/libzypp/zypp/KeyRing.h Wed Jun 20 19:47:55 2007
@@ -44,7 +44,7 @@
/**
* This basically means, we know the key, but it is not trusted, Continue
- * yes ir no?. Nothing else is performed (import, etc)
+ * yes or no?. Nothing else is performed (import, etc)
*/
virtual bool askUserToTrustKey( const PublicKey &key);
Modified: trunk/libzypp/zypp/NeedAType.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/NeedAType.h?rev=581…
==============================================================================
--- trunk/libzypp/zypp/NeedAType.h (original)
+++ trunk/libzypp/zypp/NeedAType.h Wed Jun 20 19:47:55 2007
@@ -26,14 +26,14 @@
Whenever you find something that might be worth being a
type, and not just an \c unsigned or \c string. Keep it here.
- Start with a resonable \c typedef or \c class draft, so you
+ Start with a reasonable \c typedef or \c class draft, so you
can start using the type within the implementation. If you're
in need for interface methods, add them to the draft. Think about
the interface and expected behaviour, but implement \b here just
as much as you actually need.
Goal is to provide a real class for it, or to find out that a
- typedef is sufficient, ot the type is not needed anyway.
+ typedef is sufficient, or the type is not needed anyway.
If you already implemented something which would fit into this
group, but don't want to move it here, put doxygens
@@ -47,7 +47,7 @@
/** Single line of (human readable) text.
- probabely sufficient as typedef. we may use it to classify the
+ probably sufficient as typedef. we may use it to classify the
various strings and string lists within resolvable and other classes.
More a hint to the UI describing the purpose of the string. */
typedef std::string Label;
@@ -59,7 +59,7 @@
/** Offer a License text and methods to remember confirmation. */
typedef std::string License;
- /** An rpm package group value. Also provide acces to a
+ /** An rpm package group value. Also provide access to a
* (singleton) tree like group hierarchy which contains
* all existing groups. No more need to fiddle with YStringTreeItem
* classes and forgetting to add parsed groups there for use in the UI.
Modified: trunk/libzypp/zypp/PoolItem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolItem.h?rev=5817…
==============================================================================
--- trunk/libzypp/zypp/PoolItem.h (original)
+++ trunk/libzypp/zypp/PoolItem.h Wed Jun 20 19:47:55 2007
@@ -29,7 +29,7 @@
//
/** Reference to a PoolItem conecting ResObject and ResStatus.
*
- * The "real" PoolItem is usg. somwhere in the ResPool. This is
+ * The "real" PoolItem is usg. somewhere in the ResPool. This is
* a reference to it. All copies made will reference (and modify)
* the same PoolItem. All changes via a PoolItem_Ref are immediately
* visible in all copies (now COW).
Modified: trunk/libzypp/zypp/ResObject.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResObject.h?rev=581…
==============================================================================
--- trunk/libzypp/zypp/ResObject.h (original)
+++ trunk/libzypp/zypp/ResObject.h Wed Jun 20 19:47:55 2007
@@ -37,7 +37,7 @@
/**
* Interface base for resolvable objects (common data).
* That is, all data not needed for solving, but common
- * across al Resolvable kinds.
+ * across all Resolvable kinds.
*/
class ResObject : public Resolvable
{
Modified: trunk/libzypp/zypp/UpgradeStatistics.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/UpgradeStatistics.h…
==============================================================================
--- trunk/libzypp/zypp/UpgradeStatistics.h (original)
+++ trunk/libzypp/zypp/UpgradeStatistics.h Wed Jun 20 19:47:55 2007
@@ -231,7 +231,7 @@
}
/**
- * total number of packages that will be finaly deleted
+ * total number of packages that will be finally deleted
* (does not count the replaced packages)
**/
unsigned totalToDelete() const
Modified: trunk/libzypp/zypp/ZYpp.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZYpp.h?rev=5817&r1=…
==============================================================================
--- trunk/libzypp/zypp/ZYpp.h (original)
+++ trunk/libzypp/zypp/ZYpp.h Wed Jun 20 19:47:55 2007
@@ -124,7 +124,7 @@
Resolver_Ptr resolver() const;
KeyRing_Ptr keyRing() const;
public:
- /** Set the preferd locale for translated labels, descriptions,
+ /** Set the preferred locale for translated labels, descriptions,
* etc. passed to the UI.
*/
void setTextLocale( const Locale & textLocale_r );
Modified: trunk/libzypp/zypp/base/Exception.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/Exception.h?re…
==============================================================================
--- trunk/libzypp/zypp/base/Exception.h (original)
+++ trunk/libzypp/zypp/base/Exception.h Wed Jun 20 19:47:55 2007
@@ -141,7 +141,7 @@
{ _where = where_r; }
/** Return the message string provided to the ctor.
- * \note This is not neccessarily the complete error message.
+ * \note This is not necessarily the complete error message.
* The whole error message is provided by \ref asString or
* \ref dumpOn.
*/
Modified: trunk/libzypp/zypp/base/Functional.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/Functional.h?r…
==============================================================================
--- trunk/libzypp/zypp/base/Functional.h (original)
+++ trunk/libzypp/zypp/base/Functional.h Wed Jun 20 19:47:55 2007
@@ -22,7 +22,7 @@
/* http://www.boost.org/libs/functional/mem_fun.html
The header functional.hpp includes improved versions of
- the full range of member function adapters from the the
+ the full range of member function adapters from the
C++ Standard Library.
*/
using boost::mem_fun;
@@ -205,7 +205,7 @@
* \ref Cain functor.
*
* \code
- * struct Print; // functor priniting elements
+ * struct Print; // functor printing elements
* struct Count; // functor counting number of elements
*
* std::for_each( c.begin(), c.end(),
Modified: trunk/libzypp/zypp/base/Unit.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/Unit.h?rev=581…
==============================================================================
--- trunk/libzypp/zypp/base/Unit.h (original)
+++ trunk/libzypp/zypp/base/Unit.h Wed Jun 20 19:47:55 2007
@@ -28,7 +28,7 @@
//
/** Simple handling of Units.
*
- * Unit strores factor and symbol, and a precision value for printing.
+ * Unit stores factor and symbol, and a precision value for printing.
* \ref form builds a string from a value according to the format
* specification.
* \code
Modified: trunk/libzypp/zypp/base/WatchFile.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/WatchFile.h?re…
==============================================================================
--- trunk/libzypp/zypp/base/WatchFile.h (original)
+++ trunk/libzypp/zypp/base/WatchFile.h Wed Jun 20 19:47:55 2007
@@ -42,7 +42,7 @@
* WatchFile::NO_INIT );
* if ( sysconfigFile.hasChanged() )
* {
- * // releoad the file...
+ * // reload the file...
* }
* \endcode
*/
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5816 - in /branches/SuSE-Linux-10_2-Branch/zypper: package/zypper.changes src/zypper.cc
by jkupec@svn.opensuse.org 20 Jun '07
by jkupec@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: jkupec
Date: Wed Jun 20 16:58:52 2007
New Revision: 5816
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5816&view=rev
Log:
fixed sticky -h in shell (#281710)
Modified:
branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes
branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc
Modified: branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes Wed Jun 20 16:58:52 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jun 20 16:55:39 CEST 2007 - jkupec(a)suse.cz
+
+- fixed sticky -h in shell (#281710)
+- r5816
+
+-------------------------------------------------------------------
Wed Jun 20 16:41:57 CEST 2007 - jkupec(a)suse.cz
- Merged revisions 4714,4720-4721,4724-4727,4730-4754,4758-4797,4799-4804,4806-4810,4812-4837,4839-4846,4848-4849,4851,4854-4940,4945-4953,4955-4957,4961-4963,4965-4967,4969-4971,4974-5028,5030-5060,5062-5078,5080-5308,5310-5450,5452,5454-5666,5671-5697,5699-5710,5712-5714,5716-5732,5734-5737,5740,5742-5748,5750-5757,5761-5765,5767-5768,5770-5780,5783,5786-5787,5789-5791,5793,5795-5797,5799,5801,5803,5805-5813 via svnmerge from
@@ -31,7 +37,7 @@
Shrunk zypp-checkpatches (#224886).
........
-- r5814
+- r5815
-------------------------------------------------------------------
Mon Apr 2 10:44:20 CEST 2007 - jkupec(a)suse.cz
Modified: branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc Wed Jun 20 16:58:52 2007
@@ -993,6 +993,9 @@
bool loop = true;
while (loop) {
+ // reset globals
+ ghelp = false;
+
// read a line
string line = readline_getline ();
cerr_vv << "Got: " << line << endl;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5815 - in /branches/SuSE-Linux-10_2-Branch/zypper: ./ doc/zypper.8 package/zypper.changes src/Makefile.am src/zmart-misc.cc src/zmart-misc.h src/zypper.cc zypper.spec.in
by jkupec@svn.opensuse.org 20 Jun '07
by jkupec@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: jkupec
Date: Wed Jun 20 16:54:17 2007
New Revision: 5815
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5815&view=rev
Log:
merged bugfixes from trunk
Modified:
branches/SuSE-Linux-10_2-Branch/zypper/ (props changed)
branches/SuSE-Linux-10_2-Branch/zypper/doc/zypper.8
branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes
branches/SuSE-Linux-10_2-Branch/zypper/src/Makefile.am
branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.cc
branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.h
branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc
branches/SuSE-Linux-10_2-Branch/zypper/zypper.spec.in
Modified: branches/SuSE-Linux-10_2-Branch/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/doc/zypper.8 (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/doc/zypper.8 Wed Jun 20 16:54:17 2007
@@ -20,7 +20,7 @@
.TP
.B shell (sh)
Starts a shell for entering multiple commands in one session.
-(NEW, beware of bugs!)
+End it by "exit", "quit", or Ctrl-D.
.LP
.B Package Management Commands
@@ -250,6 +250,9 @@
.TP
.B /var/lib/zypp/cache
Directory for storing metadata contained in installation sources.
+.TP
+.B ~/.zypper_history
+Command history for the shell.
.SH "EXIT CODES"
.LP
Modified: branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/package/zypper.changes Wed Jun 20 16:54:17 2007
@@ -1,4 +1,39 @@
-------------------------------------------------------------------
+Wed Jun 20 16:41:57 CEST 2007 - jkupec(a)suse.cz
+
+- Merged revisions 4714,4720-4721,4724-4727,4730-4754,4758-4797,4799-4804,4806-4810,4812-4837,4839-4846,4848-4849,4851,4854-4940,4945-4953,4955-4957,4961-4963,4965-4967,4969-4971,4974-5028,5030-5060,5062-5078,5080-5308,5310-5450,5452,5454-5666,5671-5697,5699-5710,5712-5714,5716-5732,5734-5737,5740,5742-5748,5750-5757,5761-5765,5767-5768,5770-5780,5783,5786-5787,5789-5791,5793,5795-5797,5799,5801,5803,5805-5813 via svnmerge from
+http://svn.opensuse.org/svn/zypp/trunk/zypper
+
+........
+ r4969 | mvidner | 2007-02-05 17:03:44 +0100 (Mon, 05 Feb 2007) | 3 lines
+
+ Shell: added command line editing with history (#232374);
+ exit on EOF (#230211, #235709).
+........
+ r4977 | mvidner | 2007-02-05 18:01:52 +0100 (Mon, 05 Feb 2007) | 2 lines
+
+ BuildRequires: readline-devel
+........
+ r5003 | mvidner | 2007-02-12 13:36:47 +0100 (Mon, 12 Feb 2007) | 2 lines
+
+ Do not allow to commit with unresolved dependency problems (#242736).
+........
+ r5016 | mvidner | 2007-02-13 10:53:33 +0100 (Tue, 13 Feb 2007) | 2 lines
+
+ Echo a newline after the user enters EOF.
+........
+ r5020 | mvidner | 2007-02-13 12:59:29 +0100 (Tue, 13 Feb 2007) | 2 lines
+
+ Added interactive resolution of resolver problems (#242736).
+........
+ r5021 | mvidner | 2007-02-13 14:12:46 +0100 (Tue, 13 Feb 2007) | 2 lines
+
+ Shrunk zypp-checkpatches (#224886).
+........
+
+- r5814
+
+-------------------------------------------------------------------
Mon Apr 2 10:44:20 CEST 2007 - jkupec(a)suse.cz
- Translation update (final translation round)
Modified: branches/SuSE-Linux-10_2-Branch/zypper/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/src/Makefile.am (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/src/Makefile.am Wed Jun 20 16:54:17 2007
@@ -61,10 +61,10 @@
zypper-getopt.h \
zypper-getopt.cc \
zmart.h
-zypper_LDADD = $(ZYPP_LIBS) -lboost_regex
+zypper_LDADD = $(ZYPP_LIBS) -lboost_regex -lreadline
if BUILD_CHECKPATCHES
-zypp_checkpatches_SOURCES = zypp-checkpatches.cc zmart-sources.cc \
+zypp_checkpatches_SOURCES = zypp-checkpatches.cc \
zypper-tabulator.h \
zypper-tabulator.cc \
zmart-updates.cc \
Modified: branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.cc Wed Jun 20 16:54:17 2007
@@ -217,7 +217,75 @@
}
}
-void show_problems () {
+// debugging
+static
+ostream& operator << (ostream & stm, ios::iostate state)
+{
+ return stm << (state & ifstream::eofbit ? "Eof ": "")
+ << (state & ifstream::badbit ? "Bad ": "")
+ << (state & ifstream::failbit ? "Fail ": "")
+ << (state == 0 ? "Good ": "");
+}
+
+//! @return true to retry solving now, false to cancel, indeterminate to continue
+tribool show_problem (bool non_interactive, const ResolverProblem & prob, ProblemSolutionList & todo)
+{
+ ostream& stm = cerr;
+ string det;
+ stm << _("Problem: ") << prob.description () << endl;
+ det = prob.details ();
+ if (!det.empty ())
+ stm << " " << det << endl;
+
+ int n;
+ ProblemSolutionList solutions = prob.solutions ();
+ ProblemSolutionList::iterator
+ bb = solutions.begin (),
+ ee = solutions.end (),
+ ii;
+ for (n = 1, ii = bb; ii != ee; ++n, ++ii) {
+ stm << format (_(" Solution %s: ")) % n << (*ii)->description () << endl;
+ det = (*ii)->details ();
+ if (!det.empty ())
+ stm << " " << det << endl;
+ }
+
+ if (non_interactive)
+ return false;
+
+ int reply;
+ do {
+ // input prompt
+ cerr << _("number, (r)etry or (c)ancel> ") << flush;
+ string reply_s = str::getline (cin, zypp::str::TRIM);
+
+ if (! cin.good()) {
+ cerr_v << "cin: " << cin.rdstate() << endl;
+ return false;
+ }
+ // translators: corresponds to (r)etry
+ if (reply_s == _("r"))
+ return true;
+ // translators: corresponds to (c)ancel
+ else if (reply_s == _("c"))
+ return false;
+
+ str::strtonum (reply_s, reply);
+ } while (reply <= 0 || reply >= n);
+
+ cerr << format (_("Applying solution %s")) % reply << endl;
+ ProblemSolutionList::iterator reply_i = solutions.begin ();
+ advance (reply_i, reply - 1);
+ todo.push_back (*reply_i);
+
+ tribool go_on = indeterminate; // continue with next problem
+ return go_on;
+}
+
+// return true to retry solving, false to cancel transaction
+bool show_problems (bool non_interactive)
+{
+ bool retry = true;
ostream& stm = cerr;
Resolver_Ptr resolver = zypp::getZYpp()->resolver();
ResolverProblemList rproblems = resolver->problems ();
@@ -225,23 +293,26 @@
b = rproblems.begin (),
e = rproblems.end (),
i;
- if (b != e) {
- cerr << _("Problems:") << endl;
+ ProblemSolutionList todo;
+ bool no_problem = b == e;
+ if (!no_problem) {
+ stm << format (_("%s Problems:")) % rproblems.size() << endl;
}
for (i = b; i != e; ++i) {
- stm << _("PROB ") << (*i)->description () << endl;
- stm << ": " << (*i)->details () << endl;
-
- ProblemSolutionList solutions = (*i)->solutions ();
- ProblemSolutionList::iterator
- bb = solutions.begin (),
- ee = solutions.end (),
- ii;
- for (ii = bb; ii != ee; ++ii) {
- stm << _(" SOL ") << (*ii)->description () << endl;
- stm << " : " << (*ii)->details () << endl;
+ stm << _("Problem: ") << (*i)->description () << endl;
+ }
+ for (i = b; i != e; ++i) {
+ stm << endl;
+ tribool stopnow = show_problem (non_interactive, *(*i), todo);
+ if (! indeterminate (stopnow)) {
+ retry = stopnow == true;
+ break;
}
}
+
+ if (retry)
+ resolver->applySolutions (todo);
+ return retry;
}
/**
@@ -367,11 +438,11 @@
dump_pool ();
}
-void resolve()
+bool resolve()
{
establish ();
cerr_v << _("Resolving dependencies...") << endl;
- God->resolver()->resolvePool();
+ return God->resolver()->resolvePool();
}
//! are there applicable patches?
@@ -695,9 +766,17 @@
* ZYPPER_EXIT_INF_RESTART_NEEDED - if one of patches to be installed needs package manager restart
*/
int solve_and_commit (bool non_interactive) {
- resolve();
-
- show_problems ();
+ while (true) {
+ bool success = resolve();
+ if (success)
+ break;
+
+ success = show_problems (non_interactive);
+ if (! success) {
+ // TODO cancel transaction?
+ return ZYPPER_EXIT_ERR_ZYPP; // #242736
+ }
+ }
// returns -1, 0, ZYPPER_EXIT_INF_REBOOT_NEEDED, or ZYPPER_EXIT_INF_RESTART_NEEDED
Modified: branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.h (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/src/zmart-misc.h Wed Jun 20 16:54:17 2007
@@ -23,7 +23,6 @@
const std::string &name );
void mark_for_uninstall( const zypp::ResObject::Kind &kind,
const std::string &name );
-void show_problems();
int show_summary();
std::string calculate_token();
//! load all resolvables that the user wants
@@ -31,7 +30,7 @@
void load_target();
void load_sources();
void establish ();
-void resolve();
+bool resolve();
void dump_pool ();
void show_patches();
void patch_check();
Modified: branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/src/zypper.cc Wed Jun 20 16:54:17 2007
@@ -15,6 +15,8 @@
#include <iterator>
#include <unistd.h>
+#include <readline/readline.h>
+#include <readline/history.h>
#include <zypp/zypp_detail/ZYppReadOnlyHack.h>
@@ -459,7 +461,8 @@
);
}
else if (!command.empty()) { // empty command is treated earlier
- cerr << _("Unknown command") << " '" << command << "'." << endl << endl;
+ if (command != "help") // #235709
+ cerr << _("Unknown command") << " '" << command << "'." << endl << endl;
cerr << help_commands;
return ZYPPER_EXIT_ERR_SYNTAX;
}
@@ -947,13 +950,51 @@
return ret;
}
+// Read a string. "\004" (^D) on EOF.
+string readline_getline ()
+{
+ // A static variable for holding the line.
+ static char *line_read = NULL;
+
+ /* If the buffer has already been allocated,
+ return the memory to the free pool. */
+ if (line_read) {
+ free (line_read);
+ line_read = NULL;
+ }
+
+ /* Get a line from the user. */
+ line_read = readline ("zypper> ");
+
+ /* If the line has any text in it,
+ save it on the history. */
+ if (line_read && *line_read)
+ add_history (line_read);
+
+ if (line_read)
+ return line_read;
+ else
+ return "\004";
+}
+
void command_shell ()
{
+ string histfile;
+ try {
+ Pathname p (getenv ("HOME"));
+ p /= ".zypper_history";
+ histfile = p.asString ();
+ } catch (...) {
+ // no history
+ }
+ using_history ();
+ if (!histfile.empty ())
+ read_history (histfile.c_str ());
+
bool loop = true;
while (loop) {
// read a line
- cerr << "zypper> " << flush;
- string line = zypp::str::getline (cin);
+ string line = readline_getline ();
cerr_vv << "Got: " << line << endl;
// reset optind etc
optind = 0;
@@ -963,13 +1004,19 @@
char **sh_argv = args.argv ();
string command = sh_argv[0]? sh_argv[0]: "";
- // TODO check empty command
- if (command == "exit")
+ if (command == "\004") {
+ loop = false;
+ cout << endl;
+ }
+ else if (command == "exit" || command == "quit")
loop = false;
else
safe_one_command (command, sh_argc, sh_argv);
}
+
+ if (!histfile.empty ())
+ write_history (histfile.c_str ());
}
int main(int argc, char **argv)
Modified: branches/SuSE-Linux-10_2-Branch/zypper/zypper.spec.in
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/zypper…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/zypper/zypper.spec.in (original)
+++ branches/SuSE-Linux-10_2-Branch/zypper/zypper.spec.in Wed Jun 20 16:54:17 2007
@@ -14,6 +14,8 @@
# da library
BuildRequires: libzypp-devel
BuildRequires: gcc-c++ pkg-config boost-devel gettext-devel
+BuildRequires: readline-devel
+Requires: procps
License: GPL
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5814 - /trunk/libzypp/zypp/cache/ResolvableQuery.cc
by dmacvicar@svn.opensuse.org 20 Jun '07
by dmacvicar@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: dmacvicar
Date: Wed Jun 20 16:28:05 2007
New Revision: 5814
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5814&view=rev
Log:
- use a saner way to detect no records found
Modified:
trunk/libzypp/zypp/cache/ResolvableQuery.cc
Modified: trunk/libzypp/zypp/cache/ResolvableQuery.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/ResolvableQue…
==============================================================================
--- trunk/libzypp/zypp/cache/ResolvableQuery.cc (original)
+++ trunk/libzypp/zypp/cache/ResolvableQuery.cc Wed Jun 20 16:28:05 2007
@@ -84,18 +84,13 @@
const std::string &default_value )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
-
- string value;
try {
- value = queryStringAttributeTranslationInternal( con, record_id, Locale(), klass, name);
+ return queryStringAttributeTranslationInternal( con, record_id, Locale(), klass, name, default_value);
}
catch ( const Exception &e )
{
- ZYPP_CAUGHT(e);
- return default_value;
+ ZYPP_RETHROW(e);
}
-
- return value;
}
@@ -106,16 +101,13 @@
const std::string &default_value )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
- string value;
try {
- value = queryStringAttributeTranslationInternal( con, record_id, locale, klass, name );
+ return queryStringAttributeTranslationInternal( con, record_id, locale, klass, name, default_value );
}
catch ( const Exception &e )
{
- ZYPP_CAUGHT(e);
- return default_value;
+ ZYPP_RETHROW(e);
}
- return value;
}
@@ -125,16 +117,13 @@
const TranslatedText &default_value )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
- TranslatedText value;
try {
- value = queryTranslatedStringAttributeInternal( con, record_id, klass, name );
+ return queryTranslatedStringAttributeInternal( con, record_id, klass, name, default_value );
}
catch ( const Exception &e )
{
- ZYPP_CAUGHT(e);
- return default_value;
+ ZYPP_RETHROW(e);
}
- return value;
}
@@ -144,16 +133,13 @@
bool default_value )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
- bool value;
try {
- value = queryNumericAttributeInternal( con, record_id, klass, name);
+ return queryNumericAttributeInternal( con, record_id, klass, name, default_value);
}
catch ( const Exception &e )
{
- ZYPP_CAUGHT(e);
- return default_value;
+ ZYPP_RETHROW(e);
}
- return value;
}
int queryNumericAttribute( const data::RecordId &record_id,
@@ -162,16 +148,13 @@
int default_value )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
- int n;
try {
- n = queryNumericAttributeInternal( con, record_id, klass, name);
+ return queryNumericAttributeInternal( con, record_id, klass, name, default_value);
}
catch ( const Exception &e )
{
- ZYPP_CAUGHT(e);
- return default_value;
+ ZYPP_RETHROW(e);
}
- return n;
}
private:
@@ -179,7 +162,8 @@
int queryNumericAttributeInternal( sqlite3_connection &con,
const data::RecordId &record_id,
const std::string &klass,
- const std::string &name )
+ const std::string &name,
+ int default_value )
{
con.executenonquery("BEGIN;");
sqlite3_command cmd( con, "select a.value from numeric_attributes a,types t where a.weak_resolvable_id=:rid and a.attr_id=t.id and t.class=:tclass and t.name=:tname;");
@@ -189,13 +173,18 @@
cmd.bind(":tclass", klass);
cmd.bind(":tname", name);
- return cmd.executeint();
+ sqlite3_reader reader = cmd.executereader();
+ if ( reader.read() )
+ return reader.getint(0);
+ else
+ return default_value;
}
TranslatedText queryTranslatedStringAttributeInternal( sqlite3_connection &con,
const data::RecordId &record_id,
const std::string &klass,
- const std::string &name )
+ const std::string &name,
+ const TranslatedText &default_value )
{
//con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -209,26 +198,30 @@
TranslatedText result;
sqlite3_reader reader = cmd.executereader();
- while(reader.read())
+ if ( reader.read() )
{
result.setText( reader.getstring(0), Locale( reader.getstring(1) ) );
+ return result;
}
- return result;
+ else
+ return default_value;
}
std::string queryStringAttributeInternal( sqlite3_connection &con,
const data::RecordId &record_id,
const std::string &klass,
- const std::string &name )
+ const std::string &name,
+ const std::string &default_value )
{
- return queryStringAttributeTranslationInternal( con, record_id, Locale(), klass, name);
+ return queryStringAttributeTranslationInternal( con, record_id, Locale(), klass, name, default_value);
}
std::string queryStringAttributeTranslationInternal( sqlite3_connection &con,
const data::RecordId &record_id,
const Locale &locale,
const std::string &klass,
- const std::string &name )
+ const std::string &name,
+ const std::string &default_value )
{
//con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -244,7 +237,11 @@
cmd.bind(":tclass", klass);
cmd.bind(":tname", name);
- return cmd.executestring();
+ sqlite3_reader reader = cmd.executereader();
+ if ( reader.read() )
+ return reader.getstring(0);
+ else
+ return default_value;
}
};
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5813 - /branches/SuSE-Linux-10_2-Branch/zypper/
by jkupec@svn.opensuse.org 20 Jun '07
by jkupec@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: jkupec
Date: Wed Jun 20 15:57:31 2007
New Revision: 5813
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5813&view=rev
Log:
Blocked revisions 4941-4944,4954,4958-4960,4964,4968,4972-4973,5029,5061,5079,5309,5451,5453,5667-5670,5698,5711,5715,5733,5738-5739,5741,5749,5758-5760,5766,5769,5781-5782,5784-5785,5788,5792,5794,5798,5800,5802,5804 via svnmerge
................
r4941 | jkupec | 2007-01-31 15:25:19 +0100 (Wed, 31 Jan 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-4940" from
http://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
................
r4942 | jkupec | 2007-01-31 16:10:43 +0100 (Wed, 31 Jan 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-4939" from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
................
r4943 | jkupec | 2007-01-31 16:12:46 +0100 (Wed, 31 Jan 2007) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-4896" from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
................
r4944 | jkupec | 2007-01-31 16:26:12 +0100 (Wed, 31 Jan 2007) | 9 lines
Merged revisions 4897-4943 via svnmerge from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
........
r4932 | jkupec | 2007-01-29 19:25:32 +0100 (Mon, 29 Jan 2007) | 1 line
locale support added
........
................
r4954 | mvidner | 2007-02-01 14:32:57 +0100 (Thu, 01 Feb 2007) | 3 lines
Added global option --root to operate on a different directory
(#238165, F#301963).
................
r4958 | jkupec | 2007-02-01 14:51:23 +0100 (Thu, 01 Feb 2007) | 8 lines
Blocked revisions 4945 via svnmerge
........
r4945 | mvidner | 2007-01-31 18:21:42 +0100 (Wed, 31 Jan 2007) | 2 lines
Merged the part of SP1 build fix from r4838 that was missing in r4856.
........
................
r4959 | jkupec | 2007-02-01 15:21:20 +0100 (Thu, 01 Feb 2007) | 44 lines
Merged revisions 4943-4944,4946-4958 via svnmerge from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
........
r4947 | mvidner | 2007-02-01 10:26:36 +0100 (Thu, 01 Feb 2007) | 2 lines
Added many missing files
........
r4948 | mvidner | 2007-02-01 10:27:06 +0100 (Thu, 01 Feb 2007) | 2 lines
token translation of a few messages
........
r4949 | jkupec | 2007-02-01 10:27:53 +0100 (Thu, 01 Feb 2007) | 6 lines
- enabled DownloadResolvableReportReceiver::problem() callback
(#224216)
- global non-iteractive mode added (needed due to bug #224216 and
no-confirm option of install and update commands)
........
r4950 | jkupec | 2007-02-01 10:29:03 +0100 (Thu, 01 Feb 2007) | 1 line
revision corrected
........
r4951 | jkupec | 2007-02-01 11:02:09 +0100 (Thu, 01 Feb 2007) | 2 lines
--non-interactive global option added
........
r4952 | jkupec | 2007-02-01 11:40:48 +0100 (Thu, 01 Feb 2007) | 1 line
Slovak translation added.
........
r4953 | jkupec | 2007-02-01 11:44:05 +0100 (Thu, 01 Feb 2007) | 1 line
changelog
........
r4955 | jkupec | 2007-02-01 14:42:23 +0100 (Thu, 01 Feb 2007) | 2 lines
Hungarian translation added.
........
r4956 | jkupec | 2007-02-01 14:44:39 +0100 (Thu, 01 Feb 2007) | 1 line
changelog
........
................
r4960 | jkupec | 2007-02-01 15:22:12 +0100 (Thu, 01 Feb 2007) | 1 line
.changes
................
r4964 | jkupec | 2007-02-02 13:30:49 +0100 (Fri, 02 Feb 2007) | 13 lines
Merged revisions 4944,4946,4954,4957-4963 via svnmerge from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
........
r4962 | jkupec | 2007-02-02 13:22:21 +0100 (Fri, 02 Feb 2007) | 2 lines
Non-interactive mode turns on --skip-interactive as well.
........
r4963 | jkupec | 2007-02-02 13:27:43 +0100 (Fri, 02 Feb 2007) | 1 line
changelog
........
................
r4968 | mvidner | 2007-02-05 14:01:29 +0100 (Mon, 05 Feb 2007) | 14 lines
Merged revisions 4946,4954,4957-4961,4964-4967 via svnmerge from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
........
r4966 | mvidner | 2007-02-05 10:49:07 +0100 (Po, 05 úno 2007) | 2 lines
Fixed in-tree make package-local.
........
r4967 | mvidner | 2007-02-05 10:55:04 +0100 (Po, 05 úno 2007) | 3 lines
merged current pot to po's
(make package made me do it)
........
................
r4972 | mvidner | 2007-02-05 17:34:50 +0100 (Mon, 05 Feb 2007) | 3 lines
merged current pot to po's
(merging from the branch was wrong, the code is different there)
................
r4973 | mvidner | 2007-02-05 17:35:42 +0100 (Mon, 05 Feb 2007) | 2 lines
0.7.0
................
r5029 | shaas | 2007-02-15 13:40:07 +0100 (Thu, 15 Feb 2007) | 1 line
outsourcing libzypp
................
r5061 | jkupec | 2007-02-21 13:28:25 +0100 (Wed, 21 Feb 2007) | 1 line
one po/Makefile.in too many
................
r5079 | mvidner | 2007-02-22 19:21:35 +0100 (Thu, 22 Feb 2007) | 9 lines
Merged revisions 4946,4954,4957-4961,4964-4965,4968-5077 via svnmerge from
https://svn.suse.de/svn/zypp/branches/SuSE-Linux-10_2-Branch/zypper
........
r5077 | mvidner | 2007-02-22 18:30:23 +0100 (Čt, 22 úno 2007) | 2 lines
Use the read-only hack for service-list (#247001).
........
................
r5309 | mvidner | 2007-04-06 10:30:17 +0200 (Fri, 06 Apr 2007) | 1 line
testing commit
................
r5451 | jkupec | 2007-04-26 11:18:53 +0200 (Thu, 26 Apr 2007) | 2 lines
merged zypp-checkpatches.cc from SP1 branch
................
r5453 | jkupec | 2007-04-26 14:25:50 +0200 (Thu, 26 Apr 2007) | 2 lines
Merged changes from SP1 branch, ignoring translation updates.
................
r5667 | jkupec | 2007-06-04 17:46:33 +0200 (Mon, 04 Jun 2007) | 3 lines
- moved zypper log from /var/log/YaST2 to /var/log
- declared ownership of the log file by zypper package
................
r5668 | jkupec | 2007-06-04 18:08:50 +0200 (Mon, 04 Jun 2007) | 2 lines
.changes
................
r5669 | jkupec | 2007-06-04 22:30:20 +0200 (Mon, 04 Jun 2007) | 2 lines
fixed log file path
................
r5670 | jkupec | 2007-06-04 22:34:52 +0200 (Mon, 04 Jun 2007) | 1 line
.changes
................
r5698 | jkupec | 2007-06-07 14:07:50 +0200 (Thu, 07 Jun 2007) | 7 lines
- backup
- zypper install/remove modified to load repo resolvables from db cache
(init_repos() and load_repo_resolvables() added - just a quick hack,
will clean up the code later)
- not working ATM
................
r5711 | jkupec | 2007-06-11 15:16:25 +0200 (Mon, 11 Jun 2007) | 1 line
autotools -> cmake
................
r5715 | jkupec | 2007-06-11 15:50:18 +0200 (Mon, 11 Jun 2007) | 1 line
some ignores added
................
r5733 | dmacvicar | 2007-06-12 15:14:12 +0200 (Tue, 12 Jun 2007) | 1 line
implement zypper sl
................
r5738 | dmacvicar | 2007-06-12 23:29:47 +0200 (Tue, 12 Jun 2007) | 1 line
simple refresh implementation.
................
r5739 | jkupec | 2007-06-13 09:00:24 +0200 (Wed, 13 Jun 2007) | 1 line
command enumeration/mapping class added
................
r5741 | jkupec | 2007-06-13 15:29:49 +0200 (Wed, 13 Jun 2007) | 1 line
10.1 compatibility code removed
................
r5749 | jkupec | 2007-06-14 14:11:01 +0200 (Thu, 14 Jun 2007) | 1 line
backup
................
r5758 | jkupec | 2007-06-15 14:25:18 +0200 (Fri, 15 Jun 2007) | 1 line
dropped 10.1 code
................
r5759 | jkupec | 2007-06-15 14:29:59 +0200 (Fri, 15 Jun 2007) | 2 lines
- zypper addrepo (alias service-add, sa) reimplemented
- some related code clean-up
................
r5760 | jkupec | 2007-06-15 16:27:30 +0200 (Fri, 15 Jun 2007) | 2 lines
reintroduced and updated POTFILES.in (because of source files order)
................
r5766 | dmacvicar | 2007-06-18 12:52:17 +0200 (Mon, 18 Jun 2007) | 4 lines
compile
................
r5769 | jkupec | 2007-06-18 15:53:41 +0200 (Mon, 18 Jun 2007) | 3 lines
backup
................
r5781 | dmacvicar | 2007-06-19 01:01:18 +0200 (Tue, 19 Jun 2007) | 4 lines
- Don't clean the cache, buildCache takes care of it.
................
r5782 | mvidner | 2007-06-19 10:46:23 +0200 (Tue, 19 Jun 2007) | 3 lines
Fixed indentation
(http://en.opensuse.org/Tab_Width)
................
r5784 | jkupec | 2007-06-19 12:17:01 +0200 (Tue, 19 Jun 2007) | 2 lines
more commands added
................
r5785 | mvidner | 2007-06-19 12:53:35 +0200 (Tue, 19 Jun 2007) | 2 lines
Fixed an endless loop in Abort/Retry/Ignore (#269263).
................
r5788 | dmacvicar | 2007-06-19 15:24:49 +0200 (Tue, 19 Jun 2007) | 1 line
remove repo
................
r5792 | dmacvicar | 2007-06-19 17:49:28 +0200 (Tue, 19 Jun 2007) | 1 line
add installed resolvables before installgrep Target *
................
r5794 | dmacvicar | 2007-06-19 18:08:26 +0200 (Tue, 19 Jun 2007) | 7 lines
Dont re-read the rpm db after install.
Only has to be done if in shell mode, any one knows how to know that
flag?
................
r5798 | jkupec | 2007-06-19 18:53:46 +0200 (Tue, 19 Jun 2007) | 2 lines
Removed old source manager completely from all commands.
................
r5800 | dmacvicar | 2007-06-19 22:51:04 +0200 (Tue, 19 Jun 2007) | 4 lines
- handle errors on source adding
................
r5802 | jkupec | 2007-06-20 09:18:32 +0200 (Wed, 20 Jun 2007) | 2 lines
loading target resolvables where forgotten
................
r5804 | jkupec | 2007-06-20 10:04:23 +0200 (Wed, 20 Jun 2007) | 2 lines
list-updates and patch-check command reviewed
................
Modified:
branches/SuSE-Linux-10_2-Branch/zypper/ (props changed)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5812 - /trunk/libzypp/zypp/parser/yum/schema/validate-repodata.sh
by mvidner@svn.opensuse.org 20 Jun '07
by mvidner@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: mvidner
Date: Wed Jun 20 15:30:06 2007
New Revision: 5812
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5812&view=rev
Log:
really fixed error handling
Modified:
trunk/libzypp/zypp/parser/yum/schema/validate-repodata.sh (contents, props changed)
Modified: trunk/libzypp/zypp/parser/yum/schema/validate-repodata.sh
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/schema/v…
==============================================================================
--- trunk/libzypp/zypp/parser/yum/schema/validate-repodata.sh (original)
+++ trunk/libzypp/zypp/parser/yum/schema/validate-repodata.sh Wed Jun 20 15:30:06 2007
@@ -1,9 +1,12 @@
#!/bin/sh
+# $Id$
+set -o errexit
USAGE=false
DO_xmllint=false
DO_jing_compact=false
DO_jing_xml=false
DO_rnv=false
+ERROREXIT=false
#SDIR=/home/martin/zyppschema
SDIR=/home/mvidner/svn/zypp/trunk/libzypp/zypp/parser/yum/schema
@@ -11,7 +14,7 @@
while getopts ceghrs:x FLAG; do
case $FLAG in
c) DO_jing_compact=true;;
- e) set -o errexit;;
+ e) ERROREXIT=true;;
g) DO_jing_xml=true;;
h) USAGE=true;;
r) DO_rnv=true;;
@@ -89,7 +92,7 @@
done
rm -f $TEMP
- if $FAIL; then
+ if $ERROREXIT && $FAIL; then
exit 1
fi
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] r5811 - in /trunk/libzypp-testsuite: VERSION package/libzypp-testsuite.changes source/MediaMetadataParserTest.cc target/tests/hal.cc
by schubi2@svn.opensuse.org 20 Jun '07
by schubi2@svn.opensuse.org 20 Jun '07
20 Jun '07
Author: schubi2
Date: Wed Jun 20 14:34:50 2007
New Revision: 5811
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5811&view=rev
Log:
added includes for gcc42
Modified:
trunk/libzypp-testsuite/VERSION
trunk/libzypp-testsuite/package/libzypp-testsuite.changes
trunk/libzypp-testsuite/source/MediaMetadataParserTest.cc
trunk/libzypp-testsuite/target/tests/hal.cc
Modified: trunk/libzypp-testsuite/VERSION
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/VERSION?rev=58…
==============================================================================
--- trunk/libzypp-testsuite/VERSION (original)
+++ trunk/libzypp-testsuite/VERSION Wed Jun 20 14:34:50 2007
@@ -49,5 +49,5 @@
m4_define([LIBZYPPTESTSUITE_MINOR], [14])
m4_define([LIBZYPPTESTSUITE_COMPATMINOR], [9])
dnl ==================================================
-m4_define([LIBZYPPTESTSUITE_PATCH], [3])
+m4_define([LIBZYPPTESTSUITE_PATCH], [4])
dnl ==================================================
Modified: trunk/libzypp-testsuite/package/libzypp-testsuite.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/package/libzyp…
==============================================================================
--- trunk/libzypp-testsuite/package/libzypp-testsuite.changes (original)
+++ trunk/libzypp-testsuite/package/libzypp-testsuite.changes Wed Jun 20 14:34:50 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Jun 20 14:33:54 CEST 2007 - schubi(a)suse.de
+
+- added includes for gcc42
+
+-------------------------------------------------------------------
Tue Jun 12 12:10:29 CEST 2007 - schubi(a)suse.de
- cleanup; moved bineries to /opt/zypp/testsuite/bin
Modified: trunk/libzypp-testsuite/source/MediaMetadataParserTest.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/source/MediaMe…
==============================================================================
--- trunk/libzypp-testsuite/source/MediaMetadataParserTest.cc (original)
+++ trunk/libzypp-testsuite/source/MediaMetadataParserTest.cc Wed Jun 20 14:34:50 2007
@@ -1,4 +1,4 @@
-
+#include <iostream>
#include "zypp/source/susetags/MediaMetadataParser.h"
#include "zypp/source/susetags/MediaPatchesMetadataParser.h"
#include "zypp/base/Logger.h"
Modified: trunk/libzypp-testsuite/target/tests/hal.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/target/tests/h…
==============================================================================
--- trunk/libzypp-testsuite/target/tests/hal.cc (original)
+++ trunk/libzypp-testsuite/target/tests/hal.cc Wed Jun 20 14:34:50 2007
@@ -1,3 +1,5 @@
+#include <iostream>
+
#include "zypp/target/hal/Hal.h"
using namespace zypp::target::hal;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
20 Jun '07
Author: mlandres
Date: Wed Jun 20 13:54:56 2007
New Revision: 5810
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5810&view=rev
Log:
Temporary branch to switch to the new zypp API.
Added:
branches/REFACTORING-10_3/
- copied from r5809, trunk/
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0