From d429991781e0185cb1c149d9676aa66cb7a9260a Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Mon, 14 Apr 2008 10:54:05 +0000 Subject: [PATCH] Enable evaluation of filesystem dependencies --- package/libzypp.changes | 5 +++-- zypp/sat/detail/PoolImpl.cc | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package/libzypp.changes b/package/libzypp.changes index 6e1f906..e8ea3fa 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,8 +1,9 @@ ------------------------------------------------------------------- -Mon Apr 14 12:01:13 CEST 2008 - ma@suse.de +Mon Apr 14 12:53:09 CEST 2008 - ma@suse.de - Enable evaluation of hardware dependencies. -- revision 9603 +- Enable evaluation of filesystem dependencies. +- revision 9605 ------------------------------------------------------------------- Sun Apr 13 02:17:25 CEST 2008 - jkupec@suse.cz diff --git a/zypp/sat/detail/PoolImpl.cc b/zypp/sat/detail/PoolImpl.cc index c93820e..740d923 100644 --- a/zypp/sat/detail/PoolImpl.cc +++ b/zypp/sat/detail/PoolImpl.cc @@ -17,6 +17,8 @@ #include "zypp/base/Gettext.h" #include "zypp/base/Exception.h" #include "zypp/base/Measure.h" +#include "zypp/base/WatchFile.h" +#include "zypp/base/Sysconfig.h" #include "zypp/ZConfig.h" @@ -38,6 +40,9 @@ namespace zypp /////////////////////////////////////////////////////////////////// namespace sat { ///////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////////////////// namespace detail { ///////////////////////////////////////////////////////////////// @@ -84,7 +89,7 @@ namespace zypp case NAMESPACE_LANGUAGE: { const std::tr1::unordered_set & locale2Solver( reinterpret_cast(data)->_locale2Solver ); - return locale2Solver.find( IdString(rhs) ) == locale2Solver.end() ? RET_unsupported : RET_systemProperty; + return locale2Solver.find( IdString(rhs) ) != locale2Solver.end() ? RET_systemProperty : RET_unsupported; } break; @@ -96,7 +101,16 @@ namespace zypp case NAMESPACE_FILESYSTEM: { - + static const Pathname sysconfigStoragePath( "/etc/sysconfig/storage" ); + static WatchFile sysconfigFile( sysconfigStoragePath, WatchFile::NO_INIT ); + static std::set requiredFilesystems; + if ( sysconfigFile.hasChanged() ) + { + requiredFilesystems.clear(); + str::split( base::sysconfig::read( sysconfigStoragePath )["USED_FS_LIST"], + std::inserter( requiredFilesystems, requiredFilesystems.end() ) ); + } + return requiredFilesystems.find( IdString(rhs).asString() ) != requiredFilesystems.end() ? RET_systemProperty : RET_unsupported; } break; } -- 2.7.4