Commit 8068e401 by Thomas Perl

[upstream] Sync to version 14.35.0

parent ac1c1e04
......@@ -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>