From: Michael Schroeder Date: Tue, 24 May 2011 13:51:09 +0000 (+0200) Subject: rename satsolver -> libsolv X-Git-Tag: BASE-SuSE-Code-12_1-Branch~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd5d62a01ff1b50c26507a9f27a7df18febacc4;p=thirdparty%2Flibsolv.git rename satsolver -> libsolv --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a65dcb0e..618be035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,132 +1,129 @@ -PROJECT(satsolver) +PROJECT (libsolv) -cmake_minimum_required(VERSION 2.4) +cmake_minimum_required (VERSION 2.4) #IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4) #ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4) -if(COMMAND cmake_policy) +IF (COMMAND cmake_policy) # escape preprocessor, see -DVERSION below - cmake_policy(SET CMP0005 OLD) -endif(COMMAND cmake_policy) + cmake_policy (SET CMP0005 OLD) +ENDIF (COMMAND cmake_policy) # Library -IF ( DEFINED LIB ) - SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" ) -ELSE ( DEFINED LIB ) +IF (DEFINED LIB) + SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}") +ELSE (DEFINED LIB) IF (CMAKE_SIZEOF_VOID_P MATCHES "8") - SET( LIB_SUFFIX "64" ) - ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8") - SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" ) -ENDIF ( DEFINED LIB ) -MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" ) -SET( BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" ) + SET (LIB_SUFFIX "64") + ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8") + SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") +ENDIF (DEFINED LIB) +MESSAGE (STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}") +SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") #################################################################### # CONFIGURATION # #################################################################### # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ) +SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) -INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake ) +INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake) -FIND_PACKAGE(EXPAT REQUIRED) -FIND_PACKAGE(Check REQUIRED) -FIND_PACKAGE(ZLIB REQUIRED) +FIND_PACKAGE (EXPAT REQUIRED) +FIND_PACKAGE (Check REQUIRED) +FIND_PACKAGE (ZLIB REQUIRED) -IF ( FEDORA ) +IF (FEDORA) MESSAGE(STATUS "Building for Fedora") -ADD_DEFINITIONS( -DFEDORA ) -ENDIF ( FEDORA) - -IF ( DEBIAN ) -MESSAGE(STATUS "Building for Debian") -ADD_DEFINITIONS( -DDEBIAN -DDEBIAN_SEMANTICS) -ENDIF ( DEBIAN ) - -IF ( MULTI_SEMANTICS ) -MESSAGE(STATUS "Enabling multi dist support") -ADD_DEFINITIONS( -DMULTI_SEMANTICS) -ENDIF ( MULTI_SEMANTICS ) - -IF ( RPM5 ) -MESSAGE(STATUS "Enabling RPM 5 support") -ADD_DEFINITIONS( -DRPM5) -FIND_PACKAGE(PkgConfig REQUIRED) -PKG_CHECK_MODULES(RPM REQUIRED rpm) -INCLUDE_DIRECTORIES( ${RPM_INCLUDE_DIRS} ) -ENDIF (RPM5 ) - - -IF ( RPM5 OR NOT DEBIAN ) -FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb) - -IF ( NOT RPMDB_LIBRARY ) -FIND_LIBRARY(RPMDB_LIBRARY NAMES rpm) -ENDIF( NOT RPMDB_LIBRARY ) - -FIND_LIBRARY(RPMIO_LIBRARY NAMES rpmio) -IF ( RPMIO_LIBRARY ) -SET( RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY} ) -ENDIF ( RPMIO_LIBRARY ) - -IF ( RPM5 ) -FIND_LIBRARY(RPMMISC_LIBRARY NAMES rpmmisc) -IF ( RPMMISC_LIBRARY ) -SET ( RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY} ) -ENDIF ( RPMMISC_LIBRARY ) -ENDIF ( RPM5 ) - -IF ( RPM5 OR FEDORA ) -FIND_LIBRARY(DB_LIBRARY NAMES db) -IF ( DB_LIBRARY ) -SET( RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY} ) -ENDIF ( DB_LIBRARY ) -ENDIF ( RPM5 OR FEDORA ) - -ENDIF ( RPM5 OR NOT DEBIAN ) - -INCLUDE ( CheckFunctionExists ) -INCLUDE ( TestBigEndian ) - -CHECK_FUNCTION_EXISTS( strchrnul HAVE_STRCHRNUL ) -CHECK_FUNCTION_EXISTS( fopencookie HAVE_FOPENCOOKIE ) -CHECK_FUNCTION_EXISTS( funopen HAVE_FUNOPEN ) -TEST_BIG_ENDIAN( WORDS_BIGENDIAN ) +ADD_DEFINITIONS (-DFEDORA) +ENDIF (FEDORA) + +IF (DEBIAN) +MESSAGE (STATUS "Building for Debian") +ADD_DEFINITIONS (-DDEBIAN -DDEBIAN_SEMANTICS) +ENDIF (DEBIAN) + +IF (MULTI_SEMANTICS) +MESSAGE (STATUS "Enabling multi dist support") +ADD_DEFINITIONS (-DMULTI_SEMANTICS) +ENDIF (MULTI_SEMANTICS) + +IF (RPM5) +MESSAGE (STATUS "Enabling RPM 5 support") +ADD_DEFINITIONS (-DRPM5) +FIND_PACKAGE (PkgConfig REQUIRED) +PKG_CHECK_MODULES (RPM REQUIRED rpm) +INCLUDE_DIRECTORIES (${RPM_INCLUDE_DIRS}) +ENDIF (RPM5) + + +IF (RPM5 OR NOT DEBIAN) +FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb) + +IF (NOT RPMDB_LIBRARY) +FIND_LIBRARY (RPMDB_LIBRARY NAMES rpm) +ENDIF (NOT RPMDB_LIBRARY) + +FIND_LIBRARY (RPMIO_LIBRARY NAMES rpmio) +IF (RPMIO_LIBRARY) +SET(RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY}) +ENDIF (RPMIO_LIBRARY) + +IF (RPM5) +FIND_LIBRARY (RPMMISC_LIBRARY NAMES rpmmisc) +IF (RPMMISC_LIBRARY) +SET (RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY}) +ENDIF (RPMMISC_LIBRARY) +ENDIF (RPM5) + +IF (RPM5 OR FEDORA) +FIND_LIBRARY (DB_LIBRARY NAMES db) +IF (DB_LIBRARY) +SET (RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY}) +ENDIF (DB_LIBRARY) +ENDIF (RPM5 OR FEDORA) + +ENDIF (RPM5 OR NOT DEBIAN) + +INCLUDE (CheckFunctionExists) +INCLUDE (TestBigEndian) + +CHECK_FUNCTION_EXISTS (strchrnul HAVE_STRCHRNUL) +CHECK_FUNCTION_EXISTS (fopencookie HAVE_FOPENCOOKIE) +CHECK_FUNCTION_EXISTS (funopen HAVE_FUNOPEN) +TEST_BIG_ENDIAN (WORDS_BIGENDIAN) # should create config.h with #cmakedefine instead... -FOREACH( VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN ) - IF( ${VAR} ) - ADD_DEFINITIONS( -D${VAR}=1 ) - ENDIF( ${VAR} ) -ENDFOREACH( VAR ) - -SET( PACKAGE "satsolver" ) -SET( VERSION "${LIBSATSOLVER_MAJOR}.${LIBSATSOLVER_MINOR}.${LIBSATSOLVER_PATCH}" ) - -ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 ) -ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" ) -CONFIGURE_FILE( src/satversion.h.in src/satversion.h ) - -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SAT Solver library") -SET(CPACK_PACKAGE_VENDOR "Novell Inc.") -SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBSATSOLVER_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${LIBSATSOLVER_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${LIBSATSOLVER_PATCH}) -SET(CPACK_GENERATOR "TBZ2") -SET(CPACK_SOURCE_GENERATOR "TBZ2") -SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}") -SET(CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source:") -SET(CPACK_TOPLEVEL_TAG "Linux-Source:") +FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN) + IF(${VAR}) + ADD_DEFINITIONS (-D${VAR}=1) + ENDIF (${VAR}) +ENDFOREACH (VAR) + +SET (PACKAGE "libsolv") +SET (VERSION "${LIBSOLV_MAJOR}.${LIBSOLV_MINOR}.${LIBSOLV_PATCH}") + +ADD_DEFINITIONS (-D_FILE_OFFSET_BITS=64) +ADD_DEFINITIONS (-DVERSION=\\\"${VERSION}\\\") +CONFIGURE_FILE (src/satversion.h.in src/satversion.h) + +SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "SAT Solver library") +SET (CPACK_PACKAGE_VENDOR "SUSE") +SET (CPACK_PACKAGE_VERSION_MAJOR ${LIBSOLV_MAJOR}) +SET (CPACK_PACKAGE_VERSION_MINOR ${LIBSOLV_MINOR}) +SET (CPACK_PACKAGE_VERSION_PATCH ${LIBSOLV_PATCH}) +SET (CPACK_GENERATOR "TBZ2") +SET (CPACK_SOURCE_GENERATOR "TBZ2") +SET (CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}") +SET (CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source:") +SET (CPACK_TOPLEVEL_TAG "Linux-Source:") # 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 -#svn files -"\\\\.svn/" -"\\\\.cvsignore$" # temporary files "\\\\.swp$" # backup files @@ -143,7 +140,6 @@ SET (CPACK_SOURCE_IGNORE_FILES "/_build/" "/\\\\.git/" # used before -"/CVS/" "/\\\\.libs/" "/\\\\.deps/" "\\\\.o$" @@ -160,14 +156,14 @@ SET (CPACK_SOURCE_IGNORE_FILES "CTestTestfile.cmake" "CPackConfig.cmake$" "CPackSourceConfig.cmake$" -"libsatsolver.spec$" +"libsolv.spec$" ) INCLUDE(CPack) #################################################################### -SET( DOC_INSTALL_DIR +SET (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}" CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})" FORCE @@ -178,61 +174,44 @@ SET( DOC_INSTALL_DIR #################################################################### #SET (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) -INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/ext ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src SYSTEM ) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/ext ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src SYSTEM ) #################################################################### -MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}") +MESSAGE (STATUS "Looking modules in ${CMAKE_MODULE_PATH}") -set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall" ) -set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -g -O3" ) -set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0" ) +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall") +set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -g -O3") +set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0") -ADD_SUBDIRECTORY(src) -ADD_SUBDIRECTORY(ext) -ADD_SUBDIRECTORY(tools) -ADD_SUBDIRECTORY(tests) -ADD_SUBDIRECTORY(examples) -ADD_SUBDIRECTORY(doc) +ADD_SUBDIRECTORY (src) +ADD_SUBDIRECTORY (ext) +ADD_SUBDIRECTORY (tools) +ADD_SUBDIRECTORY (examples) -MESSAGE(STATUS "version: ${VERSION}") +MESSAGE (STATUS "version: ${VERSION}") #################################################################### # RPM SPEC # #################################################################### -MACRO(SPECFILE) - MESSAGE(STATUS "Writing spec file...") - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/libsatsolver.spec.in ${CMAKE_BINARY_DIR}/package/libsatsolver.spec @ONLY) - #MESSAGE(STATUS "I hate you rpm-lint...!!!") - #CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/libsatsolver-rpmlint.cmake ${CMAKE_BINARY_DIR}/package/libsatsolver-rpmlintrc @ONLY) -ENDMACRO(SPECFILE) +MACRO (SPECFILE) + MESSAGE (STATUS "Writing spec file...") + CONFIGURE_FILE (${CMAKE_SOURCE_DIR}/package/libsolv.spec.in ${CMAKE_BINARY_DIR}/package/libsolv.spec @ONLY) +ENDMACRO (SPECFILE) -SPECFILE() +SPECFILE () -ADD_CUSTOM_TARGET( svncheck - COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision' -) - -SET( AUTOBUILD_COMMAND +SET (AUTOBUILD_COMMAND COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2 COMMAND mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG} COMMAND ${CMAKE_MAKE_PROGRAM} package_source COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/libsatsolver.changes" "${CMAKE_BINARY_DIR}/package/libsatsolver.changes" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/libsolv.changes" "${CMAKE_BINARY_DIR}/package/libsolv.changes" ) -ADD_CUSTOM_TARGET( srcpackage_local +ADD_CUSTOM_TARGET (srcpackage ${AUTOBUILD_COMMAND} ) -ADD_CUSTOM_TARGET( srcpackage - COMMAND ${CMAKE_MAKE_PROGRAM} svncheck - ${AUTOBUILD_COMMAND} -) - -INCLUDE(CTest) -ENABLE_TESTING() - - diff --git a/CTestConfig.cmake b/CTestConfig.cmake deleted file mode 100644 index 8913c148..00000000 --- a/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(CTEST_PROJECT_NAME "sat-solver") -set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") -set(UPDATE_TYPE "svn") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "yast.suse.de") -set(CTEST_DROP_LOCATION "/cdash/submit.php?project=sat-solver") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/README b/README index bab2c62c..145ab497 100644 --- a/README +++ b/README @@ -1,10 +1,5 @@ -SAT-Solver - -Using a Satisfyability Solver to compute package dependencies. - -See http://idea.opensuse.org/content/ideas/fast-installation-tool -for the motivation. - +libsolv, a free package dependency solver using a satisfyability +algorihtm This code is based on two major, but independent, blocks @@ -12,20 +7,9 @@ This code is based on two major, but independent, blocks and dependency information. 2. Using satisfiability, a well known and researched topic, for - computing package dependencies. - + resolving package dependencies. Google for 'sat solver' to get links to the theory behind it. -http://pinboard.in/u:kkaempf/t:solver gives a collection of bookmarks -related to this topic. - -Some research papers are in doc/pdf. - -Everything else is below doc. - -Please subscribe to zypp-devel@opensuse.org for any questions. - -* How to build Requires: cmake 2.4.x @@ -34,9 +18,6 @@ cd build cmake .. make -To install ruby bindings: -make install - To create a package make srcpackage see package/ diff --git a/VERSION.cmake b/VERSION.cmake index 173a3402..d11f4031 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -44,8 +44,7 @@ # set COMPATMINOR to MINOR. (binary incompatible change) # -SET(LIBSATSOLVER_MAJOR "0") -SET(LIBSATSOLVER_MINOR "17") -SET(LIBSATSOLVER_PATCH "0") +SET(LIBSOLV_MAJOR "0") +SET(LIBSOLV_MINOR "0") +SET(LIBSOLV_PATCH "0") -# last released 0.17.0 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4e2491fe..1a291160 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,8 +1,8 @@ ADD_EXECUTABLE(solv solv.c) IF ( DEBIAN ) -TARGET_LINK_LIBRARIES(solv satsolverext satsolver ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(solv libsolvext libsolv ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) ELSE ( DEBIAN ) -TARGET_LINK_LIBRARIES(solv satsolverext satsolver ${RPMDB_LIBRARY} ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(solv libsolvext libsolv ${RPMDB_LIBRARY} ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) ENDIF ( DEBIAN ) install(TARGETS diff --git a/examples/perl/example.pl b/examples/perl/example.pl deleted file mode 100644 index d969e569..00000000 --- a/examples/perl/example.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl - -use lib '../../build/bindings/perl'; - -use satsolverx; - -# Open Solvable file -# open(F, "gzip -cd tmp/primary.gz |") || die; - -# Create Pool and Repository -my $pool = new satsolverx::Pool; -$pool->set_arch( 'i686' ); -my $repo = $pool->create_repo('repo'); - -# Add Solvable to Repository -$repo->add_solv ("tmp/primary"); -# close(F) || die; - -# Create Solver -my $solver = $pool->create_solver(); - -# Create dependencies to provides table -$pool->prepare(); - -# Create Transactions -my $job = $pool->create_transaction(); - -# Push jobs on Queue -my $pat = $pool->find("pattern:default") || die; -$job->install($pat); - -# $job -> install("pattern:default"); - -# Solve the jobs -$solver->solve ($job); - -# Print packages to install -$a = $solver->getInstallList(); -for my $c (@$a) { - print "$c\n"; -} - diff --git a/examples/perl/tmp/primary.gz b/examples/perl/tmp/primary.gz deleted file mode 100644 index 04bb0204..00000000 Binary files a/examples/perl/tmp/primary.gz and /dev/null differ diff --git a/examples/perl/tmp/repo2solv.pl b/examples/perl/tmp/repo2solv.pl deleted file mode 100755 index 1497ce02..00000000 --- a/examples/perl/tmp/repo2solv.pl +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/perl - -use lib '/usr/share/kiwi/modules'; - -use strict; -use KIWIXML; - -our $BasePath = "/usr/share/kiwi"; -our $Scheme = $BasePath."/modules/KIWIScheme.rng"; - -my $kiwi = new KIWILog ("tiny"); -my $xml = new KIWIXML ($kiwi,"/usr/share/kiwi/image/isoboot/suse-10.3"); - -#my @list = ("http://download.opensuse.org/distribution/10.3/repo/oss"); -my @list = ("/image/CDs/full-10.3-i386"); -my $data = $xml -> getInstSourceSatSolvable (\@list); - -if (defined $data) { - print "$data\n"; -} diff --git a/examples/perl/tmp/repo2solv.sh b/examples/perl/tmp/repo2solv.sh deleted file mode 100755 index 4b2c5ee7..00000000 --- a/examples/perl/tmp/repo2solv.sh +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh -# repo2solv -# -# give it a directory of a local mirror of a repo and this -# tries to detect the repo type and generate one SOLV file on stdout -# set -x - -LANG=C - -dir="$1" - -cd "$dir" || exit 1 - - -if test -d suse/setup/descr; then - olddir=`pwd` - cd suse/setup/descr || exit 2 - filepack=`mktemp` || exit 3 - - ( - # First packages - if test -s packages.gz; then - gzip -dc packages.gz - elif test -s packages.bz2; then - bzip2 -dc packages.bz2 - elif test -s packages; then - cat packages - fi - - # patterns: but only those mentioned in the file 'patterns' - if test -f patterns; then - for i in `cat patterns`; do - test -s "$i" || continue - case $i in - *.gz) gzip -dc "$i" ;; - *.bz2) bzip2 -dc "$i" ;; - *) cat "$i" ;; - esac - done - fi - ) | susetags2solv > $filepack - - cd "$olddir" - mergesolv $filecont $filepack - rm -f $filepack -fi diff --git a/examples/ruby/10_3-x86_64-patterns.solv b/examples/ruby/10_3-x86_64-patterns.solv deleted file mode 100644 index 3a0f9d16..00000000 Binary files a/examples/ruby/10_3-x86_64-patterns.solv and /dev/null differ diff --git a/examples/ruby/basic.rb b/examples/ruby/basic.rb deleted file mode 100644 index 5ff9553b..00000000 --- a/examples/ruby/basic.rb +++ /dev/null @@ -1,52 +0,0 @@ -$: << "../../build/bindings/ruby" -require 'satsolver' -include SatSolver - -pool = Pool.new -#puts pool.methods.sort - -#s = pool.add_empty_repo - -s = pool.create_repo('foo'); -s.add_solv('../../testsuite/data.libzypp/basic-exercises/exercise-20-packages.solv'); - -installed = pool.create_repo('system'); -installed.add_solv('../../testsuite/data.libzypp/basic-exercises/exercise-20-system.solv'); - -pool.each_repo do |repo| - puts repo.name -end - -s.each do |r| - puts r -end - -r = pool.find('G', s) -puts r - -t = pool.create_transaction -t.install( r ) - -pool.prepare -pool.promoteepoch = 1 - -solv = Solver.new(pool, installed) - -solv.fix_system = 0 -solv.update_system = 0 -solv.allow_downgrade = 0 -solv.allow_uninstall = 0 -solv.no_update_provide = 0 - -# solve the queue -solv.solve(t) - -#solv.print_decisions - -solv.each_to_install do |i| - puts "to install #{i}" -end - -solv.each_to_remove do |i| - puts "to remove #{i}" -end diff --git a/examples/ruby/decision.rb b/examples/ruby/decision.rb deleted file mode 100644 index 872849e8..00000000 --- a/examples/ruby/decision.rb +++ /dev/null @@ -1,21 +0,0 @@ -# -# Extend SatSolver::Decision with to_s -# - -class Satsolverx::Decision - def to_s - case self.op - when SatSolver::DEC_INSTALL - return "Install #{self.solvable} #{self.reason}" - when SatSolver::DEC_REMOVE - return "Remove #{self.solvable} #{self.reason}" - when SatSolver::DEC_OBSOLETE - return "Obsolete #{self.solvable} #{self.reason}" - when SatSolver::DEC_UPDATE - return "Update #{self.solvable} #{self.reason}" - else - return "Decision op #{self.op}" - end - "**Decision**" - end -end diff --git a/examples/ruby/patterncheck.rb b/examples/ruby/patterncheck.rb deleted file mode 100644 index 78ba2331..00000000 --- a/examples/ruby/patterncheck.rb +++ /dev/null @@ -1,230 +0,0 @@ -# -# patterncheck.rb -# -# First approach to 'rpm-only' pattern management -# - seperate pattern into 'pattern deps' and 'package deps' -# - solve patterns only -# - use the resulting packages deps to check the system -# - -# -# Fully print dependency -# - -def fullprint_deps name, deps - print "#{name}: " - first = true - deps.each do |d| - print "\t" unless first - puts "#{d}" - first = false - end - puts if first -end - -# -# Fully print solvable s, including dependencies -# - -def fullprint_solvable solvable - puts "Solvable #{solvable}" - fullprint_deps "Provides", solvable.provides - fullprint_deps "Requires", solvable.requires - fullprint_deps "Conflicts", solvable.conflicts - fullprint_deps "Obsoletes", solvable.obsoletes - fullprint_deps "Recommends", solvable.recommends - fullprint_deps "Suggests", solvable.suggests - fullprint_deps "Supplements", solvable.supplements - fullprint_deps "Enhances", solvable.enhances - fullprint_deps "Freshens", solvable.freshens -end - - -# -# strip 'pattern:' prefix from name -# - -def strip_prefix name - return name[8..-1] if name =~ /^pattern:/ - name -end - -# split_dep( deps, pdeps ) -# add pattern: deps to pdeps -# return non-pattern relations stripped of pool -# (as array of [ name, op, evr ]) -# - -def split_dep deps, pdeps -# puts "split_dep #{deps} [#{deps.size}], #{pdeps} [#{pdeps.size}]" - relations = Array.new - deps.each { |d| - name = strip_prefix d.name - if d.name =~ /^pattern:/ -# puts "Relation.new( #{name}, #{d.op}, #{d.evr})" - pdeps << Relation.new( pdeps.solvable.repo.pool, name, d.op, d.evr ) - else - relations << [ name, d.op, d.evr ] - end - } - relations -end - -# split_deps() -# split dependencies of (pattern) p -# into (pattern) new_pat for pattern: deps -# and my_deps for non-pattern: deps -# my_deps => Hash { string(name) => Hash { symbol(dependency) => Array [ name, op, evr ] } } -# - -def split_deps p, new_pat -# puts "split_deps pattern" -# fullprint_solvable p -# puts "new_pat" -# fullprint_solvable new_pat -# puts - my_deps = Hash.new - my_deps[:provides] = split_dep p.provides, new_pat.provides - my_deps[:requires] = split_dep p.requires, new_pat.requires - my_deps[:conflicts] = split_dep p.conflicts, new_pat.conflicts - my_deps[:obsoletes] = split_dep p.obsoletes, new_pat.obsoletes - my_deps[:recommends] = split_dep p.recommends, new_pat.recommends - my_deps[:suggests] = split_dep p.suggests, new_pat.suggests - my_deps[:supplements] = split_dep p.supplements, new_pat.supplements - my_deps[:enhances] = split_dep p.enhances, new_pat.enhances - my_deps[:freshens] = split_dep p.freshens, new_pat.freshens -# puts "==> new_pat" -# fullprint_solvable new_pat - my_deps -end - - -# -# check status of solved.decision against system(Pool) and my_deps (Hash of package deps) -# -def check_status system, my_deps, solved - solver = system.create_solver - t = system.create_transaction - # collect dependencies - solved.each_decision do |d| - deps = my_deps[d.solvable.name] - case d.op - when DEC_INSTALL - deps[:requires].each do |r| - t.install system.create_relation( r[0], r[1], r[2] ) - end - deps[:obsoletes].each do |r| - t.remove system.create_relation( r[0], r[1], r[2] ) - end - deps[:conflicts].each do |r| - t.remove system.create_relation( r[0], r[1], r[2] ) - end - when DEC_REMOVE - else - raise "******Unhandled #{d.op}" - end - end - solver.solve t unless t.empty? - - if solver.problems? - return false - solver.each_problem t do |p| - puts "\t #{p}" - end - else - return true - end - if nil - t.each do |a| - print "\t" - puts ( - case a.cmd - when SatSolver::INSTALL_SOLVABLE: "install #{a.solvable}" - when SatSolver::REMOVE_SOLVABLE: "remove #{a.solvable}" - when SatSolver::INSTALL_SOLVABLE_NAME: "install by name #{a.name}" - when SatSolver::REMOVE_SOLVABLE_NAME: "remove by name #{a.name}" - when SatSolver::INSTALL_SOLVABLE_PROVIDES: "install by relation #{a.relation}" - when SatSolver::REMOVE_SOLVABLE_PROVIDES: "remove by relation #{a.relation}" - else "" - end - ) - end - end -end - -$: << "../../build/bindings/ruby" -require 'satsolver' -include SatSolver -require 'problem' -require 'decision' - -pool = Pool.new( "x86_64" ) - -patterns = pool.create_repo 'patterns' -patterns.add_solv '10_3-x86_64-patterns.solv' - -puts "Found #{patterns.size} patterns" - -# -# Now split-off package deps from the patterns and -# keep them separate. -# - -my_pool = Pool.new -my_pool.arch = "x86_64" - -my_pats = my_pool.create_repo 'patterns' -my_deps = Hash.new - -i = 0 -patterns.each do |p| - i += 1 -# fullprint_solvable p - name = strip_prefix p.name - new_pat = my_pats.create_solvable name, p.evr, p.arch - my_deps[name] = split_deps p, new_pat -# break if i > 1 -end - -my_pool.promoteepoch = 1 - -puts "My pool has #{my_pool.count_repos} repos and #{my_pool.size} solvables" - -system = Pool.new "x86_64" -system.add_rpmdb "/" - -i = 0 -my_pats.each do |p| - i += 1 - solver = my_pool.create_solver - - solver.fix_system = 0 - solver.update_system = 0 - solver.allow_downgrade = 0 - solver.allow_uninstall = 0 - solver.no_update_provide = 0 - - t = my_pool.create_transaction - t.install p - solver.solve t -# fullprint_solvable p -# print "Install #{p} " - if solver.problems? - puts "*** Failed" - solver.each_problem t do |p| -# puts p - end - else -# puts "Succeeded" - result = check_status system, my_deps, solver - if result - puts "Yes: #{p}" - else - puts "No: #{p}" - end - solver.each_decision do |d| -# puts d - end - end -# break if i > 1 -end diff --git a/examples/ruby/problem.rb b/examples/ruby/problem.rb deleted file mode 100644 index 3ffef604..00000000 --- a/examples/ruby/problem.rb +++ /dev/null @@ -1,31 +0,0 @@ -# -# Extend SatSolver::Problem with to_s -# - -class Satsolverx::Problem - def to_s - case self.reason - when SatSolver::SOLVER_PROBLEM_UPDATE_RULE #1 - reason = "problem with installed" - when SatSolver::SOLVER_PROBLEM_JOB_RULE #2 - reason = "conflicting requests" - when SatSolver::SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP #3 - reason = "nothing provides requested" - when SatSolver::SOLVER_PROBLEM_NOT_INSTALLABLE #4 - reason = "not installable" - when SatSolver::SOLVER_PROBLEM_NOTHING_PROVIDES_DEP #5 - reason = "nothing provides rel required by source" - when SatSolver::SOLVER_PROBLEM_SAME_NAME #6 - reason = "cannot install both" - when SatSolver::SOLVER_PROBLEM_PACKAGE_CONFLICT #7 - reason = "source conflicts with rel provided by target" - when SatSolver::SOLVER_PROBLEM_PACKAGE_OBSOLETES #8 - reason = "source obsoletes rel provided by target" - when SatSolver::SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE #9 - reason = "source requires rel but no providers are installable" - else - reason = "**unknown**" - end - "[#{self.reason}]: #{reason}] Source #{self.source}, Rel #{self.relation}, Target #{self.target}" - end -end diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt index 8e71eee9..f38f530c 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt @@ -1,16 +1,16 @@ -SET(libsatsolverext_SRCS +SET(liblibsolvext_SRCS repo_content.c repo_deltainfoxml.c repo_helix.c repo_products.c repo_releasefile_products.c repo_repomdxml.c repo_rpmmd.c repo_susetags.c repo_updateinfoxml.c repo_write.c repo_zyppdb.c repo_deb.c sat_xfopen.c) IF ( NOT DEBIAN ) -SET(libsatsolverext_SRCS - ${libsatsolverext_SRCS} pool_fileconflicts.c repo_rpmdb.c) +SET(liblibsolvext_SRCS + ${liblibsolvext_SRCS} pool_fileconflicts.c repo_rpmdb.c) ENDIF (NOT DEBIAN) -ADD_LIBRARY(satsolverext STATIC ${libsatsolverext_SRCS}) +ADD_LIBRARY(libsolvext STATIC ${liblibsolvext_SRCS}) -SET(libsatsolverext_HEADERS +SET(liblibsolvext_HEADERS pool_fileconflicts.h repo_content.h repo_deltainfoxml.h repo_helix.h repo_products.h repo_releasefile_products.h repo_repomdxml.h repo_rpmdb.h repo_rpmmd.h repo_susetags.h repo_updateinfoxml.h repo_write.h repo_zyppdb.h @@ -18,5 +18,5 @@ SET(libsatsolverext_HEADERS SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -INSTALL(FILES ${libsatsolverext_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/satsolver") -INSTALL(TARGETS satsolverext LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) +INSTALL(FILES ${liblibsolvext_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/libsolv") +INSTALL(TARGETS libsolvext LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) diff --git a/ext/repo_helix.h b/ext/repo_helix.h index 78be3848..0b2bec96 100644 --- a/ext/repo_helix.h +++ b/ext/repo_helix.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_REPO_HELIX_H -#define SATSOLVER_REPO_HELIX_H +#ifndef LIBSOLV_REPO_HELIX_H +#define LIBSOLV_REPO_HELIX_H #ifdef __cplusplus extern "C" { @@ -28,4 +28,4 @@ extern void repo_add_helix(Repo *repo, FILE *fp, int flags); #endif -#endif /* SATSOLVER_REPO_HELIX_H */ +#endif /* LIBSOLV_REPO_HELIX_H */ diff --git a/ext/tools_util.h b/ext/tools_util.h index 55998477..06f246ec 100644 --- a/ext/tools_util.h +++ b/ext/tools_util.h @@ -1,4 +1,3 @@ - /* * Copyright (c) 2007, Novell Inc. * @@ -11,8 +10,8 @@ * */ -#ifndef SATSOLVER_TOOLS_UTIL_H -#define SATSOLVER_TOOLS_UTIL_H +#ifndef LIBSOLV_TOOLS_UTIL_H +#define LIBSOLV_TOOLS_UTIL_H static char *_join_tmp; static int _join_tmpl; @@ -115,4 +114,4 @@ static inline void repodata_set_tstr(Repodata *data, Id handle, const char *attr repodata_set_str(data, handle, attrid, str); } -#endif /* SATSOLVER_TOOLS_UTIL_H */ +#endif /* LIBSOLV_TOOLS_UTIL_H */ diff --git a/package/libsatsolver.changes b/package/libsolv.changes similarity index 100% rename from package/libsatsolver.changes rename to package/libsolv.changes diff --git a/package/libsatsolver.spec.in b/package/libsolv.spec.in similarity index 79% rename from package/libsatsolver.spec.in rename to package/libsolv.spec.in index 2f24c6c7..e80f3cc7 100644 --- a/package/libsatsolver.spec.in +++ b/package/libsolv.spec.in @@ -1,9 +1,9 @@ -Name: libsatsolver +Name: libsolv Version: @VERSION@ Release: 1 License: BSD 3-Clause Url: git://gitorious.org/opensuse/sat-solver.git -Source: satsolver-%{version}.tar.bz2 +Source: libsolv-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Development/Libraries/C and C++ Prefix: /usr @@ -56,18 +56,11 @@ Authors: %package devel Summary: A new approach to package dependency solving Group: Development/Libraries/C and C++ -Requires: satsolver-tools = %version +Requires: libsolv-tools = %version Requires: rpm-devel -#%package devel-doc -#Summary: satsolver developer documentation -#Group: Documentation/HTML - %description devel -Development files for satsolver, a new approach to package dependency solving - -#%description devel-doc -#Developer documentation for satsolver, a new approach to package dependency solving +Development files for libsolv, a new approach to package dependency solving Authors: @@ -78,18 +71,18 @@ Authors: Michael Matz Duncan Mac-Vicar P. -%package -n satsolver-tools +%package tools Summary: A new approach to package dependency solving Group: Development/Libraries/C and C++ Obsoletes: libsatsolver <= 0.0.15 Provides: libsatsolver = %{version}-%{release} Requires: gzip bzip2 coreutils -%description -n satsolver-tools +%description tools A new approach to package dependency solving. %package demo -Summary: Applications demoing the satsolver library +Summary: Applications demoing the libsolv library Group: System/Management Requires: curl %if 0%{?fedora_version} @@ -100,10 +93,10 @@ Requires: gpg2 %endif %description demo -Applications demoing the satsolver library. +Applications demoing the libsolv library. %prep -%setup -n satsolver-%{version} +%setup -n libsolv-%{version} %build export CFLAGS="$RPM_OPT_FLAGS" @@ -143,7 +136,7 @@ export NO_BRP_STRIP_DEBUG=true %clean rm -rf "$RPM_BUILD_ROOT" -%files -n satsolver-tools +%files tools %defattr(-,root,root) %doc LICENSE* %exclude /usr/bin/deptestomatic @@ -153,10 +146,10 @@ rm -rf "$RPM_BUILD_ROOT" %files devel %defattr(-,root,root) -%_libdir/libsatsolver.a -%_libdir/libsatsolverext.a -%dir /usr/include/satsolver -/usr/include/satsolver/* +%_libdir/libsolv.a +%_libdir/libsolvext.a +%dir /usr/include/libsolv +/usr/include/libsolv/* /usr/bin/deptestomatic /usr/bin/helix2solv @@ -164,9 +157,4 @@ rm -rf "$RPM_BUILD_ROOT" %defattr(-,root,root) /usr/bin/solv -#%files devel-doc -#%defattr(-,root,root) -#%dir %_docdir/satsolver -#%_docdir/satsolver/* - %changelog diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87fc4b42..19c1850a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,16 +11,16 @@ IF (HAVE___QSORT_R) ADD_DEFINITIONS(-DHAVE___QSORT_R=1) ENDIF (HAVE___QSORT_R) -SET(libsatsolver_SRCS +SET(libsolv_SRCS bitmap.c poolarch.c poolvendor.c poolid.c strpool.c dirpool.c solver.c solverdebug.c repo_solv.c evr.c pool.c queue.c repo.c repodata.c repopage.c util.c policy.c solvable.c transaction.c rules.c problems.c chksum.c md5.c sha1.c sha2.c satversion.c) -ADD_LIBRARY(satsolver STATIC ${libsatsolver_SRCS}) +ADD_LIBRARY(libsolv STATIC ${libsolv_SRCS}) -SET(libsatsolver_HEADERS +SET(libsolv_HEADERS bitmap.h evr.h hash.h policy.h poolarch.h poolvendor.h pool.h poolid.h pooltypes.h queue.h solvable.h solver.h solverdebug.h repo.h repodata.h repopage.h repo_solv.h util.h @@ -29,5 +29,5 @@ SET(libsatsolver_HEADERS SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -INSTALL(FILES ${libsatsolver_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/satsolver") -INSTALL(TARGETS satsolver LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) +INSTALL(FILES ${libsolv_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/libsolv") +INSTALL(TARGETS libsolv LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/bitmap.h b/src/bitmap.h index a08451b1..b931d7eb 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_BITMAP_H -#define SATSOLVER_BITMAP_H +#ifndef LIBSOLV_BITMAP_H +#define LIBSOLV_BITMAP_H #include @@ -50,4 +50,4 @@ static inline int map_tst(Map *m, int n) return MAPTST(m, n); } -#endif /* SATSOLVER_BITMAP_H */ +#endif /* LIBSOLV_BITMAP_H */ diff --git a/src/dirpool.h b/src/dirpool.h index 189156fd..e68f77cd 100644 --- a/src/dirpool.h +++ b/src/dirpool.h @@ -4,8 +4,8 @@ * This program is licensed under the BSD license, read LICENSE.BSD * for further information */ -#ifndef SATSOLVER_DIRPOOL_H -#define SATSOLVER_DIRPOOL_H +#ifndef LIBSOLV_DIRPOOL_H +#define LIBSOLV_DIRPOOL_H #include "pooltypes.h" @@ -74,4 +74,4 @@ dirpool_compid(Dirpool *dp, Id did) return dp->dirs[did]; } -#endif /* SATSOLVER_DIRPOOL_H */ +#endif /* LIBSOLV_DIRPOOL_H */ diff --git a/src/evr.h b/src/evr.h index bdbf652a..6f0b9319 100644 --- a/src/evr.h +++ b/src/evr.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_EVR_H -#define SATSOLVER_EVR_H +#ifndef LIBSOLV_EVR_H +#define LIBSOLV_EVR_H #ifdef __cplusplus extern "C" { @@ -52,4 +52,4 @@ static inline int evrmatch(const Pool *pool, Id evrid, const char *epoch, const } #endif -#endif /* SATSOLVER_EVR_H */ +#endif /* LIBSOLV_EVR_H */ diff --git a/src/hash.h b/src/hash.h index b1b91996..030448ea 100644 --- a/src/hash.h +++ b/src/hash.h @@ -10,8 +10,8 @@ * generic hash functions */ -#ifndef SATSOLVER_HASH_H -#define SATSOLVER_HASH_H +#ifndef LIBSOLV_HASH_H +#define LIBSOLV_HASH_H #include "pooltypes.h" @@ -85,4 +85,4 @@ mkmask(unsigned int num) return num * 2 - 1; } -#endif /* SATSOLVER_HASH_H */ +#endif /* LIBSOLV_HASH_H */ diff --git a/src/pool.h b/src/pool.h index bd1639bc..fb2b0a2b 100644 --- a/src/pool.h +++ b/src/pool.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_POOL_H -#define SATSOLVER_POOL_H +#ifndef LIBSOLV_POOL_H +#define LIBSOLV_POOL_H #ifdef __cplusplus extern "C" { @@ -366,4 +366,4 @@ void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts); #endif -#endif /* SATSOLVER_POOL_H */ +#endif /* LIBSOLV_POOL_H */ diff --git a/src/poolarch.h b/src/poolarch.h index e9ae99b5..9f5829d6 100644 --- a/src/poolarch.h +++ b/src/poolarch.h @@ -5,8 +5,8 @@ * for further information */ -#ifndef SATSOLVER_POOLARCH_H -#define SATSOLVER_POOLARCH_H +#ifndef LIBSOLV_POOLARCH_H +#define LIBSOLV_POOLARCH_H #include "pool.h" @@ -36,4 +36,4 @@ static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2) return 0; } -#endif /* SATSOLVER_POOLARCH_H */ +#endif /* LIBSOLV_POOLARCH_H */ diff --git a/src/poolid.h b/src/poolid.h index dc4913e7..05c788fe 100644 --- a/src/poolid.h +++ b/src/poolid.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_POOLID_H -#define SATSOLVER_POOLID_H +#ifndef LIBSOLV_POOLID_H +#define LIBSOLV_POOLID_H #include "pooltypes.h" #include "hash.h" @@ -69,4 +69,4 @@ static inline const char *dep2str(Pool *pool, Id id) return pool_dep2str(pool, id); } -#endif /* SATSOLVER_POOLID_H */ +#endif /* LIBSOLV_POOLID_H */ diff --git a/src/poolid_private.h b/src/poolid_private.h index f8618308..2e93d74c 100644 --- a/src/poolid_private.h +++ b/src/poolid_private.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_POOLID_PRIVATE_H -#define SATSOLVER_POOLID_PRIVATE_H +#ifndef LIBSOLV_POOLID_PRIVATE_H +#define LIBSOLV_POOLID_PRIVATE_H /* the size of all buffers is incremented in blocks * these are the block values (increment values) for the @@ -20,4 +20,4 @@ #define REL_BLOCK 1023 /* hashtable for relations */ #define WHATPROVIDES_BLOCK 1023 -#endif /* SATSOLVER_POOLID_PRIVATE_H */ +#endif /* LIBSOLV_POOLID_PRIVATE_H */ diff --git a/src/pooltypes.h b/src/pooltypes.h index 16823b9c..daee334b 100644 --- a/src/pooltypes.h +++ b/src/pooltypes.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_POOLTYPES_H -#define SATSOLVER_POOLTYPES_H +#ifndef LIBSOLV_POOLTYPES_H +#define LIBSOLV_POOLTYPES_H /* format version number for .solv files */ #define SOLV_VERSION_0 0 @@ -50,4 +50,4 @@ typedef int Id; /* must be signed!, since negative Id is used in solver rules t // offset value, e.g. used to 'point' into the stringspace typedef unsigned int Offset; -#endif /* SATSOLVER_POOLTYPES_H */ +#endif /* LIBSOLV_POOLTYPES_H */ diff --git a/src/poolvendor.h b/src/poolvendor.h index 2025e343..7f34fd5d 100644 --- a/src/poolvendor.h +++ b/src/poolvendor.h @@ -5,12 +5,12 @@ * for further information */ -#ifndef SATSOLVER_POOLVENDOR_H -#define SATSOLVER_POOLVENDOR_H +#ifndef LIBSOLV_POOLVENDOR_H +#define LIBSOLV_POOLVENDOR_H #include "pool.h" Id pool_vendor2mask(Pool *pool, Id vendor); void pool_setvendorclasses(Pool *pool, const char **vendorclasses); -#endif /* SATSOLVER_POOLVENDOR_H */ +#endif /* LIBSOLV_POOLVENDOR_H */ diff --git a/src/problems.h b/src/problems.h index fc9ac18b..1da7cd04 100644 --- a/src/problems.h +++ b/src/problems.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_PROBLEMS_H -#define SATSOLVER_PROBLEMS_H +#ifndef LIBSOLV_PROBLEMS_H +#define LIBSOLV_PROBLEMS_H #ifdef __cplusplus extern "C" { diff --git a/src/queue.h b/src/queue.h index 01e6a507..e8b39fe5 100644 --- a/src/queue.h +++ b/src/queue.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_QUEUE_H -#define SATSOLVER_QUEUE_H +#ifndef LIBSOLV_QUEUE_H +#define LIBSOLV_QUEUE_H #include "pooltypes.h" @@ -115,4 +115,4 @@ extern void queue_delete(Queue *q, int pos); extern void queue_delete2(Queue *q, int pos); extern void queue_deleten(Queue *q, int pos, int n); -#endif /* SATSOLVER_QUEUE_H */ +#endif /* LIBSOLV_QUEUE_H */ diff --git a/src/repo.h b/src/repo.h index aade9e39..b0f5957a 100644 --- a/src/repo.h +++ b/src/repo.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_REPO_H -#define SATSOLVER_REPO_H +#ifndef LIBSOLV_REPO_H +#define LIBSOLV_REPO_H #include "pooltypes.h" #include "pool.h" @@ -320,4 +320,4 @@ void repo_add_poolstr_array(Repo *repo, Id p, Id keyname, const char *str); void repo_internalize(Repo *repo); void repo_disable_paging(Repo *repo); -#endif /* SATSOLVER_REPO_H */ +#endif /* LIBSOLV_REPO_H */ diff --git a/src/repo_solv.h b/src/repo_solv.h index dc4eb10f..1cd1d509 100644 --- a/src/repo_solv.h +++ b/src/repo_solv.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_REPO_SOLVE_H -#define SATSOLVER_REPO_SOLVE_H +#ifndef LIBSOLV_REPO_SOLVE_H +#define LIBSOLV_REPO_SOLVE_H #ifdef __cplusplus extern "C" { @@ -31,4 +31,4 @@ extern int repo_add_solv_flags(Repo *repo, FILE *fp, int flags); } #endif -#endif /* SATSOLVER_REPO_SOLVE_H */ +#endif /* LIBSOLV_REPO_SOLVE_H */ diff --git a/src/repodata.h b/src/repodata.h index 57468431..f0912064 100644 --- a/src/repodata.h +++ b/src/repodata.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_REPODATA_H -#define SATSOLVER_REPODATA_H +#ifndef LIBSOLV_REPODATA_H +#define LIBSOLV_REPODATA_H #include @@ -273,4 +273,4 @@ const char *repodata_dir2str(Repodata *data, Id did, const char *suf); const char *repodata_chk2str(Repodata *data, Id type, const unsigned char *buf); void repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, const char *file); -#endif /* SATSOLVER_REPODATA_H */ +#endif /* LIBSOLV_REPODATA_H */ diff --git a/src/repopack.h b/src/repopack.h index fb6b2699..f52678f3 100644 --- a/src/repopack.h +++ b/src/repopack.h @@ -7,8 +7,8 @@ /* pack/unpack functions for key data */ -#ifndef SATSOLVER_REPOPACK_H -#define SATSOLVER_REPOPACK_H +#ifndef LIBSOLV_REPOPACK_H +#define LIBSOLV_REPOPACK_H static inline unsigned char * data_read_id(unsigned char *dp, Id *idp) @@ -269,4 +269,4 @@ data_skip_verify(unsigned char *dp, int type, int maxid, int maxdir) } } -#endif /* SATSOLVER_REPOPACK */ +#endif /* LIBSOLV_REPOPACK */ diff --git a/src/repopage.h b/src/repopage.h index 0cc86000..2c1847fd 100644 --- a/src/repopage.h +++ b/src/repopage.h @@ -5,8 +5,8 @@ * for further information */ -#ifndef SATSOLVER_REPOPAGE_H -#define SATSOLVER_REPOPAGE_H +#ifndef LIBSOLV_REPOPAGE_H +#define LIBSOLV_REPOPAGE_H #define BLOB_PAGEBITS 15 #define BLOB_PAGESIZE (1 << BLOB_PAGEBITS) @@ -52,4 +52,4 @@ int repopagestore_read_or_setup_pages(Repopagestore *store, FILE *fp, unsigned i void repopagestore_disable_paging(Repopagestore *store); -#endif /* SATSOLVER_REPOPAGE_H */ +#endif /* LIBSOLV_REPOPAGE_H */ diff --git a/src/rules.h b/src/rules.h index 0158223e..01177222 100644 --- a/src/rules.h +++ b/src/rules.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_RULES_H -#define SATSOLVER_RULES_H +#ifndef LIBSOLV_RULES_H +#define LIBSOLV_RULES_H #ifdef __cplusplus extern "C" { diff --git a/src/satversion.c b/src/satversion.c index a70b14aa..4d281253 100644 --- a/src/satversion.c +++ b/src/satversion.c @@ -7,7 +7,7 @@ #include "satversion.h" -const char sat_version[] = SATSOLVER_VERSION_STRING; -int sat_version_major = SATSOLVER_VERSION_MAJOR; -int sat_version_minor = SATSOLVER_VERSION_MINOR; -int sat_version_patch = SATSOLVER_VERSION_PATCH; +const char sat_version[] = LIBSOLV_VERSION_STRING; +int sat_version_major = LIBSOLV_VERSION_MAJOR; +int sat_version_minor = LIBSOLV_VERSION_MINOR; +int sat_version_patch = LIBSOLV_VERSION_PATCH; diff --git a/src/satversion.h.in b/src/satversion.h.in index 2bddacb7..11547415 100644 --- a/src/satversion.h.in +++ b/src/satversion.h.in @@ -10,14 +10,14 @@ * */ -#ifndef SATSOLVER_SATVERSION_H -#define SATSOLVER_SATVERSION_H +#ifndef LIBSOLV_SATVERSION_H +#define LIBSOLV_SATVERSION_H -#define SATSOLVER_VERSION_STRING "@VERSION@" -#define SATSOLVER_VERSION_MAJOR @LIBSATSOLVER_MAJOR@ -#define SATSOLVER_VERSION_MINOR @LIBSATSOLVER_MINOR@ -#define SATSOLVER_VERSION_PATCH @LIBSATSOLVER_PATCH@ -#define SATSOLVER_VERSION (SATSOLVER_VERSION_MAJOR * 10000 + SATSOLVER_VERSION_MINOR * 100 + SATSOLVER_VERSION_PATCH) +#define LIBSOLV_VERSION_STRING "@VERSION@" +#define LIBSOLV_VERSION_MAJOR @LIBSOLV_MAJOR@ +#define LIBSOLV_VERSION_MINOR @LIBSOLV_MINOR@ +#define LIBSOLV_VERSION_PATCH @LIBSOLV_PATCH@ +#define LIBSOLV_VERSION (LIBSOLV_VERSION_MAJOR * 10000 + LIBSOLV_VERSION_MINOR * 100 + LIBSOLV_VERSION_PATCH) extern const char sat_version[]; extern int sat_version_major; diff --git a/src/solvable.h b/src/solvable.h index 60e7e7d7..583f345d 100644 --- a/src/solvable.h +++ b/src/solvable.h @@ -11,8 +11,8 @@ * A solvable represents an object with name-epoch:version-release.arch and dependencies */ -#ifndef SATSOLVER_SOLVABLE_H -#define SATSOLVER_SOLVABLE_H +#ifndef LIBSOLV_SOLVABLE_H +#define LIBSOLV_SOLVABLE_H #include "pooltypes.h" @@ -40,4 +40,4 @@ typedef struct _Solvable { } Solvable; -#endif /* SATSOLVER_SOLVABLE_H */ +#endif /* LIBSOLV_SOLVABLE_H */ diff --git a/src/solver.h b/src/solver.h index e672ba5f..18c16128 100644 --- a/src/solver.h +++ b/src/solver.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_SOLVER_H -#define SATSOLVER_SOLVER_H +#ifndef LIBSOLV_SOLVER_H +#define LIBSOLV_SOLVER_H #ifdef __cplusplus extern "C" { @@ -394,4 +394,4 @@ solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap) } #endif -#endif /* SATSOLVER_SOLVER_H */ +#endif /* LIBSOLV_SOLVER_H */ diff --git a/src/solverdebug.h b/src/solverdebug.h index dde1c557..9f065579 100644 --- a/src/solverdebug.h +++ b/src/solverdebug.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_SOLVERDEBUG_H -#define SATSOLVER_SOLVERDEBUG_H +#ifndef LIBSOLV_SOLVERDEBUG_H +#define LIBSOLV_SOLVERDEBUG_H #include "pooltypes.h" #include "pool.h" @@ -40,5 +40,5 @@ extern const char *solver_solutionelement2str(Solver *solv, Id p, Id rp); extern const char *policy_illegal2str(Solver *solv, int illegal, Solvable *s, Solvable *rs); -#endif /* SATSOLVER_SOLVERDEBUG_H */ +#endif /* LIBSOLV_SOLVERDEBUG_H */ diff --git a/src/strpool.h b/src/strpool.h index 3845ced4..5e465446 100644 --- a/src/strpool.h +++ b/src/strpool.h @@ -4,8 +4,8 @@ * This program is licensed under the BSD license, read LICENSE.BSD * for further information */ -#ifndef SATSOLVER_STRINGPOOL_H -#define SATSOLVER_STRINGPOOL_H +#ifndef LIBSOLV_STRINGPOOL_H +#define LIBSOLV_STRINGPOOL_H #include "pooltypes.h" #include "hash.h" diff --git a/src/transaction.h b/src/transaction.h index c9295207..0d77e01e 100644 --- a/src/transaction.h +++ b/src/transaction.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_TRANSACTION_H -#define SATSOLVER_TRANSACTION_H +#ifndef LIBSOLV_TRANSACTION_H +#define LIBSOLV_TRANSACTION_H #ifdef __cplusplus extern "C" { diff --git a/src/util.h b/src/util.h index ebc2bc8f..f424ab97 100644 --- a/src/util.h +++ b/src/util.h @@ -10,8 +10,8 @@ * */ -#ifndef SATSOLVER_UTIL_H -#define SATSOLVER_UTIL_H +#ifndef LIBSOLV_UTIL_H +#define LIBSOLV_UTIL_H #include #include @@ -81,4 +81,4 @@ static inline void *sat_calloc_block(size_t len, size_t size, size_t block) memset(buf, 0, ((len + block) & ~block) * size); return buf; } -#endif /* SATSOLVER_UTIL_H */ +#endif /* LIBSOLV_UTIL_H */ diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 79d48907..2c37b2d9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -6,45 +6,45 @@ ADD_LIBRARY(toolstuff STATIC common_write.c) IF ( NOT DEBIAN ) ADD_EXECUTABLE(rpmdb2solv rpmdb2solv.c) -TARGET_LINK_LIBRARIES(rpmdb2solv toolstuff satsolverext satsolver ${RPMDB_LIBRARY} ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(rpmdb2solv toolstuff libsolvext libsolv ${RPMDB_LIBRARY} ${EXPAT_LIBRARY}) ADD_EXECUTABLE(rpms2solv rpms2solv.c) -TARGET_LINK_LIBRARIES(rpms2solv toolstuff satsolverext satsolver ${RPMDB_LIBRARY}) +TARGET_LINK_LIBRARIES(rpms2solv toolstuff libsolvext libsolv ${RPMDB_LIBRARY}) ADD_EXECUTABLE(findfileconflicts findfileconflicts.c) -TARGET_LINK_LIBRARIES(findfileconflicts satsolverext satsolver ${RPMDB_LIBRARY}) +TARGET_LINK_LIBRARIES(findfileconflicts libsolvext libsolv ${RPMDB_LIBRARY}) ENDIF ( NOT DEBIAN ) ADD_EXECUTABLE(rpmmd2solv rpmmd2solv.c) -TARGET_LINK_LIBRARIES(rpmmd2solv toolstuff satsolverext satsolver ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(rpmmd2solv toolstuff libsolvext libsolv ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) ADD_EXECUTABLE(helix2solv helix2solv.c) -TARGET_LINK_LIBRARIES(helix2solv toolstuff satsolverext satsolver ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(helix2solv toolstuff libsolvext libsolv ${EXPAT_LIBRARY}) ADD_EXECUTABLE(susetags2solv susetags2solv.c) -TARGET_LINK_LIBRARIES(susetags2solv toolstuff satsolverext satsolver ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(susetags2solv toolstuff libsolvext libsolv ${ZLIB_LIBRARY}) ADD_EXECUTABLE(updateinfoxml2solv updateinfoxml2solv.c) -TARGET_LINK_LIBRARIES(updateinfoxml2solv toolstuff satsolverext satsolver ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(updateinfoxml2solv toolstuff libsolvext libsolv ${EXPAT_LIBRARY}) ADD_EXECUTABLE(deltainfoxml2solv deltainfoxml2solv.c) -TARGET_LINK_LIBRARIES(deltainfoxml2solv toolstuff satsolverext satsolver ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(deltainfoxml2solv toolstuff libsolvext libsolv ${EXPAT_LIBRARY}) ADD_EXECUTABLE(repomdxml2solv repomdxml2solv.c) -TARGET_LINK_LIBRARIES(repomdxml2solv toolstuff satsolverext satsolver ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(repomdxml2solv toolstuff libsolvext libsolv ${EXPAT_LIBRARY}) ADD_EXECUTABLE(installcheck installcheck.c) -TARGET_LINK_LIBRARIES(installcheck satsolverext satsolver ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(installcheck libsolvext libsolv ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) ADD_EXECUTABLE(patchcheck patchcheck.c) -TARGET_LINK_LIBRARIES(patchcheck satsolverext satsolver ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +TARGET_LINK_LIBRARIES(patchcheck libsolvext libsolv ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) ADD_EXECUTABLE(dumpsolv dumpsolv.c ) -TARGET_LINK_LIBRARIES(dumpsolv satsolver) +TARGET_LINK_LIBRARIES(dumpsolv libsolv) ADD_EXECUTABLE(mergesolv mergesolv.c ) -TARGET_LINK_LIBRARIES(mergesolv toolstuff satsolverext satsolver) +TARGET_LINK_LIBRARIES(mergesolv toolstuff libsolvext libsolv) install(TARGETS mergesolv diff --git a/tools/common_write.c b/tools/common_write.c index 00e1c116..76664075 100644 --- a/tools/common_write.c +++ b/tools/common_write.c @@ -17,7 +17,7 @@ #include "repo_write.h" #include "common_write.h" -#define SATSOLVER_TOOLVERSION "1.0" +#define LIBSOLV_TOOLVERSION "1.0" static Id verticals[] = { SOLVABLE_AUTHORS, @@ -205,7 +205,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname) memset(&kd, 0, sizeof(kd)); info = repo_add_repodata(repo, 0); - repodata_set_str(info, SOLVID_META, REPOSITORY_TOOLVERSION, SATSOLVER_TOOLVERSION); + repodata_set_str(info, SOLVID_META, REPOSITORY_TOOLVERSION, LIBSOLV_TOOLVERSION); pool_addfileprovides_ids(repo->pool, 0, &addedfileprovides); if (addedfileprovides && *addedfileprovides) {