Commit 6ec6be0c by Thomas Perl

Merge branch 'upstream-sync' into 'master'

Sync to version 14.35.0

See merge request !3
2 parents ac1c1e04 5f10c186
Showing 399 changed files with 1519 additions and 1439 deletions
......@@ -4,10 +4,33 @@ SET( PACKAGE "libzypp" )
SET( CMAKE_MODULE_PATH ${LIBZYPP_SOURCE_DIR}/cmake/modules )
cmake_minimum_required(VERSION 2.6)
OPTION (ENABLE_BUILD_DOCS "Build documentation by default?" OFF)
OPTION (ENABLE_BUILD_TRANS "Build translation files by default?" OFF)
OPTION (ENABLE_BUILD_TESTS "Build and run test suite by default?" OFF)
OPTION (DISABLE_LIBPROXY "Build without libproxy support even if package is installed?" OFF)
OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to build autodocs)?" OFF)
#--------------------------------------------------------------------------------
SET (have_system x)
IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
SET (ENABLE_BUILD_DOCS ON)
SET (ENABLE_BUILD_TRANS ON)
SET (ENABLE_BUILD_TESTS ON)
SET (have_system ${have_system}x)
ENDIF (DEBIAN)
IF (${have_system} STREQUAL x)
MESSAGE (STATUS "Building for SUSE")
ENDIF (${have_system} STREQUAL x)
IF (${have_system} STRGREATER xx)
MESSAGE (FATAL_ERROR "Can only build for one system type.")
ENDIF (${have_system} STRGREATER xx)
#--------------------------------------------------------------------------------
# allow name libraries by name mixed with full
# paths
if(COMMAND cmake_policy)
......@@ -29,8 +52,8 @@ include(CheckCXXCompilerFlag)
CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY)
CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++0x" )
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wl,-as-needed" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++11" )
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed" )
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" )
......@@ -62,7 +85,7 @@ MACRO(ADD_TESTS)
FOREACH( loop_var ${ARGV} )
SET_SOURCE_FILES_PROPERTIES( ${loop_var}_test.cc COMPILE_FLAGS "-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_AUTO_TEST_MAIN=\"\" " )
ADD_EXECUTABLE( ${loop_var}_test ${loop_var}_test.cc )
TARGET_LINK_LIBRARIES( ${loop_var}_test zypp boost_unit_test_framework zypp_test_utils)
TARGET_LINK_LIBRARIES( ${loop_var}_test zypp ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} zypp_test_utils)
ADD_TEST( ${loop_var}_test ${CMAKE_CURRENT_BINARY_DIR}/${loop_var}_test --catch_system_errors=no)
ENDFOREACH( loop_var )
ENDMACRO(ADD_TESTS)
......@@ -90,7 +113,7 @@ ELSE ( NOT RPM_FOUND)
endif ( RPM_SUSPECT_VERSION STREQUAL "5.x" )
ENDIF( NOT RPM_FOUND)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options unit_test_framework)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options thread unit_test_framework)
IF (Boost_FOUND)
MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
......@@ -105,19 +128,19 @@ ELSE (GETTEXT_FOUND)
MESSAGE( FATAL_ERROR "Gettext not found" )
ENDIF (GETTEXT_FOUND)
FIND_PACKAGE(Curl REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
IF ( NOT CURL_FOUND)
MESSAGE( FATAL_ERROR " curl not found" )
ELSE ( NOT CURL_FOUND)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
ENDIF( NOT CURL_FOUND)
FIND_PACKAGE(Libxml REQUIRED)
IF ( NOT LIBXML_FOUND)
FIND_PACKAGE(LibXml2 REQUIRED)
IF ( NOT LIBXML2_FOUND)
MESSAGE( FATAL_ERROR " libxml not found" )
ELSE ( NOT LIBXML_FOUND)
INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
ENDIF( NOT LIBXML_FOUND)
ELSE ( NOT LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
ENDIF( NOT LIBXML2_FOUND)
FIND_PACKAGE(ZLIB REQUIRED)
IF ( NOT ZLIB_FOUND)
......@@ -213,15 +236,23 @@ INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/zypp-history.lr DESTINATION ${SYSCONFDIR}/l
####################################################################
ADD_SUBDIRECTORY( zypp )
#ADD_SUBDIRECTORY( zypp2 )
# do not build devel by default
ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( tools )
ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( doc )
ADD_SUBDIRECTORY( vendor )
ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
IF ( ENABLE_BUILD_TRANS )
ADD_SUBDIRECTORY( po )
ELSE ( ENABLE_BUILD_TRANS )
ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
ENDIF ( ENABLE_BUILD_TRANS )
IF ( ENABLE_BUILD_TESTS )
ADD_SUBDIRECTORY( tests )
ELSE ( ENABLE_BUILD_TESTS )
ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
ENDIF ( ENABLE_BUILD_TESTS )
INCLUDE(CTest)
ENABLE_TESTING()
......@@ -58,11 +58,11 @@
# - Consider calling ./mkChangelog to assist you.
# See './mkChangelog -h' for help.
#
SET(LIBZYPP_MAJOR "12")
SET(LIBZYPP_COMPATMINOR "0")
SET(LIBZYPP_MINOR "2")
SET(LIBZYPP_MAJOR "14")
SET(LIBZYPP_COMPATMINOR "30")
SET(LIBZYPP_MINOR "35")
SET(LIBZYPP_PATCH "0")
#
# LAST RELEASED: 12.2.0 (0)
# LAST RELEASED: 14.35.0 (30)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
# Already in cache, be silent
set(CURL_FIND_QUIETLY TRUE)
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
set(CURL_LIBRARY)
set(CURL_INCLUDE_DIR)
FIND_PATH(CURL_INCLUDE_DIR curl/curl.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(CURL_LIBRARY NAMES curl
PATHS
/usr/lib
/usr/local/lib
)
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl found: includes in ${CURL_INCLUDE_DIR}, library in ${CURL_LIBRARY}")
set(CURL_FOUND TRUE)
else(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl not found")
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MARK_AS_ADVANCED(CURL_INCLUDE_DIR CURL_LIBRARY)
\ No newline at end of file
......@@ -49,6 +49,8 @@ MACRO( GETTEXT_CREATE_TARBALL_TRANSLATIONS _translation_set_basename )
ADD_CUSTOM_COMMAND(
OUTPUT ${TRANSLATION_SET_CONTENT}
COMMAND tar xfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
COMMAND sed -i '/^msgid/s/do not forbid installation of %s/remove lock to allow installation of %s/' *.po
COMMAND sed -i '/^msgid/s/do not keep %s installed/remove lock to allow removal of %s/' *.po
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
)
......
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
# Already in cache, be silent
set(LIBXML_FIND_QUIETLY TRUE)
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
set(LIBXML_LIBRARY)
set(LIBXML_INCLUDE_DIR)
FIND_PATH(LIBXML_INCLUDE_DIR libxml/parser.h
/usr/include
/usr/include/libxml2
/usr/local/include
)
FIND_LIBRARY(LIBXML_LIBRARY NAMES xml2
PATHS
/usr/lib
/usr/local/lib
)
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml found: includes in ${LIBXML_INCLUDE_DIR}, library in ${LIBXML_LIBRARY}")
set(LIBXML_FOUND TRUE)
else(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml not found")
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MARK_AS_ADVANCED(LIBXML_INCLUDE_DIR LIBXML_LIBRARY)
\ No newline at end of file
......@@ -8,6 +8,13 @@ ELSE ( DEFINED LIB )
SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
ENDIF ( DEFINED LIB )
MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
# Headers
IF (DEFINED INCLUDE)
SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}")
else (DEFINED INCLUDE)
SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
ENDIF (DEFINED INCLUDE)
MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}")
# system configuration dir (etc)
IF( NOT DEFINED SYSCONFDIR )
......@@ -117,7 +124,7 @@ MACRO(GENERATE_PACKAGING PACKAGE VERSION)
SPECFILE()
ADD_CUSTOM_TARGET( svncheck
COMMAND cd $(CMAKE_SOURCE_DIR) && LC_ALL=C git status | grep -q "nothing to commit .working directory clean."
COMMAND cd ${CMAKE_SOURCE_DIR} && LC_ALL=C git status | grep -q "nothing to commit .working directory clean."
)
SET( AUTOBUILD_COMMAND
......
......@@ -4,4 +4,3 @@ CONFIGURE_FILE(${LIBZYPP_SOURCE_DIR}/devel/genclass.in ${LIBZYPP_BINARY_DIR}/dev
ADD_SUBDIRECTORY(devel.dmacvicar)
ADD_SUBDIRECTORY(devel.ma)
ADD_SUBDIRECTORY(devel.jkupec)
ADD_DEFINITIONS(
-DSRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
-DTESTS_SRC_DIR="${LIBZYPP_SOURCE_DIR}/tests"
)
SET( bridge_SRCS
bridge/bridge.cc
bridge/BaseImpl.cc
bridge/Derived.cc
)
SET( bridge_HEADERS
bridge/Base.h
bridge/BaseImpl.h
bridge/Derived.h
)
#ADD_EXECUTABLE( bridge ${bridge_SRCS} )
#TARGET_LINK_LIBRARIES( bridge zypp )
#ADD_EXECUTABLE( deltarpm deltarpm.cc )
#TARGET_LINK_LIBRARIES( deltarpm zypp )
#ADD_EXECUTABLE( pathinfo pathinfo.cc )
#TARGET_LINK_LIBRARIES( pathinfo zypp )
ADD_EXECUTABLE( poolquery poolquery.cc )
TARGET_LINK_LIBRARIES( poolquery zypp )
ADD_EXECUTABLE( repos repos.cc )
TARGET_LINK_LIBRARIES( repos zypp )
#ADD_EXECUTABLE( yumparsertest YUMParser_test.cc )
#TARGET_LINK_LIBRARIES( yumparsertest zypp )
ADD_EXECUTABLE( play play.cc )
TARGET_LINK_LIBRARIES( play zypp boost_signals )
#include "zypp/ZYpp.h"
#include "zypp/ZYppFactory.h"
#include "zypp/base/Logger.h"
#include "zypp/base/LogControl.h"
#include "zypp/base/Measure.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/parser/yum/RepoParser.h"
#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "yumparsertest"
using namespace std;
using namespace zypp;
using namespace zypp::parser::yum;
using zypp::debug::Measure;
bool progress_function(ProgressData::value_type p)
{
cout << "Parsing YUM source [" << p << "%]" << endl;
// cout << "\rParsing YUM source [" << p << "%]" << flush;
return true;
}
int main(int argc, char **argv)
{
base::LogControl::instance().logfile("yumparsertest.log");
if (argc < 2)
{
cout << "usage: yumparsertest path/to/yumsourcedir" << endl << endl;
return 1;
}
try
{
ZYpp::Ptr z = getZYpp();
Measure open_repository_timer("CacheStore: lookupOrAppendRepository");
cache::CacheStore store(getenv("PWD"));
data::RecordId repository_id = store.lookupOrAppendRepository("somealias");
open_repository_timer.stop();
MIL << "creating PrimaryFileParser" << endl;
Measure parse_primary_timer("primary.xml.gz parsing");
parser::yum::RepoParser parser( repository_id, store, &progress_function);
parser.parse(argv[1]);
store.commit();
parse_primary_timer.stop();
cout << endl;
}
catch ( const Exception &e )
{
cout << "Oops! " << e.msg() << std::endl;
}
return 0;
}
// vim: set ts=2 sts=2 sw=2 et ai:
#ifndef JK_BASE_H_
#define JK_BASE_H_
#include "zypp/base/NonCopyable.h"
namespace jk
{
class Base : private zypp::base::NonCopyable
{
protected:
class BaseImpl;
};
} // ns jk
#endif /*JK_BASE_H_*/
// vim: set ts=2 sts=2 sw=2 et ai:
#include "BaseImpl.h"
using namespace std;
namespace jk
{
Base::BaseImpl::BaseImpl()
{}
} // ns zypp
// vim: set ts=2 sts=2 sw=2 et ai:
#ifndef JK_BASEIMPL_H_
#define JK_BASEIMPL_H_
#include "zypp/base/NonCopyable.h"
#include "Base.h"
namespace jk
{
class Base::BaseImpl : private zypp::base::NonCopyable
{
public:
BaseImpl();
};
} // ns jk
#endif /*JK_BASEIMPL_H_*/
// vim: set ts=2 sts=2 sw=2 et ai:
#include "BaseImpl.h"
#include "Derived.h"
namespace jk
{
class Derived::Impl : public BaseImpl
{
public:
Impl();
};
Derived::Impl::Impl()
{}
Derived::Derived() : _pimpl(new Impl())
{}
Derived::~Derived()
{}
} // ns jk
// vim: set ts=2 sts=2 sw=2 et ai:
#ifndef JK_DERIVED_H_
#define JK_DERIVED_H_
#include "zypp/base/PtrTypes.h"
#include "Base.h"
namespace jk
{
class Derived : public Base
{
public:
Derived();
~Derived();
private:
class Impl;
zypp::RW_pointer<Impl,zypp::rw_pointer::Scoped<Impl> > _pimpl;
};
} // ns jk
#endif /*JK_DERIVED_H_*/
#include<iostream>
#include "zypp/base/Exception.h"
#include "Derived.h"
using namespace std;
using namespace jk;
using namespace zypp;
int main(int argc, char **argv)
{
try
{
Derived d;
}
catch ( const Exception &e )
{
cout << "Oops! " << e.msg() << std::endl;
}
return 0;
}
// vim: set ts=2 sts=2 sw=2 et ai:
<deltainfo>
<newpackage name="libzypp" epoch="0" version="4.21.3" release="2" arch="i386">
<delta oldepoch="0" oldversion="4.21.3" oldrelease="1">
<filename>DRPMS/libzypp-4.21.3-1_4.21.3-2.i386.drpm</filename>
<sequence>libzypp-4.21.3-1-d3571f98b048b1a870e40241bb46c67ab4</sequence>
<size>22452</size>
<checksum type="sha">8f05394695dee9399c204614e21e5f6848990ab7</checksum>
</delta>
<delta oldepoch="0" oldversion="4.21.2" oldrelease="3">
<filename>DRPMS/libzypp-4.21.2-3_4.21.3-2.i386.drpm</filename>
<sequence>libzypp-4.21.2-3-e82691677eee1e83b4812572c5c9ce8eb</sequence>
<size>110362</size>
<checksum type="sha">326658fee45c0baec1e70231046dbaf560f941ce</checksum>
</delta>
</newpackage>
</deltainfo>
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo">
<data type="other">
<location href="repodata/other.xml.gz"/>
<checksum type="sha">d41033826a12ce44a1b33eff2e7905785e0999da</checksum>
<timestamp>1211014822</timestamp>
<open-checksum type="sha">319b2951aad2417c8961442ba692d4700962043b</open-checksum>
</data>
<data type="updateinfo">
<location href="repodata/updateinfo.xml.gz"/>
<checksum type="sha">4f8f83525b232db93a761ed1be79515956b574cf</checksum>
<timestamp>1211014822</timestamp>
<open-checksum type="sha">70eb95f379e0db1c9815f0a1cb2269d93e408015</open-checksum>
</data>
<data type="primary">
<location href="repodata/primary.xml.gz"/>
<checksum type="sha">28a6aae0cd873e1df286d4a07fc7e54263fec79d</checksum>
<timestamp>1211014821</timestamp>
<open-checksum type="sha">5ad445e403218ef4a6585dbfc37ccf31d5a10096</open-checksum>
</data>
<data type="filelists">
<location href="repodata/filelists.xml.gz"/>
<checksum type="sha">553f609c610b0cf51b54efc4c5c618537707ac8d</checksum>
<timestamp>1211014821</timestamp>
<open-checksum type="sha">8c840e0b03ad8c2ed0d4ddf57f9a6b5cea3ac412</open-checksum>
</data>
<data type="deltainfo">
<location href="repodata/deltainfo.xml"/>
<checksum type="sha">cb4c1c8b35d3c486dde918de72a4e630434e5b40</checksum>
<timestamp>1210522397</timestamp>
<open-checksum type="sha">cb4c1c8b35d3c486dde918de72a4e630434e5b40</open-checksum>
</data>
</repomd>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQBILp6nqE7a6JyACsoRApMoAKCSmiVFYUOGXhWikMAKRrh0Lp0jaQCf
YN82OkmNZJRvtpBFUs/R5iCx7CU=
=BuV4
-----END PGP SIGNATURE-----
<deltainfo>
<newpackage name="libzypp" epoch="0" version="4.21.3" release="2" arch="i386">
<delta oldepoch="0" oldversion="4.21.3" oldrelease="1">
<filename>DRPMS/libzypp-4.21.3-1_4.21.3-2.i386.drpm</filename>
<sequence>libzypp-4.21.3-1-d3571f98b048b1a870e40241bb46c67ab4</sequence>
<size>22452</size>
<checksum type="sha">8f05394695dee9399c204614e21e5f6848990ab7</checksum>
</delta>
<delta oldepoch="0" oldversion="4.21.2" oldrelease="3">
<filename>DRPMS/libzypp-4.21.2-3_4.21.3-2.i386.drpm</filename>
<sequence>libzypp-4.21.2-3-e82691677eee1e83b4812572c5c9ce8eb</sequence>
<size>110362</size>
<checksum type="sha">326658fee45c0baec1e70231046dbaf560f941ce</checksum>
</delta>
</newpackage>
</deltainfo>
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo">
<data type="other">
<location href="repodata/other.xml.gz"/>
<checksum type="sha">d41033826a12ce44a1b33eff2e7905785e0999da</checksum>
<timestamp>1211014822</timestamp>
<open-checksum type="sha">319b2951aad2417c8961442ba692d4700962043b</open-checksum>
</data>
<data type="updateinfo">
<location href="repodata/updateinfo.xml.gz"/>
<checksum type="sha">4f8f83525b232db93a761ed1be79515956b574cf</checksum>
<timestamp>1211014822</timestamp>
<open-checksum type="sha">70eb95f379e0db1c9815f0a1cb2269d93e408015</open-checksum>
</data>
<data type="primary">
<location href="repodata/primary.xml.gz"/>
<checksum type="sha">28a6aae0cd873e1df286d4a07fc7e54263fec79d</checksum>
<timestamp>1211014821</timestamp>
<open-checksum type="sha">5ad445e403218ef4a6585dbfc37ccf31d5a10096</open-checksum>
</data>
<data type="filelists">
<location href="repodata/filelists.xml.gz"/>
<checksum type="sha">553f609c610b0cf51b54efc4c5c618537707ac8d</checksum>
<timestamp>1211014821</timestamp>
<open-checksum type="sha">8c840e0b03ad8c2ed0d4ddf57f9a6b5cea3ac412</open-checksum>
</data>
<data type="deltainfo">
<location href="repodata/deltainfo.xml"/>
<checksum type="sha">cb4c1c8b35d3c486dde918de72a4e630434e5b40</checksum>
<timestamp>1210522397</timestamp>
<open-checksum type="sha">cb4c1c8b35d3c486dde918de72a4e630434e5b40</open-checksum>
</data>
</repomd>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQBILp6nqE7a6JyACsoRApMoAKCSmiVFYUOGXhWikMAKRrh0Lp0jaQCf
YN82OkmNZJRvtpBFUs/R5iCx7CU=
=BuV4
-----END PGP SIGNATURE-----
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.0 (GNU/Linux)
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
=pJli
-----END PGP PUBLIC KEY BLOCK-----
subdir/anotherfile
\ No newline at end of file
-- what kinds of resolvables have been read?
select * from types where class = 'kind';
-- what languages have been encountered?
select * from types where class = 'lang';
-- what architectures have been read?
select * from types where class = 'arch';
-- what types of dependencies have been encountered?
select * from types where class = 'deptype';
-- ----------------------------------------------------------------------------
-- how many packages have been read?
select count(*) from resolvables r, types t where t.class = 'kind' and t.name = 'package' and t.id = r.kind;
-- print resolvable kind -> count table
select t.name, count(*) from resolvables r, types t where t.class = 'kind' and t.id = r.kind group by t.name;
-- what patches have been read? print id, name, and version
select r.id, r.name, r.version from resolvables r, types t where t.class = 'kind' and t.name = 'patch' and t.id = r.kind;
-- ----------------------------------------------------------------------------
-- print all text and numeric attributes of resolvable with id = 2
select a.weak_resolvable_id "res-id", t.class "attr-class", t.name "attr-name", a.text "value"
from text_attributes a, types t
where t.id = a.attr_id and a.weak_resolvable_id = 2
union
select a.weak_resolvable_id "res-id", t.class "attr-class", t.name "attr-name", a.value "value"
from numeric_attributes a, types t
where t.id = a.attr_id and a.weak_resolvable_id = 2
order by t.class
-- print all named dependencies of resolvable with id = 2
select dt.name "dtype", kt.name "kind", n.name "name", rt.name "rel", c.version "version"
from named_capabilities c, types dt, types kt, types rt, names n
where c.dependency_type = dt.id
and c.refers_kind= kt.id
and c.relation = rt.id
and c.name_id = n.id
and c.resolvable_id = 2;
-- print all file dependencies of resolvable with id = 2
select dt.name "dtype", kt.name "kind", (dname.name || '/' || fname.name) "file"
from file_capabilities c, types dt, types kt, files f
left outer join file_names fname on fname.id = f.file_name_id
left outer join dir_names dname on dname.id = f.dir_name_id
where c.dependency_type = dt.id
and c.refers_kind= kt.id
and c.file_id = f.id
and c.resolvable_id = 2;
#include <stdio.h>
#include <iostream>
#include <iterator>
#include <list>
extern "C"
{
#include <solv/repo.h>
}
#include "zypp/ZYppFactory.h"
#include "zypp/Pathname.h"
#include "zypp/RepoManager.h"
#include "zypp/repo/DeltaCandidates.h"
#include "zypp/PoolQuery.h"
using std::cout;
using std::endl;
using std::string;
using namespace zypp;
struct PrintAndCount
{
PrintAndCount() : _count(0) {}
bool operator()( const sat::Solvable & solvable )
{
zypp::PoolItem pi( zypp::ResPool::instance().find( solvable ) );
cout << pi.resolvable() << endl;
// name: yast2-sound 2.16.2-9 i586
++_count;
return true;
}
unsigned _count;
};
int main (int argc, const char ** argv)
{
Pathname rootdir(SRC_DIR "/data/deltarpm");
RepoManagerOptions opts(rootdir);
opts.repoRawCachePath = rootdir;
opts.repoSolvCachePath = rootdir;
RepoManager rm(opts);
RepoInfo updates;
updates.setAlias("updates");
updates.addBaseUrl(Url(string("dir:") + rootdir.absolutename().asString() + "/updates"));
RepoInfo updates2;
updates2.setAlias("updates2");
updates2.addBaseUrl(Url(string("dir:") + rootdir.absolutename().asString() + "/updates2"));
try
{
rm.buildCache(updates);
rm.buildCache(updates2);
rm.loadFromCache(updates);
rm.loadFromCache(updates2);
}
catch (const Exception & e)
{
cout << "Problem getting the data: " << e.msg() << endl;
}
sat::Pool pool(sat::Pool::instance());
for_(repoit, pool.reposBegin(), pool.reposEnd())
{
Repository repo(*repoit);
for (int i = 0; i < repo.get()->nextra; ++i)
{
cout << endl << "extra " << i << ":" << endl;
::Dataiterator di;
::dataiterator_init(&di, repo.get(), -1 - i, 0, 0, SEARCH_EXTRA | SEARCH_NO_STORAGE_SOLVABLE);
while (::dataiterator_step(&di))
{
const char * keyname;
keyname = ::id2str(repo.get()->pool, di.key->name);
cout << keyname << ": ";
switch (di.key->name)
{
case DELTA_PACKAGE_NAME:
{
cout << IdString(di.kv.id);
break;
}
case DELTA_PACKAGE_EVR:
{
cout << IdString(di.kv.id);
break;