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
April 2007
- 6 participants
- 149 discussions
[zypp-commit] r5434 - /trunk/libzypp/devel/devel.dmacvicar/README
by kkaempf@svn.opensuse.org 23 Apr '07
by kkaempf@svn.opensuse.org 23 Apr '07
23 Apr '07
Author: kkaempf
Date: Mon Apr 23 15:51:00 2007
New Revision: 5434
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5434&view=rev
Log:
short overview of created binaries
Added:
trunk/libzypp/devel/devel.dmacvicar/README
Added: trunk/libzypp/devel/devel.dmacvicar/README
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/RE…
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/README (added)
+++ trunk/libzypp/devel/devel.dmacvicar/README Mon Apr 23 15:51:00 2007
@@ -0,0 +1,33 @@
+Running 'make' in this directory will create
+
+- cachedsource
+ Reads the database (from zypp.db) and creates all resolvables
+ in memory.
+ Used to time read and create
+
+- cachestore
+ Inserts capabilities (from external text file) into database.
+ Used to time insert.
+
+- mediaaccess
+ N/A
+
+- scansource
+ Downloads and parses a repository. To test repository integrity.
+
+- susetags-downloader
+ Used to download metadata from a 'susetags' source
+ See http://en.opensuse.org/Libzypp/Metadata/YaST
+
+ run as "susetags-downloader <uri> <cachedir>"
+
+- tagsparser
+ Parses 'susetags' metadata and writes it into database.
+
+- yum-downloader
+ Used to download metadata from a 'rpm-md' source
+ See http://en.opensuse.org/Standards/Rpm_Metadata
+
+ run as "yum-downloader <uri> <cachedir>"
+
+
--
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] r5433 - in /trunk/libzypp/devel/devel.dmacvicar: SourceManager.cc SourceManager.h
by dmacvicar@svn.opensuse.org 23 Apr '07
by dmacvicar@svn.opensuse.org 23 Apr '07
23 Apr '07
Author: dmacvicar
Date: Mon Apr 23 13:30:20 2007
New Revision: 5433
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5433&view=rev
Log:
backup
Modified:
trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc
trunk/libzypp/devel/devel.dmacvicar/SourceManager.h
Modified: trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/So…
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc (original)
+++ trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc Mon Apr 23 13:30:20 2007
@@ -0,0 +1,3 @@
+
+#include "SourceManager.h"
+
Modified: trunk/libzypp/devel/devel.dmacvicar/SourceManager.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/So…
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/SourceManager.h (original)
+++ trunk/libzypp/devel/devel.dmacvicar/SourceManager.h Mon Apr 23 13:30:20 2007
@@ -1,3 +1,19 @@
#ifndef ZYPP_NEW_SOURCEMANAGER_H
-#define ZYPP_NEW_SOURCEMANAGER_H
\ No newline at end of file
+#define ZYPP_NEW_SOURCEMANAGER_H
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/NonCopyable.h"
+#include "zypp/Pathname.h"
+
+namespace zypp2
+{
+
+ class SourceManager : public base::ReferenceCounted, private base::NonCopyable
+ {
+ friend std::ostream & operator<<( std::ostream & str, const SourceManager & obj );
+ };
+
+
+}
+#endif
\ No newline at end of file
--
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] r5432 - in /trunk/libzypp/tests/parser: CMakeLists.txt inifile/ inifile/CMakeLists.txt inifile/data/ inifile/data/1.ini inifile/iniparser_test.cc
by dmacvicar@svn.opensuse.org 23 Apr '07
by dmacvicar@svn.opensuse.org 23 Apr '07
23 Apr '07
Author: dmacvicar
Date: Mon Apr 23 13:14:36 2007
New Revision: 5432
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5432&view=rev
Log:
skeleton test for inifile
Added:
trunk/libzypp/tests/parser/inifile/
trunk/libzypp/tests/parser/inifile/CMakeLists.txt
trunk/libzypp/tests/parser/inifile/data/
trunk/libzypp/tests/parser/inifile/data/1.ini
trunk/libzypp/tests/parser/inifile/iniparser_test.cc
Modified:
trunk/libzypp/tests/parser/CMakeLists.txt
Modified: trunk/libzypp/tests/parser/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/CMakeLists.…
==============================================================================
--- trunk/libzypp/tests/parser/CMakeLists.txt (original)
+++ trunk/libzypp/tests/parser/CMakeLists.txt Mon Apr 23 13:14:36 2007
@@ -1 +1,2 @@
-ADD_SUBDIRECTORY( yum )
\ No newline at end of file
+ADD_SUBDIRECTORY( yum )
+ADD_SUBDIRECTORY( inifile )
\ No newline at end of file
Added: trunk/libzypp/tests/parser/inifile/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/CMa…
==============================================================================
--- trunk/libzypp/tests/parser/inifile/CMakeLists.txt (added)
+++ trunk/libzypp/tests/parser/inifile/CMakeLists.txt Mon Apr 23 13:14:36 2007
@@ -0,0 +1,4 @@
+ADD_EXECUTABLE( inifile iniparser_test.cc )
+TARGET_LINK_LIBRARIES( inifile zypp boost_unit_test_framework )
+
+ADD_TEST(inifile ${CMAKE_CURRENT_BINARY_DIR}/inifile ${CMAKE_CURRENT_SOURCE_DIR}/data )
Added: trunk/libzypp/tests/parser/inifile/data/1.ini
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/dat…
==============================================================================
--- trunk/libzypp/tests/parser/inifile/data/1.ini (added)
+++ trunk/libzypp/tests/parser/inifile/data/1.ini Mon Apr 23 13:14:36 2007
@@ -0,0 +1,54 @@
+[base]
+name=CentOS-$releasever - Base
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=1
+
+#released updates
+[update]
+name=CentOS-$releasever - Updates
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
+#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=1
+
+#packages used/produced in the build but not released
+[addons]
+name=CentOS-$releasever - Addons
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
+#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
+#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-$releasever - Plus
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
+#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0
+
+#contrib - packages by Centos Users
+[contrib]
+name=CentOS-$releasever - Contrib
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
+#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0
\ No newline at end of file
Added: trunk/libzypp/tests/parser/inifile/iniparser_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/ini…
==============================================================================
--- trunk/libzypp/tests/parser/inifile/iniparser_test.cc (added)
+++ trunk/libzypp/tests/parser/inifile/iniparser_test.cc Mon Apr 23 13:14:36 2007
@@ -0,0 +1,52 @@
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <list>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/parameterized_test.hpp>
+#include <boost/test/unit_test_log.hpp>
+
+#include "zypp/parser/inifile/ini_file.hpp"
+#include "zypp/Url.h"
+#include "zypp/PathInfo.h"
+
+using std::cout;
+using std::endl;
+using std::string;
+using namespace zypp;
+using namespace boost::unit_test;
+
+
+void ini_read_test(const string &dir)
+{
+
+}
+
+test_suite*
+init_unit_test_suite( int argc, char *argv[] )
+{
+ string datadir;
+ if (argc < 2)
+ {
+ datadir = TESTS_SRC_DIR;
+ datadir = (Pathname(datadir) + "/parser/inifile/data").asString();
+ cout << "inifile_test:"
+ " path to directory with test data required as parameter. Using " << datadir << endl;
+ //return (test_suite *)0;
+
+ }
+ else
+ {
+ datadir = argv[1];
+ }
+
+ test_suite* test= BOOST_TEST_SUITE("ini_file");
+
+ std::string const params[] = { datadir };
+ test->add(BOOST_PARAM_TEST_CASE(&ini_read_test,
+ (std::string const*)params, params+1));
+ return test;
+}
+
+// vim: set ts=2 sts=2 sw=2 ai et:
--
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] r5431 - in /trunk/libzypp-bindings: ./ cmake/ cmake/modules/ examples/ examples/ruby/ package/ swig/
by dmacvicar@svn.opensuse.org 22 Apr '07
by dmacvicar@svn.opensuse.org 22 Apr '07
22 Apr '07
Author: dmacvicar
Date: Sun Apr 22 21:44:49 2007
New Revision: 5431
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5431&view=rev
Log:
attempt to create generated bindings for
libzypp. Not restricted to one language.
Added:
trunk/libzypp-bindings/
trunk/libzypp-bindings/CMakeLists.txt
trunk/libzypp-bindings/README
trunk/libzypp-bindings/VERSION.cmake
trunk/libzypp-bindings/cmake/
trunk/libzypp-bindings/cmake/modules/
trunk/libzypp-bindings/examples/
trunk/libzypp-bindings/examples/ruby/
trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb
trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb
trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb
trunk/libzypp-bindings/examples/ruby/test.rb
trunk/libzypp-bindings/examples/ruby/test2.rb
trunk/libzypp-bindings/package/
trunk/libzypp-bindings/swig/
trunk/libzypp-bindings/swig/Arch.i
trunk/libzypp-bindings/swig/ByteCount.i
trunk/libzypp-bindings/swig/CMakeLists.txt
trunk/libzypp-bindings/swig/CapFactory.i
trunk/libzypp-bindings/swig/CapMatch.i
trunk/libzypp-bindings/swig/Capability.i
trunk/libzypp-bindings/swig/CheckSum.i
trunk/libzypp-bindings/swig/Date.i
trunk/libzypp-bindings/swig/Dep.i
trunk/libzypp-bindings/swig/Dependencies.i
trunk/libzypp-bindings/swig/Edition.i
trunk/libzypp-bindings/swig/KeyRing.i
trunk/libzypp-bindings/swig/Kind.i
trunk/libzypp-bindings/swig/MediaSetAccess.i
trunk/libzypp-bindings/swig/NVR.i
trunk/libzypp-bindings/swig/NVRA.i
trunk/libzypp-bindings/swig/NVRAD.i
trunk/libzypp-bindings/swig/OnMediaLocation.i
trunk/libzypp-bindings/swig/Package.i
trunk/libzypp-bindings/swig/Pathname.i
trunk/libzypp-bindings/swig/PoolItem.i
trunk/libzypp-bindings/swig/ResObject.i
trunk/libzypp-bindings/swig/ResPool.i
trunk/libzypp-bindings/swig/ResStatus.i
trunk/libzypp-bindings/swig/ResStore.i
trunk/libzypp-bindings/swig/Resolvable.i
trunk/libzypp-bindings/swig/Source.i
trunk/libzypp-bindings/swig/SourceFactory.i
trunk/libzypp-bindings/swig/Target.i
trunk/libzypp-bindings/swig/TranslatedText.i
trunk/libzypp-bindings/swig/Url.i
trunk/libzypp-bindings/swig/ZYppCommitPolicy.i
trunk/libzypp-bindings/swig/ZYppCommitResult.i
trunk/libzypp-bindings/swig/ZYppFactory.i
trunk/libzypp-bindings/swig/python.i
trunk/libzypp-bindings/swig/ruby.i
trunk/libzypp-bindings/swig/zypp.i
trunk/libzypp-bindings/zypp-bindings.spec.cmake
Added: trunk/libzypp-bindings/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/CMakeLists.txt?…
==============================================================================
--- trunk/libzypp-bindings/CMakeLists.txt (added)
+++ trunk/libzypp-bindings/CMakeLists.txt Sun Apr 22 21:44:49 2007
@@ -0,0 +1,53 @@
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ${CMAKE_MODULE_PATH})
+
+INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake)
+SET ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
+
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Language Bindings for libzypp")
+SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
+#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
+
+SET( CPACK_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_PACKAGE_FILE_NAME "zypp-bindings-${VERSION}" )
+
+# The following components are regex's to match anywhere (unless anchored)
+# in absolute path + filename to find files or directories to be excluded
+# from source tarball.
+SET (CPACK_SOURCE_IGNORE_FILES
+"/CVS/;/.svn/;/.libs/;/.deps/;.swp$;.#;/#;/build/"
+"~$"
+"\\\\.cvsignore$"
+"/package"
+"Makefile\\\\.in$"
+)
+
+INCLUDE(CPack)
+
+#FIND_PACKAGE(SWIG REQUIRED)
+
+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
+)
+
+IF ( NOT SWIG_EXECUTABLE )
+ MESSAGE( FATAL "SWIG not found." )
+ELSE ( NOT SWIG_EXECUTABLE )
+ MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" )
+ENDIF ( NOT SWIG_EXECUTABLE )
+
+FIND_PACKAGE(Zypp REQUIRED)
+FIND_PACKAGE(Ruby REQUIRED)
+
+#RUBY_RUBY_LIB_PATH
+MESSAGE( STATUS "Ruby arch dir: ${RUBY_ARCH_DIR}" )
+
+ADD_SUBDIRECTORY(swig)
\ No newline at end of file
Added: trunk/libzypp-bindings/README
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/README?rev=5431…
==============================================================================
--- trunk/libzypp-bindings/README (added)
+++ trunk/libzypp-bindings/README Sun Apr 22 21:44:49 2007
@@ -0,0 +1,33 @@
+
+attempt to create generated bindings for
+libzypp. Not restricted to one language.
+
+author: dmacvicar(a)suse.de
+
+Notes:
+
+- Some classes are not wrapped but converted to
+ equivalents:
+
+Usage:
+
+Requires swig and ruby installed.
+
+make -f Makefile.swig
+ruby extconf.rb
+make
+ruby test.rb
+
+Ruby Notes
+==========
+
+* API tries to follow ruby standards:
+* zypp::Pathname -> std Pathname in ruby
+* zypp::Date -> std Time in ruby
+* ResStore does not implement iterators but:
+ * each
+ * each_by_name
+ * etc
+* lower case methods, ie: ZYppFactory::instance.get_zypp
+ instead of ZYppFactory::instance()->getZYpp()
+ z.initialize_target("/") for z.initializeTarget("/")
Added: trunk/libzypp-bindings/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/VERSION.cmake?r…
==============================================================================
--- trunk/libzypp-bindings/VERSION.cmake (added)
+++ trunk/libzypp-bindings/VERSION.cmake Sun Apr 22 21:44:49 2007
@@ -0,0 +1,3 @@
+SET(VERSION_MAJOR "0")
+SET(VERSION_MINOR "2")
+SET(VERSION_PATCH "0")
\ No newline at end of file
Added: trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/l…
==============================================================================
--- trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb (added)
+++ trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb Sun Apr 22 21:44:49 2007
@@ -0,0 +1,12 @@
+
+require 'rzypp'
+include Rzypp
+
+z = ZYppFactory::instance.get_zypp
+
+t = z.initialize_target("/")
+r = z.target.resolvables
+puts r.class
+r.each do | p |
+ puts "#{p.name} #{p.edition}"
+end
Added: trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/m…
==============================================================================
--- trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb (added)
+++ trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb Sun Apr 22 21:44:49 2007
@@ -0,0 +1,13 @@
+
+require 'rzypp'
+include Rzypp
+
+a = MediaSetAccess.new("http://dist.suse.de/install/stable-x86", "/")
+p = a.provide_file("/content", 1)
+puts p.class
+File.open(p, 'r') do | f |
+ f.each_line do |l|
+ puts l
+ end
+end
+
Added: trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/p…
==============================================================================
--- trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb (added)
+++ trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb Sun Apr 22 21:44:49 2007
@@ -0,0 +1,21 @@
+
+require 'rzypp'
+include Rzypp
+
+z = ZYppFactory::instance.get_zypp
+
+t = z.initialize_target("/")
+r = z.target.resolvables
+puts r.class
+
+p = z.pool
+puts p.class
+
+z.add_resolvables r
+p.each do | pi |
+ puts "a poolitem: #{pi} status: #{pi.status} res: #{pi.resolvable}"
+ puts pi.methods
+ exit
+end
+
+
Added: trunk/libzypp-bindings/examples/ruby/test.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/t…
==============================================================================
--- trunk/libzypp-bindings/examples/ruby/test.rb (added)
+++ trunk/libzypp-bindings/examples/ruby/test.rb Sun Apr 22 21:44:49 2007
@@ -0,0 +1,24 @@
+
+require 'rzypp'
+include Rzypp
+
+a = Arch.new("i386")
+puts a.inspect
+#exit
+
+z = ZYppFactory::instance.get_zypp
+
+puts z.inspect
+puts z.architecture.to_s
+
+puts z.home_path
+puts z.home_path.class
+
+t = z.initialize_target("/")
+r = z.target.resolvables
+puts r.class
+r.each do | p |
+ puts "#{p.name} #{p.edition}"
+end
+
+#puts z.methods
Added: trunk/libzypp-bindings/examples/ruby/test2.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/t…
==============================================================================
--- trunk/libzypp-bindings/examples/ruby/test2.rb (added)
+++ trunk/libzypp-bindings/examples/ruby/test2.rb Sun Apr 22 21:44:49 2007
@@ -0,0 +1,19 @@
+
+require 'rzypp'
+require 'pathname'
+
+include Rzypp
+
+z = ZYppFactory::instance.get_zypp
+
+#puts z.homePath.class
+#z.setHomePath("/home")
+
+z.initialize_target("/")
+t = z.target
+puts z.target.class
+#r = z.target.resolvables
+puts t.class
+#puts t.methods
+
+
Added: trunk/libzypp-bindings/swig/Arch.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Arch.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/Arch.i (added)
+++ trunk/libzypp-bindings/swig/Arch.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,35 @@
+
+typedef std::set<Arch,CompareByGT<Arch> > CompatSet;
+
+%ignore Arch::compare(const Arch &, const Arch &);
+
+class Arch
+{
+public:
+ //Arch();
+ Arch( const std::string & rhs );
+ const std::string & asString() const;
+ bool empty() const;
+ bool compatibleWith( const Arch & targetArch_r ) const;
+ int compare( const Arch & rhs ) const;
+ static int compare( const Arch & lhs, const Arch & rhs );
+ //static std::string asString( const CompatSet & cset );
+ struct CompatEntry;
+private:
+ Arch( const CompatEntry & );
+ const CompatEntry * _entry;
+};
+
+extern const Arch Arch_noarch;
+extern const Arch Arch_x86_64;
+extern const Arch Arch_athlon;
+extern const Arch Arch_i686;
+extern const Arch Arch_i586;
+extern const Arch Arch_i486;
+extern const Arch Arch_i386;
+extern const Arch Arch_s390x;
+extern const Arch Arch_s390;
+extern const Arch Arch_ppc64;
+extern const Arch Arch_ppc;
+extern const Arch Arch_ia64;
+
Added: trunk/libzypp-bindings/swig/ByteCount.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ByteCount.…
==============================================================================
--- trunk/libzypp-bindings/swig/ByteCount.i (added)
+++ trunk/libzypp-bindings/swig/ByteCount.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,10 @@
+
+%typemap(in) ByteCount {
+ ByteCount::SizeType bytes = (Date::SizeType) NUM2LONG( rb_funcall( $input, rb_intern("to_i"), 0, 0) );
+ $1 = ByteCount(bytes);
+}
+
+%typemap(out) ByteCount {
+ VALUE rbbytenum = INT2NUM( (ByteCount::SizeType) $1 );
+ return rbbytenum;
+}
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/CMakeLists…
==============================================================================
--- trunk/libzypp-bindings/swig/CMakeLists.txt (added)
+++ trunk/libzypp-bindings/swig/CMakeLists.txt Sun Apr 22 21:44:49 2007
@@ -0,0 +1,28 @@
+
+SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
+SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
+
+ADD_CUSTOM_COMMAND (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx
+ COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code..."
+#COMMAND ${SWIG_EXECUTABLE} -c++ -ruby -autorename -xmlout parse.xml -I/usr/include swig/zypp.i
+ COMMAND ${SWIG_EXECUTABLE} -c++ -ruby -autorename -xmlout ${CMAKE_CURRENT_BINARY_DIR}/parse.xml -o ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx -I${ZYPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/zypp.i
+ COMMAND ${CMAKE_COMMAND} -E echo "Done."
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/zypp.i
+)
+
+ADD_CUSTOM_TARGET( glue
+ DEPENDS ${SWIG_OUTPUT}
+)
+
+ADD_LIBRARY( rzypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
+SET_TARGET_PROPERTIES( rzypp PROPERTIES PREFIX "" )
+ADD_DEPENDENCIES( rzypp glue )
+
+INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} )
+INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} )
+TARGET_LINK_LIBRARIES( rzypp ${ZYPP_LIBRARY} )
+TARGET_LINK_LIBRARIES( rzypp ${RUBY_LIBRARY} )
+
+INSTALL(TARGETS rzypp LIBRARY DESTINATION ${RUBY_ARCH_DIR} )
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/CapFactory.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/CapFactory…
==============================================================================
--- trunk/libzypp-bindings/swig/CapFactory.i (added)
+++ trunk/libzypp-bindings/swig/CapFactory.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,57 @@
+
+class CapFactory
+ {
+ friend std::ostream & operator<<( std::ostream & str, const CapFactory & obj );
+
+ public:
+ /** Default ctor */
+ CapFactory();
+
+ /** Dtor */
+ ~CapFactory();
+
+ public:
+ /** Parse Capability from string providing Resolvable::Kind.
+ * \a strval_r is expected to define a valid Capability.
+ * \throw EXCEPTION on parse error.
+ */
+ Capability parse( const Resolvable::Kind & refers_r,
+ const std::string & strval_r ) const;
+
+
+ /** Parse Capability providing Resolvable::Kind, name, Rel and Edition as strings.
+ * \throw EXCEPTION on parse error.
+ */
+ Capability parse( const Resolvable::Kind & refers_r,
+ const std::string & name_r,
+ const std::string & op_r,
+ const std::string & edition_r ) const;
+
+ /** Parse Capability providing Resolvable::Kind, name, Rel and Edition.
+ * \throw EXCEPTION on parse error.
+ */
+ Capability parse( const Resolvable::Kind & refers_r,
+ const std::string & name_r,
+ Rel op_r,
+ const Edition & edition_r ) const;
+
+ /** Special Capability, triggering evaluation of Hal
+ * capabilities when matched.
+ */
+ Capability halEvalCap() const;
+
+ /** Special Capability, triggering evaluation of modalias
+ * capabilities when matched.
+ */
+ Capability modaliasEvalCap() const;
+
+ public:
+ /** Provide a parsable string representation of \a cap_r. */
+ std::string encode( const Capability & cap_r ) const;
+
+ private:
+ /** Implementation */
+ struct Impl;
+ /** Pointer to implementation */
+ RW_pointer<Impl> _pimpl;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/CapMatch.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/CapMatch.i…
==============================================================================
--- trunk/libzypp-bindings/swig/CapMatch.i (added)
+++ trunk/libzypp-bindings/swig/CapMatch.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,57 @@
+
+class CapMatch
+ {
+ enum Result { NOMATCH, MATCH, IRRELEVANT };
+
+ public:
+
+ CapMatch( bool val_r )
+ : _result( val_r ? MATCH : NOMATCH )
+ {}
+
+ static const CapMatch yes;
+ static const CapMatch no;
+ static const CapMatch irrelevant;
+
+ friend bool operator==( const CapMatch & lhs, const CapMatch & rhs )
+ { return lhs._result == rhs._result; }
+
+ friend bool operator!=( const CapMatch & lhs, const CapMatch & rhs )
+ { return lhs._result != rhs._result; }
+
+ friend CapMatch operator!( const CapMatch & lhs )
+ {
+ if ( lhs._result == CapMatch::IRRELEVANT )
+ return lhs;
+ return !(lhs._result == CapMatch::MATCH);
+ }
+
+ friend CapMatch operator&&( const CapMatch & lhs, const CapMatch & rhs )
+ {
+ if ( lhs._result == CapMatch::IRRELEVANT )
+ return rhs;
+ if ( rhs._result == CapMatch::IRRELEVANT )
+ return lhs;
+ return (lhs._result == CapMatch::MATCH)
+ && (rhs._result == CapMatch::MATCH);
+ }
+
+ friend CapMatch operator||( const CapMatch & lhs, const CapMatch & rhs )
+ {
+ if ( lhs._result == CapMatch::IRRELEVANT )
+ return rhs;
+ if ( rhs._result == CapMatch::IRRELEVANT )
+ return lhs;
+ return (lhs._result == CapMatch::MATCH)
+ || (rhs._result == CapMatch::MATCH);
+ }
+
+ friend std::ostream & operator<<( std::ostream & str, const CapMatch & obj );
+
+ private:
+ CapMatch()
+ : _result( IRRELEVANT )
+ {}
+
+ Result _result;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Capability.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Capability…
==============================================================================
--- trunk/libzypp-bindings/swig/Capability.i (added)
+++ trunk/libzypp-bindings/swig/Capability.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,83 @@
+
+class Capability
+ {
+ public:
+ /** */
+ typedef capability::CapabilityTraits::KindType Kind;
+
+ public:
+ /** DefaultCtor creating \ref noCap. */
+ Capability();
+
+ /** Dtor */
+ virtual ~Capability();
+
+ /** Constant representing no Capabiliy.
+ * It refers to no kind of Resolvable, and matches returns
+ * returns \c CapMatch::irrelevant.
+ */
+ static const Capability noCap;
+
+ public:
+ /** Kind of Capability. */
+ const Kind & kind() const;
+
+ /** Kind of Resolvable the Capability refers to. */
+ const Resolvable::Kind & refers() const;
+
+ /** Whether to consider this Capability.
+ * Evaluates the Capabilities pre-condition (if any), and
+ * returns whether the condition applies. If not, the Capability
+ * is to be ignored.
+ */
+ bool relevant() const;
+
+ /** Return whether the Capabilities match.
+ * If either Capability is not \ref relevant, CapMatch::irrelevant
+ * is returned.
+ */
+ CapMatch matches( const Capability & rhs ) const;
+
+ /** More or less human readable representation as string. */
+ std::string asString() const;
+
+ /** 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 ;
+ typedef capability::CapabilityImpl_constPtr Impl_constPtr;
+
+ /** Factory */
+ friend class CapFactory;
+
+ /** Factory ctor */
+ explicit
+ Capability( Impl_Ptr impl_r );
+
+ private:
+ /** */
+ friend class capability::CapabilityImpl;
+ /** Pointer to implementation */
+ RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ template<class _Cap>
+ inline bool isKind( const Capability & cap )
+ { return cap.kind() == capability::CapTraits<_Cap>::kind; }
+
+ ///////////////////////////////////////////////////////////////////
+
+ /** Ordering relation used by ::CapSet. */
+ struct CapOrder : public std::binary_function<Capability, Capability, bool>
+ {
+ bool operator()( const Capability & lhs, const Capability & rhs ) const
+ { return lhs._pimpl.get() < rhs._pimpl.get(); }
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/CheckSum.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/CheckSum.i…
==============================================================================
--- trunk/libzypp-bindings/swig/CheckSum.i (added)
+++ trunk/libzypp-bindings/swig/CheckSum.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,45 @@
+
+class CheckSum
+ {
+ public:
+ /**
+ * Creates a checksum for algorithm \param type
+ * \throws if the checksum is invalid and can't be constructed
+ */
+ CheckSum( const std::string & type, const std::string & checksum);
+ CheckSum( const std::string & type, std::istream & input_r );
+ CheckSum();
+
+ public:
+ static const std::string & md5Type();
+ static const std::string & shaType();
+ static const std::string & sha1Type();
+ static const std::string & sha256Type();
+
+ static CheckSum md5( const std::string & checksum )
+ { return CheckSum( md5Type(), checksum); }
+ static CheckSum sha( const std::string & checksum )
+ { return CheckSum( shaType(), checksum); }
+ static CheckSum sha1( const std::string & checksum )
+ { return CheckSum( sha1Type(), checksum); }
+ static CheckSum sha256( const std::string & checksum )
+ { return CheckSum( sha256Type(), checksum); }
+
+ static CheckSum md5( std::istream & input_r )
+ { return CheckSum( md5Type(), input_r ); }
+ static CheckSum sha( std::istream & input_r )
+ { return CheckSum( sha1Type(), input_r ); }
+ static CheckSum sha1( std::istream & input_r )
+ { return CheckSum( sha1Type(), input_r ); }
+ static CheckSum sha256( std::istream & input_r )
+ { return CheckSum( sha256Type(), input_r ); }
+
+ public:
+ std::string type() const;
+ std::string checksum() const;
+ bool empty() const;
+
+ private:
+ std::string _type;
+ std::string _checksum;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Date.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Date.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/Date.i (added)
+++ trunk/libzypp-bindings/swig/Date.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,12 @@
+
+%typemap(rubyin) Date {
+ Date::ValueType seconds = (Date::ValueType) NUM2INT( rb_funcall( $input, rb_intern("to_i"), 0, 0) );
+ $1 = Date(seconds);
+}
+
+%typemap(rubyout) Date {
+ // Time works without require
+ VALUE klass = rb_const_get( rb_cObject, rb_intern("Time"));
+ VALUE rbtimenum = INT2NUM( (Date::ValueType) $1 );
+ $result = rb_funcall( klass, rb_intern("at"), 1, rbtimenum);
+}
Added: trunk/libzypp-bindings/swig/Dep.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Dep.i?rev=…
==============================================================================
--- trunk/libzypp-bindings/swig/Dep.i (added)
+++ trunk/libzypp-bindings/swig/Dep.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,64 @@
+
+struct Dep
+ {
+ /** \name Dependency types
+ * These are the \em real dependency type contants to
+ * use. Don't mind that it's not an enum.
+ * \see \ref zypp::Dep::inSwitch
+ */
+ //@{
+ static const Dep PROVIDES;
+ static const Dep PREREQUIRES;
+ static const Dep REQUIRES;
+ static const Dep CONFLICTS;
+ static const Dep OBSOLETES;
+ static const Dep RECOMMENDS;
+ static const Dep SUGGESTS;
+ static const Dep FRESHENS;
+ static const Dep ENHANCES;
+ static const Dep SUPPLEMENTS;
+ //@}
+
+ /** Enumarators provided \b only for use \ref inSwitch statement.
+ * \see inSwitch
+ */
+ enum for_use_in_switch {
+ PROVIDES_e,
+ PREREQUIRES_e,
+ REQUIRES_e,
+ CONFLICTS_e,
+ OBSOLETES_e,
+ RECOMMENDS_e,
+ SUGGESTS_e,
+ FRESHENS_e,
+ ENHANCES_e,
+ SUPPLEMENTS_e,
+ };
+
+ /** Ctor from string.
+ * Legal values for \a strval_r are the constants names
+ * (case insignificant).
+ *
+ * \throw PARSE if \a strval_r is not legal.
+ * \todo refine exceptions and check throw.
+ */
+ explicit
+ Dep( const std::string & strval_r );
+
+ /** String representation of dependency type.
+ * \return The constants names lowercased.
+ */
+ const std::string & asString() const;
+
+ /** Enumarator provided for use in \c switch statement. */
+ for_use_in_switch inSwitch() const
+ { return _type; }
+
+ private:
+ /** Ctor to initialize the dependency type contants. */
+ Dep( for_use_in_switch type_r )
+ : _type( type_r )
+ {}
+ /** The operator. */
+ for_use_in_switch _type;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Dependencies.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Dependenci…
==============================================================================
--- trunk/libzypp-bindings/swig/Dependencies.i (added)
+++ trunk/libzypp-bindings/swig/Dependencies.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,14 @@
+
+%ignore Dependencies::operator[];
+
+struct Dependencies
+ {
+ CapSet & operator[]( Dep idx_r )
+ { return _capsets[idx_r]; }
+
+ const CapSet & operator[]( Dep idx_r ) const
+ { return const_cast<std::map<Dep,CapSet>&>(_capsets)[idx_r]; }
+
+ private:
+ std::map<Dep,CapSet> _capsets;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Edition.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Edition.i?…
==============================================================================
--- trunk/libzypp-bindings/swig/Edition.i (added)
+++ trunk/libzypp-bindings/swig/Edition.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,32 @@
+
+class Edition
+{
+ public:
+ typedef unsigned epoch_t;
+ static const epoch_t noepoch = 0;
+ static const Edition noedition;
+ public:
+ Edition();
+
+ Edition( const std::string & edition_r );
+ Edition( const std::string & version_r,
+ const std::string & release_r,
+ epoch_t epoch_r = noepoch );
+ Edition( const std::string & version_r,
+ const std::string & release_r,
+ const std::string & epoch_r );
+ ~Edition();
+ public:
+ epoch_t epoch() const;
+ const std::string & version() const;
+ const std::string & release() const;
+ std::string asString() const;
+ public:
+ static int compare( const Edition & lhs, const Edition & rhs );
+ int compare( const Edition & rhs ) const;
+ typedef Compare<Edition> Compare;
+ typedef Range<Edition> CompareRange;
+ public:
+ static int match( const Edition & lhs, const Edition & rhs );
+ int match( const Edition & rhs ) const;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/KeyRing.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/KeyRing.i?…
==============================================================================
--- trunk/libzypp-bindings/swig/KeyRing.i (added)
+++ trunk/libzypp-bindings/swig/KeyRing.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,20 @@
+
+ class KeyRing
+ {
+ public:
+ KeyRing(const Pathname &baseTmpDir);
+ void importKey( const PublicKey &key, bool trusted = false);
+ void dumpTrustedPublicKey( const std::string &id, std::ostream &stream );
+ void dumpUntrustedPublicKey( const std::string &id, std::ostream &stream );
+ void dumpPublicKey( const std::string &id, bool trusted, std::ostream &stream );
+ std::string readSignatureKeyId( const Pathname &signature );
+ bool isKeyTrusted( const std::string &id);
+ bool isKeyKnown( const std::string &id );
+ void deleteKey( const std::string &id, bool trusted = false);
+ std::list<PublicKey> publicKeys();
+ std::list<PublicKey> trustedPublicKeys();
+ bool verifyFileSignatureWorkflow( const Pathname &file, const std::string filedesc, const Pathname &signature);
+ bool verifyFileSignature( const Pathname &file, const Pathname &signature);
+ bool verifyFileTrustedSignature( const Pathname &file, const Pathname &signature);
+ ~KeyRing();
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Kind.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Kind.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/Kind.i (added)
+++ trunk/libzypp-bindings/swig/Kind.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,40 @@
+
+%typemap(in) Resolvable::Kind {
+
+ VALUE kindstring = rb_funcall( $input, rb_intern("to_s"), 0, 0);
+ kindstring = rb_funcall( kindstring, rb_intern("downcase"), 0, 0);
+ std::string s(RSTRING(pathstring)->ptr);
+
+ // FIXME make the string lowercase first
+
+ if ( s == "patch" )
+ {
+ $1 == Patch::Kind;
+ }
+ if ( s == "package" )
+ {
+ $1 == Package::Kind;
+ }
+ if ( s == "script" )
+ {
+ $1 == Script::Kind;
+ }
+ if ( s == "message" )
+ {
+ $1 == Message::Kind;
+ }
+ if ( s == "pattern" )
+ {
+ $1 == Pattern::Kind;
+ }
+ if ( s == "Selection" )
+ {
+ $1 == Selection::Kind;
+ }
+
+}
+
+%typemap(out) Kind {
+ const char *s = $1.asString().c_str();
+ $result = ID2SYM(rb_intern(s));
+}
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/MediaSetAccess.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/MediaSetAc…
==============================================================================
--- trunk/libzypp-bindings/swig/MediaSetAccess.i (added)
+++ trunk/libzypp-bindings/swig/MediaSetAccess.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,19 @@
+
+class MediaSetAccess
+{
+ friend std::ostream & operator<<( std::ostream & str, const MediaSetAccess & obj );
+
+ public:
+ /**
+ * creates a callback enabled media access for \param url and \param path.
+ * with only 1 media no verified
+ */
+ MediaSetAccess( const Url &url, const Pathname &path );
+ ~MediaSetAccess();
+
+ /**
+ * Sets a verifier for given media number
+ */
+ void setVerifier( unsigned media_nr, media::MediaVerifierRef verifier );
+ Pathname provideFile(const Pathname & file, unsigned media_nr );
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/NVR.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/NVR.i?rev=…
==============================================================================
--- trunk/libzypp-bindings/swig/NVR.i (added)
+++ trunk/libzypp-bindings/swig/NVR.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,33 @@
+ struct NVR
+ {
+ /** Default ctor */
+ NVR()
+ {}
+
+ /** Ctor */
+ explicit
+ NVR( const std::string & name_r,
+ const Edition & edition_r = Edition() )
+ : name( name_r )
+ , edition( edition_r )
+ {}
+
+ /** Ctor from Resolvable::constPtr */
+ explicit
+ NVR( ResTraits<Resolvable>::constPtrType res_r );
+
+ /** */
+ std::string name;
+ /** */
+ Edition edition;
+
+ public:
+ /** Comparison mostly for std::container */
+ static int compare( const NVR & lhs, const NVR & rhs )
+ {
+ int res = lhs.name.compare( rhs.name );
+ if ( res )
+ return res;
+ return lhs.edition.compare( rhs.edition );
+ }
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/NVRA.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/NVRA.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/NVRA.i (added)
+++ trunk/libzypp-bindings/swig/NVRA.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,40 @@
+struct NVRA : public NVR
+ {
+ /** Default ctor */
+ NVRA()
+ {}
+
+ /** Ctor */
+ explicit
+ NVRA( const std::string & name_r,
+ const Edition & edition_r = Edition(),
+ const Arch & arch_r = Arch() )
+ : NVR( name_r, edition_r )
+ , arch( arch_r )
+ {}
+
+ /** Ctor */
+ explicit
+ NVRA( const NVR & nvr_r,
+ const Arch & arch_r = Arch() )
+ : NVR( nvr_r )
+ , arch( arch_r )
+ {}
+
+ /** Ctor from Resolvable::constPtr */
+ explicit
+ NVRA( ResTraits<Resolvable>::constPtrType res_r );
+
+ /** */
+ Arch arch;
+
+ public:
+ /** Comparison mostly for std::container */
+ static int compare( const NVRA & lhs, const NVRA & rhs )
+ {
+ int res = NVR::compare( lhs, rhs );
+ if ( res )
+ return res;
+ return lhs.arch.compare( rhs.arch );
+ }
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/NVRAD.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/NVRAD.i?re…
==============================================================================
--- trunk/libzypp-bindings/swig/NVRAD.i (added)
+++ trunk/libzypp-bindings/swig/NVRAD.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,38 @@
+
+struct NVRAD : public NVRA, public Dependencies
+ {
+ /** Default ctor */
+ NVRAD()
+ {}
+
+ /** Ctor */
+ explicit
+ NVRAD( const std::string & name_r,
+ const Edition & edition_r = Edition(),
+ const Arch & arch_r = Arch(),
+ const Dependencies & deps_r = Dependencies() )
+ : NVRA( name_r, edition_r, arch_r )
+ , Dependencies( deps_r )
+ {}
+
+ /** Ctor */
+ explicit
+ NVRAD( const NVRA & nvra_r,
+ const Dependencies & deps_r = Dependencies() )
+ : NVRA( nvra_r )
+ , Dependencies( deps_r )
+ {}
+
+ /** Ctor from Resolvable::constPtr */
+ explicit
+ NVRAD( const NVR & nvr_r,
+ const Arch & arch_r = Arch(),
+ const Dependencies & deps_r = Dependencies() )
+ : NVRA( nvr_r, arch_r )
+ , Dependencies( deps_r )
+ {}
+
+ /** Ctor */
+ explicit
+ NVRAD( Resolvable::constPtr res_r );
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/OnMediaLocation.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/OnMediaLoc…
==============================================================================
--- trunk/libzypp-bindings/swig/OnMediaLocation.i (added)
+++ trunk/libzypp-bindings/swig/OnMediaLocation.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,29 @@
+
+ class OnMediaLocation
+ {
+ friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
+
+ public:
+ /** Ctor */
+ OnMediaLocation()
+ : _medianr( 1 )
+ {}
+
+ public:
+ unsigned medianr() const { return _medianr; }
+ const Pathname & filename() const { return _filename; }
+ const CheckSum & checksum() const { return _checksum; }
+ const ByteCount & downloadsize() const { return _downloadsize; }
+
+ public:
+ OnMediaLocation & medianr( unsigned val_r ) { _medianr = val_r; return *this; }
+ OnMediaLocation & filename( const Pathname & val_r ) { _filename = val_r; return *this; }
+ OnMediaLocation & checksum( const CheckSum & val_r ) { _checksum = val_r; return *this; }
+ OnMediaLocation & downloadsize( const ByteCount & val_r ) { _downloadsize = val_r; return *this; }
+
+ private:
+ unsigned _medianr;
+ Pathname _filename;
+ CheckSum _checksum;
+ ByteCount _downloadsize;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Package.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Package.i?…
==============================================================================
--- trunk/libzypp-bindings/swig/Package.i (added)
+++ trunk/libzypp-bindings/swig/Package.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,59 @@
+
+ class Package : public ResObject
+ {
+
+ public:
+ typedef detail::PackageImplIf Impl;
+ typedef Package Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ /**
+ * Checksum the source says this package should have
+ */
+ CheckSum checksum() const;
+ /** Get the package change log */
+ Changelog changelog() const;
+ /** */
+ std::string buildhost() const;
+ /** */
+ std::string distribution() const;
+ /** */
+ Label license() const;
+ /** */
+ std::string packager() const;
+ /** */
+ PackageGroup group() const;
+ /** Don't ship it as class Url, because it might be
+ * in fact anything but a legal Url. */
+ std::string url() const;
+ /** */
+ std::string os() const;
+ /** */
+ Text prein() const;
+ /** */
+ Text postin() const;
+ /** */
+ Text preun() const;
+ /** */
+ Text postun() const;
+ /** */
+ ByteCount sourcesize() const;
+ /** */
+ std::list<std::string> authors() const;
+ /** */
+ std::list<std::string> filenames() const;
+
+ /** Disk usage per directory */
+ //DiskUsage diskusage() const;
+
+ /** location in source */
+ Pathname location() const;
+
+ protected:
+ Package( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Package();
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Pathname.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pathname.i…
==============================================================================
--- trunk/libzypp-bindings/swig/Pathname.i (added)
+++ trunk/libzypp-bindings/swig/Pathname.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,17 @@
+
+%typemap(in) const Pathname & {
+ VALUE pathstring = rb_funcall( $input, rb_intern("to_s"), 0, 0);
+ Pathname *p = new Pathname( (RSTRING(pathstring)->ptr) );
+ $1 = p;
+}
+
+%typemap(freearg) const Pathname & {
+ delete $1;
+}
+
+%typemap(out) Pathname {
+ rb_require("pathname");
+ VALUE klass = rb_const_get( rb_cObject, rb_intern("Pathname"));
+ VALUE rbpathstr = rb_str_new2($1.asString().c_str());
+ $result = rb_funcall( klass, rb_intern("new"), 1, rbpathstr);
+}
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/PoolItem.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/PoolItem.i…
==============================================================================
--- trunk/libzypp-bindings/swig/PoolItem.i (added)
+++ trunk/libzypp-bindings/swig/PoolItem.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,68 @@
+
+class PoolItem_Ref
+ {
+ friend std::ostream & operator<<( std::ostream & str, const PoolItem_Ref & obj );
+
+ public:
+ /** Implementation */
+ class Impl;
+
+ public:
+ /** Default ctor for use in std::container. */
+ PoolItem_Ref();
+
+ /** Ctor */
+ explicit
+ PoolItem_Ref( ResObject::constPtr res_r );
+
+ /** Ctor */
+ PoolItem_Ref( ResObject::constPtr res_r, const ResStatus & status_r );
+
+ /** Dtor */
+ ~PoolItem_Ref();
+
+ public:
+ /** Returns the current status. */
+ ResStatus & status() const;
+
+ /** Reset status (applies autoprotection). */
+ ResStatus & statusReset() const;
+
+ /** Returns the ResObject::constPtr.
+ * \see \ref operator->
+ */
+ ResObject::constPtr resolvable() const;
+
+ public:
+ /** Implicit conversion into ResObject::constPtr to
+ * support query filters operating on ResObject.
+ */
+ operator ResObject::constPtr() const
+ { return resolvable(); }
+
+ /** Forward \c -> access to ResObject. */
+ ResObject::constPtr operator->() const
+ { return resolvable(); }
+
+ /** Conversion to bool to allow pointer style tests
+ * for nonNULL \ref resolvable. */
+ operator ResObject::constPtr::unspecified_bool_type() const
+ { return resolvable(); }
+
+ private:
+ /** Pointer to implementation */
+ RW_pointer<Impl> _pimpl;
+
+ private:
+ /** \name tmp hack for save/restore state. */
+ /** \todo get rid of it. */
+ //@{
+ friend class PoolItemSaver;
+ void saveState() const;
+ void restoreState() const;
+ bool sameState() const;
+ //@}
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ typedef PoolItem_Ref PoolItem;
Added: trunk/libzypp-bindings/swig/ResObject.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResObject.…
==============================================================================
--- trunk/libzypp-bindings/swig/ResObject.i (added)
+++ trunk/libzypp-bindings/swig/ResObject.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,32 @@
+
+%template(ResObject_Ptr) intrusive_ptr<ResObject>;
+
+class ResObject : public Resolvable
+ {
+ public:
+ typedef detail::ResObjectImplIf Impl;
+ typedef ResObject Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef intrusive_ptr<ResObject> Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ Text summary() const;
+ Text description() const;
+ Text insnotify() const;
+ Text delnotify() const;
+ Text licenseToConfirm() const;
+ Vendor vendor() const;
+ ByteCount size() const;
+ ByteCount archivesize() const;
+ Source_Ref source() const;
+ unsigned sourceMediaNr() const;
+ bool installOnly() const;
+ Date buildtime() const;
+ Date installtime() const;
+ protected:
+ ResObject( const Kind & kind_r,
+ const NVRAD & nvrad_r );
+ virtual ~ResObject();
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ };
Added: trunk/libzypp-bindings/swig/ResPool.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResPool.i?…
==============================================================================
--- trunk/libzypp-bindings/swig/ResPool.i (added)
+++ trunk/libzypp-bindings/swig/ResPool.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,151 @@
+
+class ResPool
+ {
+ friend std::ostream & operator<<( std::ostream & str, const ResPool & obj );
+
+ public:
+ /** \ref zypp::pool::PoolItem */
+ typedef pool::PoolTraits::Item Item;
+ typedef pool::PoolTraits::size_type size_type;
+ typedef pool::PoolTraits::const_iterator const_iterator;
+ typedef pool::PoolTraits::byName_iterator byName_iterator;
+ typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
+ typedef pool::PoolTraits::AdditionalCapSet AdditionalCapSet;
+
+ public:
+ /** Default ctor: empty pool */
+ ResPool();
+ /** Dtor */
+ ~ResPool();
+
+ public:
+ /** */
+ bool empty() const;
+ /** */
+ size_type size() const;
+
+ public:
+
+ /** \name Iterate through all ResObjects (all kinds). */
+ //@{
+ /**
+ const_iterator begin() const;
+ const_iterator end() const;
+ */
+ //@}
+
+ public:
+ /** \name Iterate through all ResObjects of a certain kind. */
+ //@{
+ typedef resfilter::ByKind ByKind;
+ typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
+
+ /*
+ byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
+ { return make_filter_begin( ByKind(kind_r), *this ); }
+
+ template<class _Res>
+ byKind_iterator byKindBegin() const
+ { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
+
+
+ byKind_iterator byKindEnd( const ResObject::Kind & kind_r ) const
+ { return make_filter_end( ByKind(kind_r), *this ); }
+
+ template<class _Res>
+ byKind_iterator byKindEnd() const
+ { return make_filter_end( resfilter::byKind<_Res>(), *this ); }
+ //@}
+ */
+ public:
+ /** \name Iterate through all ResObjects with a certain name (all kinds). */
+ /*
+ //@{
+ byName_iterator byNameBegin( const std::string & name_r ) const;
+
+ byName_iterator byNameEnd( const std::string & name_r ) const;
+ //@}
+ */
+ public:
+ /** \name Iterate through all ResObjects which have at least
+ * one Capability with index \a index_r in dependency \a depType_r.
+ */
+ /*
+ //@{
+ byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
+
+ byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
+ //@}
+ */
+ public:
+ /** \name Handling addition capabilities in the pool in order for solving it in
+ * a solver run. This is used for tasks like needing a package with the name "foo".
+ * The solver has to evaluate a proper package by his own.
+ *
+ * CAUTION: This has another semantic in the solver. The required resolvable has
+ * been set for installation (in the pool) only AFTER a solver run.
+ */
+
+ /**
+ * Handling additional requirement. E.G. need package "foo" and package
+ * "foo1" which has a greater version than 1.0:
+ *
+ * \code
+ * CapSet capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo1 > 1.0"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapSet aCapSet;
+ * aCapSet[ResStatus::USER] = capset;
+ *
+ * setAdditionalRequire( aCapSet );
+ * \endcode
+ */
+ void setAdditionalRequire( const AdditionalCapSet & capset ) const;
+ AdditionalCapSet & additionalRequire() const;
+
+ /**
+ * Handling additional conflicts. E.G. do not install anything which provides "foo":
+ *
+ * \code
+ * CapSet capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapSet aCapSet;
+ * aCapSet[ResStatus::USER] = capset;
+ *
+ * setAdditionalConflict( aCapSet );
+ * \endcode
+ */
+ void setAdditionalConflict( const AdditionalCapSet & capset ) const;
+ AdditionalCapSet & additionaConflict() const;
+
+ /**
+ * Handling additional provides. This is used for ignoring a requirement.
+ * e.G. Do ignore the requirement "foo":
+ *
+ * \code
+ * CapSet capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapSet aCapSet;
+ * aCapSet[ResStatus::USER] = capset;
+ *
+ * setAdditionalProvide( aCapSet );
+ * \endcode
+ */
+ void setAdditionalProvide( const AdditionalCapSet & capset ) const;
+ AdditionalCapSet & additionaProvide() const;
+
+ private:
+ /** */
+ friend class ResPoolManager;
+ /** Ctor */
+ ResPool( pool::PoolTraits::Impl_constPtr impl_r );
+ private:
+ /** Const access to implementation. */
+ pool::PoolTraits::Impl_constPtr _pimpl;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/ResStatus.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResStatus.…
==============================================================================
--- trunk/libzypp-bindings/swig/ResStatus.i (added)
+++ trunk/libzypp-bindings/swig/ResStatus.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,373 @@
+
+class ResStatus
+ {
+ friend std::ostream & operator<<( std::ostream & str, const ResStatus & obj );
+ friend bool operator==( const ResStatus & lhs, const ResStatus & rhs );
+
+ public:
+ /** \name BitField range definitions.
+ *
+ * \note Enlarge FieldType if more bit's needed. It's not yet
+ * checked by the compiler.
+ */
+ //@{
+ typedef uint16_t FieldType;
+ typedef bit::BitField<FieldType> BitFieldType;
+ // Bit Ranges within FieldType defined by 1st bit and size:
+ typedef bit::Range<FieldType,0, 1> StateField;
+ typedef bit::Range<FieldType,StateField::end, 2> EstablishField;
+ typedef bit::Range<FieldType,EstablishField::end, 2> TransactField;
+ typedef bit::Range<FieldType,TransactField::end, 2> TransactByField;
+ typedef bit::Range<FieldType,TransactByField::end, 3> TransactDetailField;
+ typedef bit::Range<FieldType,TransactDetailField::end, 2> SolverStateField;
+ typedef bit::Range<FieldType,SolverStateField::end, 1> LicenceConfirmedField;
+ // enlarge FieldType if more bit's needed. It's not yet
+ // checked by the compiler.
+ //@}
+ public:
+
+ /** \name Status values.
+ *
+ * Each enum corresponds to a BitField range.
+ * \note Take care that enumerator values actually fit into
+ * the corresponding field. It's not yet checked by the compiler.
+ */
+ //@{
+ enum StateValue
+ {
+ UNINSTALLED = bit::RangeValue<StateField,0>::value,
+ INSTALLED = bit::RangeValue<StateField,1>::value
+ };
+ enum EstablishValue
+ {
+ UNDETERMINED = bit::RangeValue<EstablishField,0>::value,
+ UNNEEDED = bit::RangeValue<EstablishField,1>::value, // has freshens, none trigger
+ SATISFIED = bit::RangeValue<EstablishField,2>::value, // has none or triggered freshens, all requirements fulfilled
+ INCOMPLETE = bit::RangeValue<EstablishField,3>::value // installed: has none or triggered freshens, requirements unfulfilled
+ };
+ enum TransactValue
+ {
+ KEEP_STATE = bit::RangeValue<TransactField,0>::value,
+ LOCKED = bit::RangeValue<TransactField,1>::value, // locked, must not transact
+ TRANSACT = bit::RangeValue<TransactField,2>::value // transact according to state
+ };
+ enum TransactByValue
+ {
+ SOLVER = bit::RangeValue<TransactByField,0>::value,
+ APPL_LOW = bit::RangeValue<TransactByField,1>::value,
+ APPL_HIGH = bit::RangeValue<TransactByField,2>::value,
+ USER = bit::RangeValue<TransactByField,3>::value
+ };
+
+ enum DetailValue
+ {
+ /** Detail for no transact, i.e. reset any Install/RemoveDetailValue. */
+ NO_DETAIL = bit::RangeValue<TransactDetailField,0>::value,
+ };
+
+ enum InstallDetailValue
+ {
+ EXPLICIT_INSTALL = bit::RangeValue<TransactDetailField,0>::value,
+ SOFT_INSTALL = bit::RangeValue<TransactDetailField,1>::value
+ };
+ enum RemoveDetailValue
+ {
+ EXPLICIT_REMOVE = bit::RangeValue<TransactDetailField,0>::value,
+ SOFT_REMOVE = bit::RangeValue<TransactDetailField,1>::value,
+ DUE_TO_OBSOLETE = bit::RangeValue<TransactDetailField,2>::value,
+ DUE_TO_UNLINK = bit::RangeValue<TransactDetailField,3>::value,
+ DUE_TO_UPGRADE = bit::RangeValue<TransactDetailField,4>::value
+ };
+ enum SolverStateValue
+ {
+ NORMAL = bit::RangeValue<SolverStateField,0>::value, // default, notthing special
+ SEEN = bit::RangeValue<SolverStateField,1>::value, // already seen during ResolverUpgrade
+ IMPOSSIBLE = bit::RangeValue<SolverStateField,2>::value // impossible to install
+ };
+
+ enum LicenceConfirmedValue
+ {
+ LICENCE_UNCONFIRMED = bit::RangeValue<LicenceConfirmedField,0>::value,
+ LICENCE_CONFIRMED = bit::RangeValue<LicenceConfirmedField,1>::value
+ };
+ //@}
+
+ public:
+
+ /** Default ctor. */
+ ResStatus();
+
+ /** Ctor setting the initial . */
+ ResStatus( bool isInstalled_r );
+
+ /** Dtor. */
+ ~ResStatus();
+
+ /** Debug helper returning the bitfield.
+ * It's save to expose the bitfield, as it can't be used to
+ * recreate a ResStatus. So it is not possible to bypass
+ * transition rules.
+ */
+ BitFieldType bitfield() const
+ { return _bitfield; }
+
+ public:
+
+ bool isLicenceConfirmed() const
+ { return fieldValueIs<LicenceConfirmedField>( LICENCE_CONFIRMED ); }
+
+ void setLicenceConfirmed( bool toVal_r = true )
+ { fieldValueAssign<LicenceConfirmedField>( toVal_r ? LICENCE_CONFIRMED : LICENCE_UNCONFIRMED ); }
+
+ public:
+ // These two are IMMUTABLE!
+
+ bool isInstalled() const
+ { return fieldValueIs<StateField>( INSTALLED ); }
+
+ bool isUninstalled() const
+ { return fieldValueIs<StateField>( UNINSTALLED ); }
+
+ public:
+
+ bool staysInstalled() const
+ { return isInstalled() && !transacts(); }
+
+ bool wasInstalled() const { return staysInstalled(); } //for old status
+
+ bool isToBeInstalled() const
+ { return isUninstalled() && transacts(); }
+
+ bool staysUninstalled() const
+ { return isUninstalled() && !transacts(); }
+
+ bool wasUninstalled() const { return staysUninstalled(); } // for old status
+
+ bool isToBeUninstalled() const
+ { return isInstalled() && transacts(); }
+
+ bool isUndetermined() const
+ { return fieldValueIs<EstablishField>( UNDETERMINED ); }
+
+ bool isEstablishedUneeded() const
+ { return fieldValueIs<EstablishField>( UNNEEDED ); }
+
+ bool isEstablishedSatisfied() const
+ { return fieldValueIs<EstablishField>( SATISFIED ); }
+
+ bool isEstablishedIncomplete() const
+ { return fieldValueIs<EstablishField>( INCOMPLETE ); }
+
+ bool isUnneeded() const
+ { return isUninstalled() && fieldValueIs<EstablishField>( UNNEEDED ); }
+
+ bool isSatisfied() const
+ { return isUninstalled() && fieldValueIs<EstablishField>( SATISFIED ); }
+
+ bool isComplete () const
+ { return isInstalled() && fieldValueIs<EstablishField>( SATISFIED ); }
+
+ bool isIncomplete() const
+ { return isInstalled() && fieldValueIs<EstablishField>( INCOMPLETE ); }
+
+ bool isNeeded() const
+ { return isUninstalled() && fieldValueIs<EstablishField>( INCOMPLETE ); }
+
+ bool isLocked() const
+ { return fieldValueIs<TransactField>( LOCKED ); }
+
+ bool isKept() const
+ { return fieldValueIs<TransactField>( KEEP_STATE ); }
+
+ bool transacts() const
+ { return fieldValueIs<TransactField>( TRANSACT ); }
+
+ TransactValue getTransactValue() const
+ { return (TransactValue)_bitfield.value<TransactField>(); }
+
+ bool isBySolver() const
+ { return fieldValueIs<TransactByField>( SOLVER ); }
+
+ bool isByApplLow() const
+ { return fieldValueIs<TransactByField>( APPL_LOW ); }
+
+ bool isByApplHigh() const
+ { return fieldValueIs<TransactByField>( APPL_HIGH ); }
+
+ bool isByUser() const
+ { return fieldValueIs<TransactByField>( USER ); }
+
+ TransactByValue getTransactByValue() const
+ { return (TransactByValue)_bitfield.value<TransactByField>(); }
+
+ bool isToBeUninstalledDueToObsolete () const
+ { return isToBeUninstalled() && fieldValueIs<TransactDetailField>( DUE_TO_OBSOLETE ); }
+
+ bool isToBeUninstalledDueToUnlink() const
+ { return isToBeUninstalled() && fieldValueIs<TransactDetailField>( DUE_TO_UNLINK ); }
+
+ bool isToBeUninstalledDueToUpgrade() const
+ { return isToBeUninstalled() && fieldValueIs<TransactDetailField>( DUE_TO_UPGRADE ); }
+
+ bool isToBeInstalledSoft () const
+ { return isToBeInstalled() && fieldValueIs<TransactDetailField>( SOFT_INSTALL ); }
+
+ bool isToBeInstalledNotSoft () const
+ { return isToBeInstalled() && !fieldValueIs<TransactDetailField>( SOFT_INSTALL ); }
+
+
+ bool isToBeUninstalledSoft () const
+ { return isToBeUninstalled() && fieldValueIs<TransactDetailField>( SOFT_REMOVE ); }
+
+ public:
+
+ bool setTransactValue( TransactValue newVal_r, TransactByValue causer_r );
+ bool setLock( bool toLock_r, TransactByValue causer_r );
+ bool maySetLock( bool to_r, TransactByValue causer_r );
+ bool setTransact( bool toTansact_r, TransactByValue causer_r );
+ bool maySetTransact( bool val_r, TransactByValue causer );
+ bool setSoftLock( TransactByValue causer_r );
+ bool resetTransact( TransactByValue causer_r );
+ bool setSoftTransact( bool toTansact_r, TransactByValue causer_r,
+ TransactByValue causerLimit_r );
+ bool setSoftTransact( bool toTansact_r, TransactByValue causer_r );
+ bool maySetSoftTransact( bool val_r, TransactByValue causer,
+ TransactByValue causerLimit_r );
+ bool maySetSoftTransact( bool val_r, TransactByValue causer );
+ bool setToBeInstalled (TransactByValue causer);
+ bool maySetToBeInstalled (TransactByValue causer);
+ bool setToBeUninstalled (TransactByValue causer);
+ bool maySetToBeUninstalled (TransactByValue causer);
+ bool setToBeUninstalledDueToUnlink ( );
+ bool setToBeUninstalledDueToObsolete ( );
+ bool setToBeUninstalledDueToUpgrade ( TransactByValue causer );
+ bool setToBeInstalledSoft ( );
+ bool setToBeUninstalledSoft ( );
+ bool maySetToBeUninstalledSoft ();
+ bool isSoftInstall () {
+ return fieldValueIs<TransactDetailField> (SOFT_INSTALL);
+ }
+
+ bool isSoftUninstall () {
+ return fieldValueIs<TransactDetailField> (SOFT_REMOVE);
+ }
+
+ bool setSoftInstall (bool flag) {
+ fieldValueAssign<TransactDetailField>(flag?SOFT_INSTALL:0);
+ return true;
+ }
+
+ bool setSoftUninstall (bool flag) {
+ fieldValueAssign<TransactDetailField>(flag?SOFT_REMOVE:0);
+ return true;
+ }
+
+ bool setUndetermined ()
+ {
+ fieldValueAssign<EstablishField>(UNDETERMINED);
+ return true;
+ }
+
+ bool setUnneeded ()
+ {
+ fieldValueAssign<EstablishField>(UNNEEDED);
+ return true;
+ }
+
+ bool setSatisfied ()
+ {
+ fieldValueAssign<EstablishField>(SATISFIED);
+ return true;
+ }
+
+ bool setIncomplete ()
+ {
+ fieldValueAssign<EstablishField>(INCOMPLETE);
+ return true;
+ }
+
+ bool isSeen () const
+ { return fieldValueIs<SolverStateField>( SEEN ); }
+
+ bool isImpossible () const
+ { return fieldValueIs<SolverStateField>( IMPOSSIBLE ); }
+
+ bool setSeen (bool value)
+ {
+ fieldValueAssign<SolverStateField>( value ? SEEN : NORMAL );
+ return true;
+ }
+
+ bool setImpossible (bool value)
+ {
+ fieldValueAssign<SolverStateField>( value ? IMPOSSIBLE : NORMAL );
+ return true;
+ }
+
+ bool setStatus( ResStatus newStatus_r )
+ {
+ // State field is immutable!
+ if ( _bitfield.value<StateField>() != newStatus_r._bitfield.value<StateField>() )
+ return false;
+ // Transaction state change allowed?
+ if ( ! setTransactValue( newStatus_r.getTransactValue(), newStatus_r.getTransactByValue() ) )
+ return false;
+
+ // Ok, we take it all..
+ _bitfield = newStatus_r._bitfield;
+ return true;
+ }
+
+ /** \name Builtin ResStatus constants. */
+ //@{
+ static const ResStatus toBeInstalled;
+ static const ResStatus toBeInstalledSoft;
+ static const ResStatus toBeUninstalled;
+ static const ResStatus toBeUninstalledSoft;
+ static const ResStatus toBeUninstalledDueToUnlink;
+ static const ResStatus toBeUninstalledDueToObsolete;
+ static const ResStatus toBeUninstalledDueToUpgrade;
+ static const ResStatus installed; // installed, status after successful target 'install' commit
+ static const ResStatus uninstalled; // uninstalled, status after successful target 'uninstall' commit
+ static const ResStatus satisfied; // uninstalled, satisfied
+ static const ResStatus complete; // installed, satisfied
+ static const ResStatus unneeded; // uninstalled, unneeded
+ static const ResStatus needed; // uninstalled, incomplete
+ static const ResStatus incomplete; // installed, incomplete
+ static const ResStatus impossible; // uninstallable
+ //@}
+
+ private:
+ /** Ctor for intialization of builtin constants. */
+ ResStatus( StateValue s,
+ EstablishValue e = UNDETERMINED,
+ TransactValue t = KEEP_STATE,
+ InstallDetailValue i = EXPLICIT_INSTALL,
+ RemoveDetailValue r = EXPLICIT_REMOVE,
+ SolverStateValue ssv = NORMAL );
+
+ /** Return whether the corresponding Field has value \a val_r.
+ */
+ template<class _Field>
+ bool fieldValueIs( FieldType val_r ) const
+ { return _bitfield.isEqual<_Field>( val_r ); }
+
+ /** Set the corresponding Field to value \a val_r.
+ */
+ template<class _Field>
+ void fieldValueAssign( FieldType val_r )
+ { _bitfield.assign<_Field>( val_r ); }
+
+ /** compare two values.
+ */
+ template<class _Field>
+ bool isGreaterThan( FieldType val_r )
+ { return _bitfield.value<_Field>() > val_r; }
+
+ template<class _Field>
+ bool isLessThan( FieldType val_r )
+ { return _bitfield.value<_Field>() < val_r; }
+
+ private:
+ BitFieldType _bitfield;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/ResStore.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResStore.i…
==============================================================================
--- trunk/libzypp-bindings/swig/ResStore.i (added)
+++ trunk/libzypp-bindings/swig/ResStore.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,21 @@
+
+class ResStore
+{
+ typedef ResObject ResT;
+ typedef std::set<ResT::Ptr> StorageT;
+ typedef StorageT::size_type size_type;
+
+ friend std::ostream & operator<<( std::ostream & str, const ResStore & obj );
+ public:
+ ResStore();
+ ~ResStore();
+ bool empty() const;
+ size_type size() const;
+ //iterator insert( const ResT::Ptr & ptr_r );
+ //size_type erase( const ResT::Ptr & ptr_r );
+ //void erase( iterator pos_r );
+ //void erase( iterator first_r, iterator last_r )
+ //void erase( const Resolvable::Kind & kind_r )
+ void clear();
+};
+
Added: trunk/libzypp-bindings/swig/Resolvable.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Resolvable…
==============================================================================
--- trunk/libzypp-bindings/swig/Resolvable.i (added)
+++ trunk/libzypp-bindings/swig/Resolvable.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,27 @@
+
+ class Resolvable
+ {
+ public:
+ typedef Resolvable Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::KindType Kind;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ const Kind & kind() const;
+ const std::string & name() const;
+ const Edition & edition() const;
+ const Arch & arch() const;
+
+ //const CapSet & dep( Dep which_r ) const;
+ //const Dependencies & deps() const;
+ //void injectProvides( const Capability & cap_r );
+ //void injectRequires( const Capability & cap_r );
+
+ protected:
+ Resolvable( const Kind & kind_r,
+ const NVRAD & nvrad_r );
+ virtual ~Resolvable();
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ };
+
Added: trunk/libzypp-bindings/swig/Source.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Source.i?r…
==============================================================================
--- trunk/libzypp-bindings/swig/Source.i (added)
+++ trunk/libzypp-bindings/swig/Source.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,72 @@
+
+class Source_Ref
+{
+ friend std::ostream & operator<<( std::ostream & str, const Source_Ref & obj );
+ friend bool operator==( const Source_Ref & lhs, const Source_Ref & rhs );
+ friend bool operator<( const Source_Ref & lhs, const Source_Ref & rhs );
+
+ public:
+ typedef source::SourceImpl Impl;
+ typedef source::SourceImpl_Ptr Impl_Ptr;
+
+ public:
+ Source_Ref();
+ static const Source_Ref noSource;
+
+ public:
+ typedef unsigned long NumericId;
+ NumericId numericId() const;
+
+ public:
+ std::string checksum() const;
+ Date timestamp() const;
+ bool hasResolvablesOfKind( const zypp::Resolvable::Kind &kind ) const;
+ std::set<zypp::Resolvable::Kind> resolvableKinds() const;
+ bool resStoreInitialized() const;
+ const ResStore & resolvables() const;
+ const ResStore resolvables(zypp::Resolvable::Kind kind) const;
+ //const Pathname providePackage( Package::constPtr package );
+ const Pathname provideFile(const Pathname & file_r, const unsigned media_nr = 1);
+ const Pathname provideDirTree(const Pathname & dir_r, const unsigned media_nr = 1);
+ const void releaseFile(const Pathname & file_r, const unsigned media_nr = 1);
+ const void releaseDir(const Pathname & dir_r, const unsigned media_nr = 1, bool recursive = false);
+ bool enabled() const;
+ void enable();
+ void disable();
+ bool autorefresh() const;
+ void setAutorefresh( bool enable_r );
+ void refresh();
+ void storeMetadata(const Pathname & cache_dir_r);
+ std::string alias (void) const;
+ void setAlias (const std::string & alias_r);
+ std::string type (void) const;
+ unsigned numberOfMedia(void) const;
+ std::string vendor (void) const;
+ std::string unique_id (void) const;
+ std::string id (void) const;
+ void setId (const std::string id_r);
+ unsigned priority (void) const;
+ void setPriority (unsigned p);
+ unsigned priorityUnsubscribed (void) const;
+ void setPriorityUnsubscribed (unsigned p);
+ bool subscribed (void) const;
+ void setSubscribed (bool s);
+ const Pathname & cacheDir (void) const;
+ const std::list<Pathname> publicKeys();
+ Url url (void) const;
+ void setUrl( const Url & url );
+ bool remote() const;
+ const Pathname & path (void) const;
+ bool baseSource() const;
+ public:
+ void changeMedia(const media::MediaId & media_r, const Pathname & path_r);
+ void redirect(unsigned media_nr, const Url & new_url);
+ void release();
+ void reattach(const Pathname &attach_point);
+ media::MediaVerifierRef verifier(unsigned media_nr);
+ private:
+ friend class SourceFactory;
+ friend class source::SourceImpl;
+ explicit
+ Source_Ref( const Impl_Ptr & impl_r );
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/SourceFactory.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/SourceFact…
==============================================================================
--- trunk/libzypp-bindings/swig/SourceFactory.i (added)
+++ trunk/libzypp-bindings/swig/SourceFactory.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,64 @@
+
+class SourceFactory
+ {
+ friend std::ostream & operator<<( std::ostream & str, const SourceFactory & obj );
+
+ public:
+ /** Default ctor */
+ SourceFactory();
+ /** Dtor */
+ ~SourceFactory();
+
+ public:
+ /** Construct source.
+ * \throw EXCEPTION on fail
+ */
+ Source_Ref createFrom( const source::SourceInfo & context );
+
+ /** Construct source from an implementation.
+ * Returns Source_Ref::noSource on NULL \a impl_r.
+ */
+ //Source_Ref createFrom( const Source_Ref::Impl_Ptr & impl_r );
+
+ /** Construct source.
+ * \throw EXCEPTION on fail
+ */
+ Source_Ref createFrom( const Url & url_r, const Pathname & path_r = "/", const std::string & alias_r = "", const Pathname & cache_dir_r = "", bool base_source = false );
+
+ /** Construct source of a given type.
+ * \throw EXCEPTION on fail
+ */
+ Source_Ref createFrom( const std::string & type, const Url & url_r, const Pathname & path_r, const std::string & alias_r, const Pathname & cache_dir_r, bool base_source, tribool auto_refresh );
+
+ protected:
+ template<class _SourceImpl>
+ Source_Ref createSourceImplWorkflow( media::MediaId id, const source::SourceInfo &context );
+ private:
+ /** Implementation */
+ class Impl;
+ /** Pointer to implementation */
+ RW_pointer<Impl> _pimpl;
+
+ public:
+ struct ProductEntry {
+ Pathname _dir;
+ std::string _name;
+ ProductEntry( const Pathname & dir_r = "/", const std::string & name_r = std::string() ){
+ _dir = dir_r;
+ _name = name_r;
+ }
+ bool operator<( const ProductEntry & rhs ) const {
+ return( _dir.asString() < rhs._dir.asString() );
+ }
+ };
+
+ typedef std::set<ProductEntry> ProductSet;
+
+ /** Check which products are available on the media
+ * \throw Exception or MediaException on fail
+ */
+ void listProducts( const Url & url_r, ProductSet & products_r );
+ private:
+// bool probeSource( const std::string name, boost::function<bool()> prober, callback::SendReport<CreateSourceReport> &report );
+ void scanProductsFile( const Pathname & file_r, ProductSet & pset_r ) const;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Target.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Target.i?r…
==============================================================================
--- trunk/libzypp-bindings/swig/Target.i (added)
+++ trunk/libzypp-bindings/swig/Target.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,69 @@
+
+typedef intrusive_ptr<Target> Target_Ptr;
+
+class Target
+ {
+ public:
+
+ typedef std::list<PoolItem_Ref> PoolItemList;
+
+ public:
+
+ /** All resolvables provided by the target. */
+ const ResStore & resolvables();
+
+ /**
+ * reload the target in future calls if
+ * needed.
+ * note the loading can actually be delayed, but
+ * the next call to resolvables must reflect the
+ * status of the system.
+ */
+ void reset();
+
+ /**
+ * load resolvables of certain kind in the internal store
+ * and return a iterator
+ * successive calls will be faster as resolvables are cached-
+ */
+ ResStore::resfilter_const_iterator byKindBegin( const ResObject::Kind & kind_r ) const;
+ ResStore::resfilter_const_iterator byKindEnd( const ResObject::Kind & kind_r ) const;
+
+ /** Null implementation */
+ static Target_Ptr nullimpl();
+
+ /** Refference to the RPM database */
+ //target::rpm::RpmDb & rpmDb();
+
+ /** If the package is installed and provides the file
+ Needed to evaluate split provides during Resolver::Upgrade() */
+ bool providesFile (const std::string & name_str, const std::string & path_str) const;
+
+ ResObject::constPtr whoOwnsFile (const std::string & path_str) const;
+
+ /** JUST FOR TESTSUITE */
+ /** Sort according to prereqs and media numbers
+ * \todo provide it as standalone algorithm
+ */
+ void getResolvablesToInsDel ( const ResPool pool_r,
+ PoolItemList & dellist_r,
+ PoolItemList & instlist_r,
+ PoolItemList & srclist_r ) const;
+
+#ifndef STORAGE_DISABLED
+ /** enables the storage target */
+ bool isStorageEnabled() const;
+ void enableStorage(const Pathname &root_r);
+#endif
+
+ /** Set the log file for target */
+ bool setInstallationLogfile(const Pathname & path_r);
+
+ /** Return the root set for this target */
+ Pathname root() const;
+
+ /** return the last modification date of the target */
+ Date timestamp() const;
+ };
+
+%template(Target_Ptr) intrusive_ptr<Target>;
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/TranslatedText.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Translated…
==============================================================================
--- trunk/libzypp-bindings/swig/TranslatedText.i (added)
+++ trunk/libzypp-bindings/swig/TranslatedText.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,44 @@
+ class TranslatedText
+ {
+ friend std::ostream & operator<<( std::ostream & str, const TranslatedText & obj );
+
+ public:
+ /** Implementation */
+ class Impl;
+
+ public:
+ /** Default ctor */
+ TranslatedText();
+ /** Ctor */
+ explicit
+ TranslatedText(const std::string &text, const Locale &lang = Locale());
+ /** Ctor. */
+ explicit
+ TranslatedText(const std::list<std::string> &text, const Locale &lang = Locale());
+ /** Dtor */
+ ~TranslatedText();
+
+ /** true if the text have no translations for any language */
+ bool empty() const ;
+
+ /** static default empty translated text */
+ static const TranslatedText notext;
+
+ public:
+
+ /** Synonym for \ref text */
+ std::string asString( const Locale &lang = Locale() ) const
+ { return text(lang); }
+
+ std::string text( const Locale &lang = Locale() ) const;
+ std::set<Locale> locales() const;
+
+ void setText( const std::string &text, const Locale &lang = Locale());
+ void setText( const std::list<std::string> &text, const Locale &lang = Locale());
+
+ Locale detectLanguage() const;
+
+ private:
+ /** Pointer to implementation */
+ RWCOW_pointer<Impl> _pimpl;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/Url.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Url.i?rev=…
==============================================================================
--- trunk/libzypp-bindings/swig/Url.i (added)
+++ trunk/libzypp-bindings/swig/Url.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,12 @@
+
+/* new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, arg_check = false) */
+
+%typemap(in) const Url & {
+ VALUE urlstring = rb_funcall( $input, rb_intern("to_s"), 0, 0);
+ Url *u = new Url( (RSTRING(urlstring)->ptr) );
+ $1 = u;
+}
+
+%typemap(freearg) const Url & {
+ delete $1;
+}
Added: trunk/libzypp-bindings/swig/ZYppCommitPolicy.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppCommit…
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppCommitPolicy.i (added)
+++ trunk/libzypp-bindings/swig/ZYppCommitPolicy.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,52 @@
+class ZYppCommitPolicy
+ {
+ public:
+ ZYppCommitPolicy()
+ : _restrictToMedia ( 0 )
+ , _dryRun ( false )
+ , _rpmNoSignature ( false )
+ , _syncPoolAfterCommit( true )
+ {}
+
+ public:
+ unsigned restrictToMedia() const
+ { return _restrictToMedia; }
+
+ bool dryRun() const
+ { return _dryRun; }
+
+ bool rpmNoSignature() const
+ { return _rpmNoSignature; }
+
+ bool syncPoolAfterCommit() const
+ { return _syncPoolAfterCommit; }
+
+ public:
+ /** Restrict commit to a certain media number
+ * \deprecated
+ */
+ ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
+ { _restrictToMedia = mediaNr_r; return *this; }
+
+ /** Process all media (default) */
+ ZYppCommitPolicy & allMedia()
+ { return restrictToMedia( 0 ); }
+
+ /** Set dry run (default: false) */
+ ZYppCommitPolicy & dryRun( bool yesNo_r = true )
+ { _dryRun = yesNo_r; return *this; }
+
+ /** Use rpm option --nosignature (default: false) */
+ ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
+ { _rpmNoSignature = yesNo_r; return *this; }
+
+ /** Kepp pool in sync with the Target databases after commit (default: true) */
+ ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
+ { _syncPoolAfterCommit = yesNo_r; return *this; }
+
+ private:
+ unsigned _restrictToMedia;
+ bool _dryRun;
+ bool _rpmNoSignature;
+ bool _syncPoolAfterCommit;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/ZYppCommitResult.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppCommit…
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppCommitResult.i (added)
+++ trunk/libzypp-bindings/swig/ZYppCommitResult.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,26 @@
+struct ZYppCommitResult
+ {
+ ZYppCommitResult()
+ : _result(0)
+ {}
+
+ typedef std::list<PoolItem_Ref> PoolItemList;
+
+ /**
+ * number of committed resolvables
+ **/
+ int _result;
+
+ /**
+ * list of resolvables with error
+ **/
+ PoolItemList _errors;
+ /**
+ * list of resolvables remaining (due to wrong media)
+ **/
+ PoolItemList _remaining;
+ /**
+ * list of kind:source resolvables remaining (due to wrong media)
+ **/
+ PoolItemList _srcremaining;
+ };
\ No newline at end of file
Added: trunk/libzypp-bindings/swig/ZYppFactory.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppFactor…
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppFactory.i (added)
+++ trunk/libzypp-bindings/swig/ZYppFactory.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,12 @@
+
+%template(ZYpp_Ptr) intrusive_ptr<ZYpp>;
+
+class ZYppFactory
+{
+public:
+ static ZYppFactory instance();
+ ~ZYppFactory();
+ ZYpp::Ptr getZYpp() const;
+ private:
+ ZYppFactory();
+};
Added: trunk/libzypp-bindings/swig/python.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/python.i?r…
==============================================================================
--- trunk/libzypp-bindings/swig/python.i (added)
+++ trunk/libzypp-bindings/swig/python.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,13 @@
+
+%define iter( cl )
+%extend cl {
+ %pythoncode %{
+ def __iter__(self):
+ r = self.range()
+ while not r.empty():
+ yield r.head()
+ r.removeFirst()
+ %}
+};
+%enddef
+
Added: trunk/libzypp-bindings/swig/ruby.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ruby.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/ruby.i (added)
+++ trunk/libzypp-bindings/swig/ruby.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,79 @@
+
+%rename("asString") foo(to_s);
+
+#define iter( 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), 1)); \
+ ++i; \
+ } \
+ } \
+}
+
+#define iter2( 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 )
+ {
+ ResStore::resfilter_const_iterator i = self->byKindBegin( kind_r );
+ while ( i != self->byKindEnd( kind_r ) ) {
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(ResStore::Ptr), 0));
+ ++i;
+ }
+ }
+}
+
+%extend ResPool {
+ void each()
+ {
+ ResPool::const_iterator i = self->begin();
+ while ( i != self->end() ) {
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
+ ++i;
+ }
+ }
+}
+
+%extend ResPool {
+ void each_by_kind( const ResObject::Kind & kind_r )
+ {
+ ResPool::byKind_iterator i = self->byKindBegin( kind_r );
+ while ( i != self->byKindEnd( kind_r ) ) {
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
+ ++i;
+ }
+ }
+}
+
+%extend ResPool {
+ void each_by_name( const std::string &name )
+ {
+ ResPool::byName_iterator i = self->byNameBegin( name );
+ while ( i != self->byNameEnd( name ) ) {
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(PoolItem_Ref), 0));
+ ++i;
+ }
+ }
+}
+
+
+%rename(asString) to_s;
+
+%rename("dryRun=") ZYppCommitPolicy::dryRun(bool);
+%rename("rpmNoSignature=") ZYppCommitPolicy::rpmNoSignature(bool);
+%rename("syncPoolAfterCommit=") ZYppCommitPolicy::syncPoolAfterCommit(bool);
+
+
Added: trunk/libzypp-bindings/swig/zypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/zypp.i?rev…
==============================================================================
--- trunk/libzypp-bindings/swig/zypp.i (added)
+++ trunk/libzypp-bindings/swig/zypp.i Sun Apr 22 21:44:49 2007
@@ -0,0 +1,146 @@
+%module rzypp
+%include std_string.i
+ %{
+ /* Includes the header in the wrapper code */
+
+ #include "zypp/base/PtrTypes.h"
+ #include <zypp/Edition.h>
+ #include <zypp/ResTraits.h>
+ #include <zypp/ResPoolProxy.h>
+ #include <zypp/ResStore.h>
+ #include <zypp/ZYppFactory.h>
+ #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"
+#include "zypp/TranslatedText.h"
+ #include "zypp/CapFactory.h"
+ #include "zypp/Package.h"
+#include "zypp/ResFilters.h"
+#include "zypp/source/OnMediaLocation.h"
+#include "zypp/MediaSetAccess.h"
+
+ using namespace boost;
+ using namespace zypp;
+ using namespace zypp::resfilter;
+
+ %}
+
+#ifdef SWIGRUBY
+%include "ruby.i"
+#endif
+
+%rename("+") "operator+";
+%rename("<<") "operator<<";
+%rename("!=") "operator!=";
+%rename("!") "operator!";
+%rename("==") "operator==";
+
+/* Parse the header file to generate wrappers */
+%ignore zypp::operator<<( std::ostream & str, const ZYppFactory & obj );
+%ignore zypp::base::operator<<( std::ostream & str, const ReferenceCounted & obj );
+
+/*
+//%include "zypp/base/Deprecated.h"
+//%include "zypp/base/PtrTypes.h"
+*/
+
+
+template < typename T >
+class intrusive_ptr {
+ public:
+ T *operator->();
+};
+
+%include "Pathname.i"
+%include "Arch.i"
+%include "ResStore.i"
+%include "Edition.i"
+%include "Kind.i"
+%include "Date.i"
+%include "Resolvable.i"
+%include "ByteCount.i"
+%include "Source.i"
+%include "SourceFactory.i"
+%include "ResObject.i"
+%include "TranslatedText.i"
+%include "CheckSum.i"
+%include "Dependencies.i"
+%include "Capability.i"
+%include "CapMatch.i"
+%include "CapFactory.i"
+%include "NVR.i"
+%include "NVRA.i"
+%include "NVRAD.i"
+%include "Package.i"
+%include "KeyRing.i"
+%include "Target.i"
+%include "ResStatus.i"
+%include "Dep.i"
+%include "PoolItem.i"
+%include "ResPool.i"
+%include "ZYppCommitPolicy.i"
+%include "ZYppCommitResult.i"
+%include "Url.i"
+%include "MediaSetAccess.i"
+
+/* define iterators using swig macros */
+iter2( ResStore, ResObject::Ptr )
+
+class ZYpp
+{
+ public:
+ typedef intrusive_ptr<ZYpp> Ptr;
+ typedef intrusive_ptr<const ZYpp> constPtr;
+ public:
+
+ ResPool pool() const;
+ ResPoolProxy poolProxy() const;
+
+ /*
+ SourceFeed_Ref sourceFeed() const;
+ */
+ void addResolvables (const ResStore& store, bool installed = false);
+ void removeResolvables (const ResStore& store);
+ /*
+ DiskUsageCounter::MountPointSet diskUsage();
+ void setPartitions(const DiskUsageCounter::MountPointSet &mp);
+ */
+ Target_Ptr target() const;
+ void initializeTarget(const Pathname & root);
+ void finishTarget();
+
+ typedef ZYppCommitResult CommitResult;
+ ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
+
+ Resolver_Ptr resolver() const;
+ KeyRing_Ptr keyRing() const;
+
+ /*
+ void setTextLocale( const Locale & textLocale_r );
+ Locale getTextLocale() const;
+ typedef std::set<Locale> LocaleSet;
+ void setRequestedLocales( const LocaleSet & locales_r );
+ LocaleSet getRequestedLocales() const;
+ LocaleSet getAvailableLocales() const;
+ void availableLocale( const Locale & locale_r );
+ */
+ Pathname homePath() const;
+ Pathname tmpPath() const;
+ void setHomePath( const Pathname & path );
+
+ Arch architecture() const;
+ void setArchitecture( const Arch & arch );
+
+ protected:
+ virtual ~ZYpp();
+ private:
+ friend class ZYppFactory;
+ explicit ZYpp( const Impl_Ptr & impl_r );
+};
+
+%include "ZYppFactory.i"
\ No newline at end of file
Added: trunk/libzypp-bindings/zypp-bindings.spec.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/zypp-bindings.s…
==============================================================================
--- trunk/libzypp-bindings/zypp-bindings.spec.cmake (added)
+++ trunk/libzypp-bindings/zypp-bindings.spec.cmake Sun Apr 22 21:44:49 2007
@@ -0,0 +1,57 @@
+#
+# spec file for package ruby-zypp (Version 0.0_svn)
+#
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+# norootforbuild
+
+Name: zypp-bindngs
+Version: 0.1
+Release: 1
+License: GPL
+Group: Development/Languages/Ruby
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: gcc-c++, ruby-devel
+BuildRequires: libzypp-devel >= 3.0.0
+Requires: libzypp >= 3.0.0
+Source: %{name}.tar.bz2
+Summary: Language Bindings for libzypp
+%description
+Language Bindings for libzypp
+
+ Authors:
+----------
+ Duncan Mac-Vicar P. <dmacvicar(a)suse.de>
+ Klaus Kaempf <kkaempf(a)suse.de>
+
+%prep
+%setup -n %{name}
+
+%build
+pushd src
+ ruby extconf.rb
+ make
+popd
+#make -C tests check
+
+%install
+%{__install} -D -m 0755 src/rzypp.so \
+ %{buildroot}%{_libdir}/ruby/%{rb_ver}/%{rb_arch}/rzypp.so
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/ruby/%{rb_ver}/%{rb_arch}/rzypp.so
+%doc MAINTAINER COPYING README
+%doc tests/*.rb
+
+%changelog -n ruby-zypp
+* Tue Mar 21 2006 - mrueckert(a)suse.de
+- Initial package
--
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] r5430 - in /trunk/libzypp/devel/devel.dmacvicar: CacheQuery_test.cc SourceManager.cc
by dmacvicar@svn.opensuse.org 20 Apr '07
by dmacvicar@svn.opensuse.org 20 Apr '07
20 Apr '07
Author: dmacvicar
Date: Fri Apr 20 18:25:40 2007
New Revision: 5430
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5430&view=rev
Log:
ups
Added:
trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc
Removed:
trunk/libzypp/devel/devel.dmacvicar/CacheQuery_test.cc
Added: trunk/libzypp/devel/devel.dmacvicar/SourceManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/So…
==============================================================================
(empty)
--
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] r5429 - in /trunk/libzypp: devel/devel.dmacvicar/ tests/cache/ zypp/data/ zypp/detail/ zypp2/cache/ zypp2/source/cached/
by dmacvicar@svn.opensuse.org 20 Apr '07
by dmacvicar@svn.opensuse.org 20 Apr '07
20 Apr '07
Author: dmacvicar
Date: Fri Apr 20 17:58:02 2007
New Revision: 5429
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5429&view=rev
Log:
backup for today.
- almost working resolvable query, and test
- fix in cached source arch
- skeleton for source manager
Added:
trunk/libzypp/devel/devel.dmacvicar/SourceManager.h
trunk/libzypp/devel/devel.dmacvicar/SourceManager_tp.cc
trunk/libzypp/tests/cache/CacheQuery_test.cc
trunk/libzypp/tests/cache/SimplePackagesParser.cc
trunk/libzypp/tests/cache/SimplePackagesParser.h
Modified:
trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt
trunk/libzypp/tests/cache/CMakeLists.txt
trunk/libzypp/tests/cache/CacheStore_test.cc
trunk/libzypp/zypp/data/ResolvableData.cc
trunk/libzypp/zypp/data/ResolvableData.h
trunk/libzypp/zypp/detail/ResolvableImpl.cc
trunk/libzypp/zypp2/cache/ResolvableQuery.cc
trunk/libzypp/zypp2/cache/ResolvableQuery.h
trunk/libzypp/zypp2/source/cached/CachedSourceImpl.cc
Modified: trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/CM…
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt (original)
+++ trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt Fri Apr 20 17:58:02 2007
@@ -16,10 +16,6 @@
TARGET_LINK_LIBRARIES(cachestore zypp )
TARGET_LINK_LIBRARIES(cachestore zypp2 )
-ADD_EXECUTABLE(cachequery CacheQuery_test.cc)
-TARGET_LINK_LIBRARIES(cachequery zypp )
-TARGET_LINK_LIBRARIES(cachequery zypp2 )
-
ADD_EXECUTABLE(tagsparser SUSETagsParser.cc SUSETagsParser_tp.cc)
TARGET_LINK_LIBRARIES(tagsparser zypp )
TARGET_LINK_LIBRARIES(tagsparser zypp2 )
Added: trunk/libzypp/devel/devel.dmacvicar/SourceManager.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/So…
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/SourceManager.h (added)
+++ trunk/libzypp/devel/devel.dmacvicar/SourceManager.h Fri Apr 20 17:58:02 2007
@@ -0,0 +1,3 @@
+
+#ifndef ZYPP_NEW_SOURCEMANAGER_H
+#define ZYPP_NEW_SOURCEMANAGER_H
\ No newline at end of file
Added: trunk/libzypp/devel/devel.dmacvicar/SourceManager_tp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/So…
==============================================================================
(empty)
Modified: trunk/libzypp/tests/cache/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/CMakeLists.t…
==============================================================================
--- trunk/libzypp/tests/cache/CMakeLists.txt (original)
+++ trunk/libzypp/tests/cache/CMakeLists.txt Fri Apr 20 17:58:02 2007
@@ -5,11 +5,19 @@
TARGET_LINK_LIBRARIES(CacheInitializer zypp2 )
TARGET_LINK_LIBRARIES(CacheInitializer zypp )
-ADD_EXECUTABLE(CacheStore CacheStore_test.cc)
+ADD_EXECUTABLE(CacheStore CacheStore_test.cc SimplePackagesParser.cc)
TARGET_LINK_LIBRARIES(CacheStore boost_unit_test_framework )
TARGET_LINK_LIBRARIES(CacheStore zypp2 )
TARGET_LINK_LIBRARIES(CacheStore zypp )
+ADD_EXECUTABLE(CacheQuery CacheQuery_test.cc SimplePackagesParser.cc)
+TARGET_LINK_LIBRARIES(CacheQuery boost_unit_test_framework )
+TARGET_LINK_LIBRARIES(CacheQuery zypp2 )
+TARGET_LINK_LIBRARIES(CacheQuery zypp )
+
ADD_TEST(CacheInitializer ${CMAKE_CURRENT_BINARY_DIR}/CacheInitializer ${CMAKE_CURRENT_SOURCE_DIR}/data )
ADD_TEST(CacheStore ${CMAKE_CURRENT_BINARY_DIR}/CacheStore ${CMAKE_CURRENT_SOURCE_DIR}/data )
+ADD_TEST(CacheQuery ${CMAKE_CURRENT_BINARY_DIR}/CacheQuery ${CMAKE_CURRENT_SOURCE_DIR}/data )
+
+
Added: trunk/libzypp/tests/cache/CacheQuery_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/CacheQuery_t…
==============================================================================
--- trunk/libzypp/tests/cache/CacheQuery_test.cc (added)
+++ trunk/libzypp/tests/cache/CacheQuery_test.cc Fri Apr 20 17:58:02 2007
@@ -0,0 +1,96 @@
+#include <sys/time.h>
+
+#include <iostream>
+#include <fstream>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/parameterized_test.hpp>
+#include <boost/test/unit_test_log.hpp>
+
+#include "zypp/base/Measure.h"
+#include "zypp/base/Logger.h"
+#include "zypp/ZYpp.h"
+#include "zypp/ZYppFactory.h"
+#include "zypp/TmpPath.h"
+
+#include "zypp2/cache/CacheStore.h"
+#include "zypp2/cache/CapabilityQuery.h"
+#include "zypp/data/ResolvableData.h"
+#include "zypp2/cache/ResolvableQuery.h"
+
+#include "SimplePackagesParser.h"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::debug;
+using namespace zypp::capability;
+using namespace zypp::filesystem;
+using namespace zypp::cache;
+using namespace boost::unit_test;
+
+bool result(const data::RecordId &id, data::ResObject_Ptr ptr )
+{
+ MIL << "result: " << id << " | " << ptr->name << " | " << ptr->edition << " | " << ptr->arch << endl;
+}
+
+void resolvable_query_test(const string &dir)
+{
+ Pathname nvra_list = Pathname(dir) + "package-set.txt.gz";
+
+ MIL << "parsing " << nvra_list << endl;
+
+ list<MiniResolvable> res_list;
+
+ parse_mini_file( nvra_list, res_list );
+
+ filesystem::TmpDir tmpdir;
+ // let the store go out of scope to drop the connection
+ {
+ cache::CacheStore store(tmpdir.path());
+
+ data::RecordId catalog_id = store.lookupOrAppendCatalog( Url("http://novell.com"), "/");
+
+ zypp::debug::Measure cap_parse_timer("store resolvables");
+ for ( list<MiniResolvable>::iterator it = res_list.begin(); it != res_list.end(); it++)
+ {
+ data::RecordId id = store.appendResolvable( catalog_id,
+ ResTraits<Package>::kind,
+ (*it).nvra,
+ (*it).deps );
+ }
+
+ MIL << "packages writen to store" << endl;
+ }
+
+ ResolvableQuery query(tmpdir.path(), &result);
+ query.query("lib");
+}
+
+test_suite*
+init_unit_test_suite( int argc, char *argv[] )
+{
+ string datadir;
+ if (argc < 2)
+ {
+ datadir = TESTS_SRC_DIR;
+ datadir = (Pathname(datadir) + "/cache/data").asString();
+ cout << "CacheStore_test:"
+ " path to directory with test data required as parameter. Using " << datadir << endl;
+ //return (test_suite *)0;
+
+ }
+ else
+ {
+ datadir = argv[1];
+ }
+
+ test_suite* test= BOOST_TEST_SUITE("CacheStore");
+
+ std::string const params[] = { datadir };
+ test->add(BOOST_PARAM_TEST_CASE(&resolvable_query_test,
+ (std::string const*)params, params+1));
+ return test;
+}
+
+
+
Modified: trunk/libzypp/tests/cache/CacheStore_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/CacheStore_t…
==============================================================================
--- trunk/libzypp/tests/cache/CacheStore_test.cc (original)
+++ trunk/libzypp/tests/cache/CacheStore_test.cc Fri Apr 20 17:58:02 2007
@@ -9,7 +9,7 @@
#include "zypp/base/Random.h"
#include "zypp/base/Logger.h"
-#include "zypp/base/GzStream.h"
+
#include "zypp/base/Measure.h"
#include "zypp/capability/CapabilityImpl.h"
#include "zypp/data/ResolvableData.h"
@@ -19,91 +19,18 @@
#include "zypp/PathInfo.h"
#include "zypp/TmpPath.h"
+#include "SimplePackagesParser.h"
+
using namespace std;
using namespace zypp;
using namespace boost::unit_test;
-void read_dash( zypp::ifgzstream &ifs, const std::string &s, int &line )
-{
- string buffer;
- // get the "-"
- getline(ifs, buffer);
- line++;
- if ( buffer != s )
- {
- ERR << "line : " << line << endl;
- ZYPP_THROW(Exception("missing " + s ));
- }
-}
-
-void read_deps( zypp::ifgzstream &ifs, data::DependencyList &list, int &line, const string &endchar )
-{
- string buffer;
- while ( ifs && !ifs.eof())
- {
- getline(ifs, buffer);
- line++;
- if ( buffer == endchar )
- break;
- try
- {
- capability::CapabilityImpl::Ptr cap = zypp::capability::parse( ResTraits<Package>::kind, buffer);
- if (cap)
- list.push_back(cap);
- }
- catch( const Exception &e )
- {
- ERR << "line : " << line << endl;
- ZYPP_THROW(Exception("bad capability line"));
- }
- }
-}
-
-struct MiniResolvable
-{
- NVRA nvra;
- data::Dependencies deps;
-};
-
void cache_write_test(const string &dir)
{
- list<MiniResolvable> res_list;
- std::string buffer;
Pathname nvra_list = Pathname(dir) + "package-set.txt.gz";
+ list<MiniResolvable> res_list;
- int line = 0;
- zypp::ifgzstream nvra_stream(nvra_list.c_str());
- MIL << "reading " << nvra_list << endl;
-
- if ( ! nvra_stream )
- ZYPP_THROW(Exception("cant open data file " + nvra_list.asString()));
-
- while ( nvra_stream && !nvra_stream.eof())
- {
- MiniResolvable res;
- getline(nvra_stream, buffer);
- line++;
-
- if ( buffer.empty() )
- break;
-
- std::vector<std::string> words;
- if ( str::split( buffer, std::back_inserter(words) ) != 4 )
- {
- ERR << nvra_list << " : line : " << line << endl;
- ZYPP_THROW(Exception("bad NVRA line"));
- }
-
- res.nvra = NVRA(words[0], Edition(words[1], words[2]), Arch(words[3]));
- // requires
- read_dash( nvra_stream, "+r", line);
- read_deps( nvra_stream, res.deps[Dep::REQUIRES], line, "-r");
- read_dash( nvra_stream, "+p", line);
- read_deps( nvra_stream, res.deps[Dep::PROVIDES], line, "-p");
-
- res_list.push_back(res);
- }
- //MIL << deps.size() << " capabilities read." << endl;
+ parse_mini_file( nvra_list, res_list );
filesystem::TmpDir tmpdir;
cache::CacheStore store(tmpdir.path());
Added: trunk/libzypp/tests/cache/SimplePackagesParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/SimplePackag…
==============================================================================
--- trunk/libzypp/tests/cache/SimplePackagesParser.cc (added)
+++ trunk/libzypp/tests/cache/SimplePackagesParser.cc Fri Apr 20 17:58:02 2007
@@ -0,0 +1,89 @@
+
+#include <string>
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/GzStream.h"
+#include "zypp/Url.h"
+#include "zypp/PathInfo.h"
+#include "zypp/TmpPath.h"
+
+#include "SimplePackagesParser.h"
+
+
+using namespace zypp;
+using namespace std;
+
+static void read_dash( ifgzstream &ifs, const std::string &s, int &line )
+{
+ string buffer;
+ // get the "-"
+ getline(ifs, buffer);
+ line++;
+ if ( buffer != s )
+ {
+ ERR << "line : " << line << endl;
+ ZYPP_THROW(Exception("missing " + s ));
+ }
+}
+
+static void read_deps( ifgzstream &ifs, data::DependencyList &list, int &line, const string &endchar )
+{
+ string buffer;
+ while ( ifs && !ifs.eof())
+ {
+ getline(ifs, buffer);
+ line++;
+ if ( buffer == endchar )
+ break;
+ try
+ {
+ capability::CapabilityImpl::Ptr cap = capability::parse( ResTraits<Package>::kind, buffer);
+ if (cap)
+ list.push_back(cap);
+ }
+ catch( const Exception &e )
+ {
+ ERR << "line : " << line << endl;
+ ZYPP_THROW(Exception("bad capability line"));
+ }
+ }
+}
+
+void parse_mini_file(const Pathname &nvra_list, std::list<MiniResolvable> &res_list)
+{
+ std::string buffer;
+ int line = 0;
+ ifgzstream nvra_stream(nvra_list.c_str());
+ MIL << "reading " << nvra_list << endl;
+
+ if ( ! nvra_stream )
+ ZYPP_THROW(Exception("cant open data file " + nvra_list.asString()));
+
+ while ( nvra_stream && !nvra_stream.eof())
+ {
+ MiniResolvable res;
+ getline(nvra_stream, buffer);
+ line++;
+
+ if ( buffer.empty() )
+ break;
+
+ std::vector<std::string> words;
+ if ( str::split( buffer, std::back_inserter(words) ) != 4 )
+ {
+ ERR << nvra_list << " : line : " << line << endl;
+ ZYPP_THROW(Exception("bad NVRA line"));
+ }
+
+ res.nvra = NVRA(words[0], Edition(words[1], words[2]), Arch(words[3]));
+ // requires
+ read_dash( nvra_stream, "+r", line);
+ read_deps( nvra_stream, res.deps[Dep::REQUIRES], line, "-r");
+ read_dash( nvra_stream, "+p", line);
+ read_deps( nvra_stream, res.deps[Dep::PROVIDES], line, "-p");
+
+ res_list.push_back(res);
+ }
+ //MIL << deps.size() << " capabilities read." << endl;
+}
+
Added: trunk/libzypp/tests/cache/SimplePackagesParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/SimplePackag…
==============================================================================
--- trunk/libzypp/tests/cache/SimplePackagesParser.h (added)
+++ trunk/libzypp/tests/cache/SimplePackagesParser.h Fri Apr 20 17:58:02 2007
@@ -0,0 +1,18 @@
+
+#ifndef SimplePackagesParser_H
+#define SimplePackagesParser_H
+
+#include <list>
+#include "zypp/NVRA.h"
+#include "zypp/Pathname.h"
+#include "zypp/data/ResolvableData.h"
+
+struct MiniResolvable
+{
+ zypp::NVRA nvra;
+ zypp::data::Dependencies deps;
+};
+
+void parse_mini_file(const zypp::Pathname &nvra_list, std::list<MiniResolvable> &res_list);
+
+#endif
Modified: trunk/libzypp/zypp/data/ResolvableData.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/data/ResolvableData…
==============================================================================
--- trunk/libzypp/zypp/data/ResolvableData.cc (original)
+++ trunk/libzypp/zypp/data/ResolvableData.cc Fri Apr 20 17:58:02 2007
@@ -16,7 +16,7 @@
namespace data
{
-
+IMPL_PTR_TYPE(Resolvable);
IMPL_PTR_TYPE(ResObject);
IMPL_PTR_TYPE(Script);
IMPL_PTR_TYPE(Message);
Modified: trunk/libzypp/zypp/data/ResolvableData.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/data/ResolvableData…
==============================================================================
--- trunk/libzypp/zypp/data/ResolvableData.h (original)
+++ trunk/libzypp/zypp/data/ResolvableData.h Fri Apr 20 17:58:02 2007
@@ -33,9 +33,12 @@
{
namespace data
{
+
typedef std::list< capability::CapabilityImpl::Ptr > DependencyList;
typedef std::map< zypp::Dep, DependencyList> Dependencies;
+ DEFINE_PTR_TYPE(Resolvable);
+
class Resolvable : public base::ReferenceCounted, private base::NonCopyable
{
public:
@@ -49,34 +52,7 @@
Dependencies deps;
};
- struct ResObjectData
- {
- ResObjectData()
- : source_media_nr(1), install_only(false)
- {}
-
- TranslatedText summary;
- TranslatedText description;
-
- std::string insnotify;
- std::string delnotify;
-
- std::string license_to_confirm;
- std::string vendor;
-
- ByteCount size;
- ByteCount archive_size;
-
- std::string source;
-
- int source_media_nr;
-
- bool install_only;
-
- Date build_time;
- Date install_time;
- };
-
+ DEFINE_PTR_TYPE(ResObject);
class ResObject : public Resolvable
{
Modified: trunk/libzypp/zypp/detail/ResolvableImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/detail/ResolvableIm…
==============================================================================
--- trunk/libzypp/zypp/detail/ResolvableImpl.cc (original)
+++ trunk/libzypp/zypp/detail/ResolvableImpl.cc Fri Apr 20 17:58:02 2007
@@ -115,6 +115,7 @@
void filterExtraProvides( const Dependencies & from, Dependencies & to )
{
+ //return;
CapSet provides;
CapSet languages;
@@ -136,6 +137,7 @@
void filterExtraSupplements( const Dependencies & from, Dependencies & to )
{
+ //return;
CapSet supplements;
CapSet dummy;
to[Dep::SUPPLEMENTS].clear();
Modified: trunk/libzypp/zypp2/cache/ResolvableQuery.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/cache/ResolvableQu…
==============================================================================
--- trunk/libzypp/zypp2/cache/ResolvableQuery.cc (original)
+++ trunk/libzypp/zypp2/cache/ResolvableQuery.cc Fri Apr 20 17:58:02 2007
@@ -1,8 +1,10 @@
#include "zypp2/cache/ResolvableQuery.h"
+#include "zypp2/cache/DatabaseTypes.h"
#include "zypp2/cache/sqlite3x/sqlite3x.hpp"
using namespace sqlite3x;
+using namespace std;
namespace zypp { namespace cache {
@@ -11,35 +13,58 @@
{
Impl( const Pathname &dbdir, ProcessResolvable fnc )
: _dbdir(dbdir), _fnc(fnc)
- {}
+ {
+ _fields = "id, name, version, release, epoch, arch, kind, insnotify, delnotify, license_to_confirm, vendor, installed_size, archive_size, install_only, build_time, install_time, catalog_id";
+ }
~Impl()
{
}
+ data::ResObject_Ptr fromRow( sqlite3_reader &reader )
+ {
+ data::ResObject_Ptr ptr (new data::ResObject);
+
+ ptr->name = reader.getstring(1);
+ ptr->edition = Edition( reader.getstring(2), reader.getstring(3), reader.getint(4));
+ ptr->arch = db_arch2zypp_arch( static_cast<db::Arch>(reader.getint(5)));
+
+ return ptr;
+ }
void query( const data::RecordId &id )
{
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
//con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
- sqlite3_command cmd( con, "select * from resolvables where id=:id;");
+ sqlite3_command cmd( con, "select " + _fields + " from resolvables where id=:id;");
cmd.bind(":id", id);
sqlite3_reader reader = cmd.executereader();
while(reader.read())
{
-
+ _fnc( id, fromRow(reader) );
}
con.executenonquery("COMMIT;");
}
void query( const std::string &s )
{
-
+ sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
+ //con.executenonquery("PRAGMA cache_size=8000;");
+ con.executenonquery("BEGIN;");
+ sqlite3_command cmd( con, "select " + _fields + " from resolvables where name like '%:name%';");
+ cmd.bind(":name", s);
+ sqlite3_reader reader = cmd.executereader();
+ while(reader.read())
+ {
+ _fnc( reader.getint64(0), fromRow(reader) );
+ }
+ con.executenonquery("COMMIT;");
}
Pathname _dbdir;
ProcessResolvable _fnc;
+ string _fields;
};
ResolvableQuery::ResolvableQuery( const Pathname &dbdir, ProcessResolvable fnc )
Modified: trunk/libzypp/zypp2/cache/ResolvableQuery.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/cache/ResolvableQu…
==============================================================================
--- trunk/libzypp/zypp2/cache/ResolvableQuery.h (original)
+++ trunk/libzypp/zypp2/cache/ResolvableQuery.h Fri Apr 20 17:58:02 2007
@@ -38,9 +38,11 @@
* first parameter is the resolvable id.
* second parameter is a \ref data::ResObjectData object with the resource
*/
- typedef function<bool( const data::RecordId &, const data::ResObjectData & )> ProcessResolvable;
+ typedef function<bool( const data::RecordId &,
+ data::ResObject_Ptr )> ProcessResolvable;
- ResolvableQuery( const Pathname &dbdir, ProcessResolvable fnc );
+ ResolvableQuery( const Pathname &dbdir,
+ ProcessResolvable fnc );
/**
* Query by record id
Modified: trunk/libzypp/zypp2/source/cached/CachedSourceImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/source/cached/Cach…
==============================================================================
--- trunk/libzypp/zypp2/source/cached/CachedSourceImpl.cc (original)
+++ trunk/libzypp/zypp2/source/cached/CachedSourceImpl.cc Fri Apr 20 17:58:02 2007
@@ -85,11 +85,8 @@
long long id = reader.getint64(0);
Dependencies deps;
- Arch arch;
- string archstring = reader.getstring(5);
- if (!archstring.empty())
- arch = Arch(archstring);
-
+ Arch arch = db_arch2zypp_arch( static_cast<db::Arch>(reader.getint(5)));
+
// Collect basic Resolvable data
nvras[id] = NVRAD( reader.getstring(1),
Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ),
--
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] r5428 - in /trunk/libzypp/zypp/base: IOStream.cc IOStream.h
by mlandres@svn.opensuse.org 20 Apr '07
by mlandres@svn.opensuse.org 20 Apr '07
20 Apr '07
Author: mlandres
Date: Fri Apr 20 16:41:35 2007
New Revision: 5428
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5428&view=rev
Log:
extend line parser to retrieve file position
Modified:
trunk/libzypp/zypp/base/IOStream.cc
trunk/libzypp/zypp/base/IOStream.h
Modified: trunk/libzypp/zypp/base/IOStream.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/IOStream.cc?re…
==============================================================================
--- trunk/libzypp/zypp/base/IOStream.cc (original)
+++ trunk/libzypp/zypp/base/IOStream.cc Fri Apr 20 16:41:35 2007
@@ -55,6 +55,7 @@
//
EachLine::EachLine( std::istream & str_r, unsigned lineNo_r )
: _str( str_r )
+ , _lineStart( -1 )
, _lineNo( lineNo_r )
, _valid( true )
{
@@ -79,13 +80,14 @@
return(_valid = false);
}
+ _lineStart = _str.tellg();
_line = iostr::getline( _str );
+ ++_lineNo;
if ( _str.fail() || _str.bad() )
{
_line.clear();
return(_valid = false);
}
- ++_lineNo;
return(_valid = true);
}
Modified: trunk/libzypp/zypp/base/IOStream.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/IOStream.h?rev…
==============================================================================
--- trunk/libzypp/zypp/base/IOStream.h (original)
+++ trunk/libzypp/zypp/base/IOStream.h Fri Apr 20 16:41:35 2007
@@ -76,6 +76,9 @@
unsigned lineNo() const
{ return _lineNo; }
+ std::streamoff lineStart() const
+ { return _lineStart; };
+
/** Set current line number. */
void setLineNo( unsigned lineNo_r )
{ _lineNo = lineNo_r; }
@@ -102,9 +105,10 @@
private:
std::istream & _str;
- std::string _line;
- unsigned _lineNo;
- bool _valid;
+ std::string _line;
+ std::streamoff _lineStart;
+ unsigned _lineNo;
+ bool _valid;
};
///////////////////////////////////////////////////////////////////
--
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] r5427 - /branches/SuSE-Linux-10_2-Branch/libzypp/package/libzypp.changes
by dmacvicar@svn.opensuse.org 20 Apr '07
by dmacvicar@svn.opensuse.org 20 Apr '07
20 Apr '07
Author: dmacvicar
Date: Fri Apr 20 15:18:25 2007
New Revision: 5427
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5427&view=rev
Log:
changes
Modified:
branches/SuSE-Linux-10_2-Branch/libzypp/package/libzypp.changes
Modified: branches/SuSE-Linux-10_2-Branch/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/libzyp…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/libzypp/package/libzypp.changes (original)
+++ branches/SuSE-Linux-10_2-Branch/libzypp/package/libzypp.changes Fri Apr 20 15:18:25 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Apr 20 15:17:53 CEST 2007 - dmacvicar(a)suse.de
+
+- additional fields in zypp-query-pool for bootloader use
+ (#265819). No library changes
+- 5426
+
+-------------------------------------------------------------------
Wed Apr 4 13:23:30 CEST 2007 - schubi(a)suse.de
- New translations added
--
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] r5426 - /branches/SuSE-Linux-10_2-Branch/libzypp/tools/registration/zypp-query-pool.cc
by dmacvicar@svn.opensuse.org 20 Apr '07
by dmacvicar@svn.opensuse.org 20 Apr '07
20 Apr '07
Author: dmacvicar
Date: Fri Apr 20 15:17:48 2007
New Revision: 5426
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5426&view=rev
Log:
- additional fields in zypp-query-pool for bootloader use
(#265819)
Modified:
branches/SuSE-Linux-10_2-Branch/libzypp/tools/registration/zypp-query-pool.cc
Modified: branches/SuSE-Linux-10_2-Branch/libzypp/tools/registration/zypp-query-pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/libzyp…
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/libzypp/tools/registration/zypp-query-pool.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/libzypp/tools/registration/zypp-query-pool.cc Fri Apr 20 15:17:48 2007
@@ -48,6 +48,9 @@
Product::constPtr p( asKind<Product>( item ) );
cout << "|" << p->distributionName();
cout << "|" << p->distributionEdition();
+ cout << "|" << p->category();
+ cout << "|" << p->shortName();
+ cout << "|" << p->summary();
}
cout << endl;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
20 Apr '07
Author: dmacvicar
Date: Fri Apr 20 14:27:44 2007
New Revision: 5425
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5425&view=rev
Log:
This removes like 4 seconds when loading 19k packages
Modified:
trunk/libzypp/zypp/Edition.cc
Modified: trunk/libzypp/zypp/Edition.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Edition.cc?rev=5425…
==============================================================================
--- trunk/libzypp/zypp/Edition.cc (original)
+++ trunk/libzypp/zypp/Edition.cc Fri Apr 20 14:27:44 2007
@@ -202,9 +202,9 @@
/** return validated version/release or throw */
static const std::string & validateVR( const std::string & vr_r )
{
- str::smatch what;
- if( ! str::regex_match( vr_r.begin(), vr_r.end(), what, _rxVR ) )
+ if ( vr_r.find('-') != string::npos )
ZYPP_THROW( Exception(string("Invalid version/release: ")+vr_r) );
+
return vr_r;
}
@@ -212,13 +212,10 @@
std::string _version;
std::string _release;
- static const str::regex _rxVR;
static const str::regex _rxEdition;
};
///////////////////////////////////////////////////////////////////
- const str::regex Edition::Impl::_rxVR( "([^-]*)" );
-
const str::regex Edition::Impl::_rxEdition( "(([0-9]+):)?([^-]*)(-([^-]*))?" );
///////////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0