#
SET(LIBZYPP_MAJOR "5")
-SET(LIBZYPP_MINOR "0")
-SET(LIBZYPP_COMPATMINOR "0")
-SET(LIBZYPP_PATCH "2")
+SET(LIBZYPP_MINOR "1")
+SET(LIBZYPP_COMPATMINOR "1")
+SET(LIBZYPP_PATCH "0")
#include "zypp/repo/DeltaCandidates.h"
#include "zypp/repo/PackageProvider.h"
-#include "zypp/repo/ScriptProvider.h"
#include "zypp/repo/SrcPackageProvider.h"
#include "zypp/ui/PatchContents.h"
PoolItem pi = getPi<Patch>( "fetchmsttfonts.sh" );
USR << pi << endl;
- pi = getPi<Script>( "fetchmsttfonts.sh-4347-patch-fetchmsttfonts.sh-2" );
- USR << pi << endl;
-
- if ( pi )
- {
- Script::constPtr script_r( asKind<Script>( pi.resolvable() ) );
- MIL << script_r << endl;
- if ( script_r )
- {
- repo::RepoMediaAccess access_r;
- repo::ScriptProvider prov( access_r );
- ManagedFile localfile = prov.provideScript( script_r, true );
- MIL << localfile << endl;
- }
- }
-
//pi.status().setTransact( true, ResStatus::USER );
//install();
-------------------------------------------------------------------
+Wed Jul 16 01:10:37 CEST 2008 - ma@suse.de
+
+- Remove Atom, Script, Message and other obsolete classes.
+- version 5.2.0
+- revision 10592
+
+-------------------------------------------------------------------
Mon Jul 14 13:36:26 CEST 2008 - ma@suse.de
- Also report the name of the locking process in ZYppFactoryException
ADD_SUBDIRECTORY( registration )
ADD_SUBDIRECTORY( package-manager )
-#ADD_SUBDIRECTORY( cachetools )
#ADD_SUBDIRECTORY( migrate-sources )
+++ /dev/null
-
-SET( zyppcache_SRC
-zypp-cache.cc
-)
-
-ADD_EXECUTABLE( zypp-cache ${zyppcache_SRC} )
-TARGET_LINK_LIBRARIES( zypp-cache zypp )
-TARGET_LINK_LIBRARIES( zypp-cache xml2 )
-
-#INSTALL(TARGETS zypp-query-pool RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/zypp )
\ No newline at end of file
+++ /dev/null
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-
-#include <iostream>
-
-#include "zypp/base/Logger.h"
-#include "zypp/ZYpp.h"
-#include "zypp/zypp_detail/ZYppReadOnlyHack.h"
-#include "zypp/ZYppFactory.h"
-#include "zypp/cache/CacheFSCK.h"
-
-#undef ZYPP_BASE_LOGGER_LOGGROUP
-#define ZYPP_BASE_LOGGER_LOGGROUP "zypp-cache"
-
-
-using namespace std;
-using namespace zypp;
-
-static void cache_fsck( const Pathname &dir )
-{
- cache::CacheFSCK fsck(dir);
- fsck.start();
-}
-
-void usage()
-{
- cout << "Commands:" << endl;
- cout << "fsck dbdir" << endl;
-}
-
-//-----------------------------------------------------------------------------
-
-int
-main (int argc, char **argv)
-{
- MIL << "-------------------------------------" << endl;
-
- if (argc > 2)
- {
- if ( string(argv[1]) == "fsck" )
- {
- cache_fsck(argv[2]);
- }
- else
- {
- usage();
- }
- }
- else
- {
- usage();
- }
-
- return 0;
-}
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Atom.cc
- *
-*/
-#include "zypp/Atom.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- IMPL_PTR_TYPE(Atom);
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Atom::Atom
- // METHOD TYPE : Ctor
- //
- Atom::Atom( const sat::Solvable & solvable_r )
- : ResObject( solvable_r )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Atom::~Atom
- // METHOD TYPE : Dtor
- //
- Atom::~Atom()
- {}
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Atom.h
- *
-*/
-#ifndef ZYPP_ATOM_H
-#define ZYPP_ATOM_H
-
-#include "zypp/ResObject.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : Atom
- //
- /**
- * \deprecated class is obsolete
- */
- class Atom : public ResObject
- {
- public:
- typedef Atom Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- protected:
- friend Ptr make<Self>( const sat::Solvable & solvable_r );
- /** Ctor */
- Atom( const sat::Solvable & solvable_r ) ZYPP_DEPRECATED;
- /** Dtor */
- virtual ~Atom();
- };
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_ATOM_H
#FILE(WRITE filename "message to write"... )
SET( zypp_SRCS
- Atom.cc
ByteCount.cc
Capabilities.cc
Capability.cc
Locks.cc
MediaProducts.cc
MediaSetAccess.cc
- Message.cc
NameKindProxy.cc
NVRA.cc
NVRAD.cc
ResPool.cc
ResPoolProxy.cc
ResStatus.cc
- Script.cc
Service.cc
Signature.cc
SrcPackage.cc
SET( zypp_HEADERS
Arch.h
- Atom.h
AutoDispose.h
Bit.h
ByteCount.h
ManagedFile.h
MediaProducts.h
MediaSetAccess.h
- Message.h
NameKindProxy.h
Vendor.h
NVRAD.h
ResPoolProxy.h
ResStatus.h
ResTraits.h
- Script.h
Service.h
Signature.h
SrcPackage.h
SET( zypp_parser_susetags_SRCS
parser/susetags/RepoIndex.cc
parser/susetags/ContentFileReader.cc
- #parser/susetags/PackagesFileReader.cc
- #parser/susetags/PackagesLangFileReader.cc
- #parser/susetags/PackagesDuFileReader.cc
- #parser/susetags/PatternFileReader.cc
- #parser/susetags/RepoParser.cc
)
SET( zypp_parser_susetags_HEADERS
parser/susetags/RepoIndex.h
parser/susetags/ContentFileReader.h
- parser/susetags/FileReaderBase.h
- parser/susetags/FileReaderBaseImpl.h
- parser/susetags/PackagesFileReader.h
- parser/susetags/PackagesLangFileReader.h
- parser/susetags/PackagesDuFileReader.h
- parser/susetags/PatternFileReader.h
- parser/susetags/RepoParser.h
)
INSTALL( FILES
)
SET( zypp_parser_yum_SRCS
- #parser/yum/RepoParser.cc
- #parser/yum/FileReaderBaseImpl.cc
parser/yum/RepomdFileReader.cc
parser/yum/PatchesFileReader.cc
- #parser/yum/PrimaryFileReader.cc
- #parser/yum/OtherFileReader.cc
- #parser/yum/FilelistsFileReader.cc
- #parser/yum/PatchFileReader.cc
- #parser/yum/PatternFileReader.cc
- #parser/yum/ProductFileReader.cc
)
SET( zypp_parser_yum_HEADERS
- parser/yum/RepoParser.h
- parser/yum/RepoParserOpts.h
- parser/yum/FileReaderBase.h
- parser/yum/FileReaderBaseImpl.h
parser/yum/RepomdFileReader.h
parser/yum/PatchesFileReader.h
- parser/yum/PrimaryFileReader.h
- parser/yum/OtherFileReader.h
- parser/yum/FilelistsFileReader.h
- parser/yum/PatchFileReader.h
- parser/yum/PatternFileReader.h
- parser/yum/ProductFileReader.h
- parser/yum/schemanames.h
)
INSTALL( FILES
SET( zypp_parser_ws_SRCS
parser/ws/WebpinResultFileReader.cc
-
)
SET( zypp_parser_ws_HEADERS
)
SET( zypp_ui_SRCS
- ui/PatchContents.cc
- ui/PatchContentsImpl.cc
- ui/PatternContents.cc
- ui/PatternContentsImpl.cc
- ui/PatternExpander.cc
ui/Selectable.cc
ui/SelectableImpl.cc
ui/Status.cc
)
SET( zypp_ui_HEADERS
- ui/PatchContents.h
- ui/PatchContentsImpl.h
- ui/PatternContents.h
- ui/PatternContentsImpl.h
- ui/PatternExpander.h
ui/SelFilters.h
ui/Selectable.h
ui/SelectableImpl.h
repo/RepoType.cc
repo/PackageProvider.cc
repo/SrcPackageProvider.cc
- repo/ScriptProvider.cc
repo/RepoProvideFile.cc
repo/DeltaCandidates.cc
repo/Applydeltarpm.cc
repo/RepoType.h
repo/PackageProvider.h
repo/SrcPackageProvider.h
- repo/ScriptProvider.h
repo/RepoProvideFile.h
repo/DeltaCandidates.h
repo/Applydeltarpm.h
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Message.cc
- *
-*/
-#include "zypp/Message.h"
-#include "zypp/Message.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- IMPL_PTR_TYPE(Message);
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Message::Message
- // METHOD TYPE : Ctor
- //
- Message::Message( const sat::Solvable & solvable_r )
- : ResObject( solvable_r )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Message::~Message
- // METHOD TYPE : Dtor
- //
- Message::~Message()
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // Message interface forwarded to implementation
- //
- ///////////////////////////////////////////////////////////////////
-
- TranslatedText Message::text() const
- { return TranslatedText(); }
-
- /** Patch the message belongs to - if any */
- ResTraits<Patch>::constPtrType Message::patch() const
- { return ResTraits<Patch>::constPtrType(); }
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Message.h
- *
-*/
-#ifndef ZYPP_MESSAGE_H
-#define ZYPP_MESSAGE_H
-
-#include "zypp/TranslatedText.h"
-#include "zypp/ResObject.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : Message
- //
- /** Class representing the message to be shown during update.
- * \deprecated class is obsolete
- */
- class Message : public ResObject
- {
- public:
- typedef Message Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** Get the text of the message */
- TranslatedText text() const ZYPP_DEPRECATED;
- /** Patch the message belongs to - if any */
- ResTraits<Patch>::constPtrType patch() const ZYPP_DEPRECATED;
-
- protected:
- friend Ptr make<Self>( const sat::Solvable & solvable_r );
- /** Ctor */
- Message( const sat::Solvable & solvable_r ) ZYPP_DEPRECATED;
- /** Dtor */
- virtual ~Message();
- };
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_MESSAGE_H
#include "zypp/base/Logger.h"
#include "zypp/Patch.h"
-#include "zypp/Message.h"
using std::endl;
bool Patch::interactive() const
{
if ( rebootSuggested()
+ || ! message().empty()
|| ! licenseToConfirm().empty() )
{
return true;
Patch::Contents c( contents() );
for_( it, c.begin(), c.end() )
{
- if ( it->isKind( ResKind::message )
- || ! licenseToConfirm().empty() )
+ if ( ! licenseToConfirm().empty() )
{
return true;
}
*/
ReferenceIterator referencesEnd() const;
-
public:
/** Patch ID
* \deprecated Seems to be unsused autobuild interal data?
ZYPP_DEPRECATED std::string id() const
{ return std::string(); }
- /** The list of all atoms building the patch
- * \deprecated Try contents().
- */
- typedef std::list<ResObject::Ptr> AtomList;
- ZYPP_DEPRECATED AtomList atoms() const
- { return AtomList(); }
-
protected:
friend Ptr make<Self>( const sat::Solvable & solvable_r );
/** Ctor */
{ /////////////////////////////////////////////////////////////////
const ResKind ResKind::nokind;
- const ResKind ResKind::atom ( "atom" );
- const ResKind ResKind::message ( "message" );
const ResKind ResKind::package ( "package" );
const ResKind ResKind::patch ( "patch" );
const ResKind ResKind::pattern ( "pattern" );
const ResKind ResKind::product ( "product" );
- const ResKind ResKind::script ( "script" );
const ResKind ResKind::srcpackage( "srcpackage" );
template<>
- const ResKind ResTraits<Atom> ::kind( ResKind::atom );
- template<>
- const ResKind ResTraits<Message> ::kind( ResKind::message );
- template<>
const ResKind ResTraits<Package> ::kind( ResKind::package );
template<>
const ResKind ResTraits<Patch> ::kind( ResKind::patch );
template<>
const ResKind ResTraits<Product> ::kind( ResKind::product );
template<>
- const ResKind ResTraits<Script> ::kind( ResKind::script );
- template<>
const ResKind ResTraits<SrcPackage>::kind( ResKind::srcpackage );
std::string ResKind::satIdent( const ResKind & refers_r, const std::string & name_r )
/** Value representing \c nokind (<tt>""</tt>)*/
static const ResKind nokind;
- static const ResKind atom ZYPP_DEPRECATED;
- static const ResKind message ZYPP_DEPRECATED;
static const ResKind package;
static const ResKind patch;
static const ResKind pattern;
static const ResKind product;
- static const ResKind script ZYPP_DEPRECATED;
static const ResKind srcpackage;
//@}
{
ResKind kind( solvable_r.kind() );
#define OUTS(X) if ( kind == ResTraits<X>::kind ) return make<X>( solvable_r );
- OUTS( Atom );
- OUTS( Message );
OUTS( Package );
OUTS( Patch );
OUTS( Pattern );
OUTS( Product );
- OUTS( Script );
OUTS( SrcPackage );
#undef OUTS
return 0;
#ifndef ZYPP_RESOBJECTS_H
#define ZYPP_RESOBJECTS_H
-#include "zypp/Atom.h"
-#include "zypp/Message.h"
#include "zypp/Package.h"
#include "zypp/Patch.h"
#include "zypp/Pattern.h"
#include "zypp/Product.h"
-#include "zypp/Script.h"
#include "zypp/SrcPackage.h"
#endif // ZYPP_RESOBJECTS_H
DEFINE_PTR_TYPE( Resolvable );
DEFINE_PTR_TYPE( ResObject );
- DEFINE_PTR_TYPE( Atom );
DEFINE_PTR_TYPE( Package );
DEFINE_PTR_TYPE( SrcPackage );
DEFINE_PTR_TYPE( Pattern );
DEFINE_PTR_TYPE( Product );
DEFINE_PTR_TYPE( Patch );
- DEFINE_PTR_TYPE( Script );
- DEFINE_PTR_TYPE( Message );
//@}
/** ResTraits. Defines common types and the ResKind value. */
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Script.cc
- *
-*/
-#include "zypp/Script.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- IMPL_PTR_TYPE(Script);
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Script::Script
- // METHOD TYPE : Ctor
- //
- Script::Script( const sat::Solvable & solvable_r )
- : ResObject( solvable_r )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : Script::~Script
- // METHOD TYPE : Dtor
- //
- Script::~Script()
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // Script interface forwarded to implementation
- //
- ///////////////////////////////////////////////////////////////////
-
- bool Script::doAvailable() const
- { return false; }
-
- std::string Script::doScriptInlined() const
- { return std::string(); }
-
- OnMediaLocation Script::doScriptLocation() const
- { return OnMediaLocation(); }
-
- bool Script::undoAvailable() const
- { return false; }
-
- std::string Script::undoScriptInlined() const
- { return std::string(); }
-
- OnMediaLocation Script::undoScriptLocation() const
- { return OnMediaLocation(); }
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/Script.h
- *
-*/
-#ifndef ZYPP_SCRIPT_H
-#define ZYPP_SCRIPT_H
-
-#include "zypp/ResObject.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : Script
- //
- /** Class representing an update script.
- * \deprecated class is obsolete
- */
- class Script : public ResObject
- {
- public:
- typedef Script Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** Check whether a script is available. */
- bool doAvailable() const ZYPP_DEPRECATED;
-
- /** Return an inlined script if available.
- * Otherwise it is available at \ref doScriptLocation.
- */
- std::string doScriptInlined() const ZYPP_DEPRECATED;
-
- /** Location of the script, unless it is available inlined.
- * \see \ref doScriptInlined
- */
- OnMediaLocation doScriptLocation() const ZYPP_DEPRECATED;
-
- /** Check whether a script to undo the change is available. */
- bool undoAvailable() const;
-
- /** Return an inlined undo script if available.
- * Otherwise it is available at \ref undoScriptLocation.
- */
- std::string undoScriptInlined() const ZYPP_DEPRECATED;
-
- /** Location of the undo script, unless it is available inlined.
- * \see \ref undoScriptInlined
- */
- OnMediaLocation undoScriptLocation() const ZYPP_DEPRECATED;
-
- protected:
- friend Ptr make<Self>( const sat::Solvable & solvable_r );
- /** Ctor */
- Script( const sat::Solvable & solvable_r ) ZYPP_DEPRECATED;
- /** Dtor */
- virtual ~Script();
- };
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_SCRIPT_H
#include "zypp/Resolvable.h"
#include "zypp/RepoInfo.h"
#include "zypp/Pathname.h"
-#include "zypp/Message.h"
#include "zypp/Package.h"
#include "zypp/Patch.h"
#include "zypp/Url.h"
{}
};
- // resolvable Message
- // DEPRECATED: replaced by PatchMessageReport
- struct ZYPP_DEPRECATED MessageResolvableReport : public callback::ReportBase
- {
- virtual void show(
- Message::constPtr /*message*/
- ) {}
- };
-
- // resolvable Script
- // DEPRECATED: replaced by PatchScriptReport
- struct ZYPP_DEPRECATED ScriptResolvableReport : public callback::ReportBase
- {
- enum Task { DO, UNDO };
- enum Notify { OUTPUT, PING };
-
- /** Whether executing do_script on install or undo_script on delete. */
- virtual void start( const Resolvable::constPtr & /*script_r*/,
- const Pathname & /*path_r*/,
- Task )
- {}
- /** Progress provides the script output. If the script is quiet,
- * from time to time still-alive pings are sent to the ui. Returning \c FALSE
- * aborts script execution.
- */
- virtual bool progress( Notify , const std::string & = std::string() )
- { return true; }
- /** Report error. */
- virtual void problem( const std::string & /*description*/ )
- {}
- /** Report success. */
- virtual void finish()
- {}
- };
-
///////////////////////////////////////////////////////////////////
namespace rpm
{
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/repo/ScriptProvider.cc
- *
-*/
-#include <iostream>
-#include <fstream>
-
-#include "zypp/repo/ScriptProvider.h"
-#include "zypp/PathInfo.h"
-#include "zypp/TmpPath.h"
-#include "zypp/Script.h"
-
-using std::endl;
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace repo
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- namespace
- { /////////////////////////////////////////////////////////////////
-
- typedef std::string (Script::*inlined)() const;
- typedef OnMediaLocation (Script::*location)() const;
-
- /** Provide a Script in a local file. */
- ManagedFile doProvideScript( repo::RepoMediaAccess & access_r,
- const Script & script_r,
- inlined inlined_r, location location_r )
- {
- ManagedFile ret;
-
- // 1st try inlined
- std::string inlined( (script_r.*inlined_r)() );
- if ( ! inlined.empty() )
- {
- // Take care the TmpFile goes out of scope BEFORE the
- // ofstream opens the file again.
- ret = ManagedFile( filesystem::TmpFile( filesystem::TmpPath::defaultLocation(),
- "zypp-script-"+script_r.name() ),
- filesystem::unlink );
- std::ofstream str( ret.value().c_str() );
- str << inlined << endl;
- }
- else
- {
- // otherwise try download
- OnMediaLocation location( (script_r.*location_r)() );
- if ( ! location.filename().empty() )
- {
- ret = access_r.provideFile( script_r.repoInfo(), location );
- }
- else
- {
- // no script
- return ManagedFile();
- }
- }
-
- // HERE: got the script
- filesystem::chmod( ret, 0700 );
- return ret;
- }
-
- /////////////////////////////////////////////////////////////////
- } // namespace
- ///////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ScriptProvider::ScriptProvider
- // METHOD TYPE : Ctor
- //
- ScriptProvider::ScriptProvider( repo::RepoMediaAccess & access_r )
- : _access( access_r )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ScriptProvider::~ScriptProvider
- // METHOD TYPE : Dtor
- //
- ScriptProvider::~ScriptProvider()
- {}
-
- ManagedFile ScriptProvider::provideDoScript( const Script_constPtr & script_r ) const
- {
- ManagedFile ret;
- if ( script_r )
- {
- return doProvideScript( _access, *script_r,
- &Script::doScriptInlined,
- &Script::doScriptLocation );
- }
- return ret;
- }
-
- ManagedFile ScriptProvider::provideUndoScript( const Script_constPtr & script_r ) const
- {
- ManagedFile ret;
- if ( script_r )
- {
- return doProvideScript( _access, *script_r,
- &Script::undoScriptInlined,
- &Script::undoScriptLocation );
- }
- return ret;
- }
-
- /////////////////////////////////////////////////////////////////
- } // namespace repo
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/repo/ScriptProvider.h
- *
-*/
-#ifndef ZYPP_REPO_SCRIPTPROVIDER_H
-#define ZYPP_REPO_SCRIPTPROVIDER_H
-
-#include <iosfwd>
-
-#include "zypp/base/NonCopyable.h"
-#include "zypp/base/PtrTypes.h"
-
-#include "zypp/repo/RepoProvideFile.h"
-#include "zypp/ManagedFile.h"
-#include "zypp/ResTraits.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace repo
- { /////////////////////////////////////////////////////////////////
-
- class RepoMediaAccess;
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : ScriptProvider
- //
- /** */
- class ScriptProvider : private base::NonCopyable
- {
- public:
- /** Ctor */
- ScriptProvider( repo::RepoMediaAccess & access_r );
- /** Dtor */
- ~ScriptProvider();
-
- public:
- /** Provide a script in a local file.*/
- ManagedFile provideScript( const Script_constPtr & script_r, bool do_r ) const
- { return( do_r ? provideDoScript( script_r ) : provideUndoScript( script_r ) ); }
-
- /** Provide the do-script in a local file.
- * Returns an empty path if no script is available.
- */
- ManagedFile provideDoScript( const Script_constPtr & script_r ) const;
-
- /** Provide the do-script in a local file.
- * Returns an empty path if no script is available.
- */
- ManagedFile provideUndoScript( const Script_constPtr & script_r ) const;
-
- private:
- RepoMediaAccess & _access;
- };
- ///////////////////////////////////////////////////////////////////
-
- /////////////////////////////////////////////////////////////////
- } // namespace repo
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_REPO_SCRIPTPROVIDER_H
// ----v
case 'c': OUTS( patch, 5 ); return; break;
case 'd': OUTS( product, 7 ); return; break;
- case 'i': OUTS( script, 6 ); return; break;
case 'k': OUTS( package, 7 ); return; break;
- case 'm': OUTS( atom, 4 ); return; break;
case 'p': OUTS( srcpackage, 10 ); return; break;
- case 's': OUTS( message, 7 ); return; break;
case 't': OUTS( pattern, 7 ); return; break;
#undef OUTS
}
// ----v
case 'c': OUTS( patch, 5 ); break;
case 'd': OUTS( product, 7 ); break;
- case 'i': OUTS( script, 6 ); break;
case 'k': OUTS( package, 7 ); break;
- case 'm': OUTS( atom, 4 ); break;
case 'p': OUTS( srcpackage, 10 ); break;
- case 's': OUTS( message, 7 ); break;
case 't': OUTS( pattern, 7 ); break;
#undef OUTS
}
if ( !path.isExist() ) {
Testcase testcase("/var/log/updateTestcase");
- testcase.createTestcase (*this, true, false); // create pool, do not solve
+ testcase.createTestcase (*this, true, false); // create pool, do not solve
} else {
Testcase testcase("/mnt/var/log/updateTestcase");
testcase.createTestcase (*this, true, false); // create pool, do not solve
}
if ( isKind<Patch>(installed.resolvable())
- || isKind<Atom>(installed.resolvable())
- || isKind<Script>(installed.resolvable())
- || isKind<Message>(installed.resolvable())
|| isKind<Pattern>(installed.resolvable()))
{
MIL << "Delete old: " << installed << endl;
installed.status().setToBeUninstalled( ResStatus::APPL_HIGH );
- continue;
+ continue;
}
CandidateMap::iterator cand_it = candidatemap.find( installed );
// Remember new package for 2nd pass.
Capability installedCap( installed->name(), installed->kind());
-
+
// find ALL providers
sat::WhatProvides possibleProviders(installedCap);
MIL << " IGNORE relation match (package is tagged to delete): " << provider << endl;
} else if ( provider.status().isInstalled() ) {
if (installed->name() == provider->name()) {
- MIL << " IGNORE relation match (package is installed): " << provider << endl;
+ MIL << " IGNORE relation match (package is installed): " << provider << endl;
} else {
MIL << " Take installed package ONLY: " << provider << endl;
providersMap.clear();
break; // exit for
}
- }
+ }
else {
FindMap::iterator it = providersMap.find( provider->name() );
if ( ! doesObsoleteItem (item, it->first ) ) {
it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
}
- obsoletedItems.insert (it->first);
+ obsoletedItems.insert (it->first);
guess = PoolItem();
break;
} else {
if ( ! doesObsoleteItem (item, it->first ) ) {
it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
}
- obsoletedItems.insert (it->first);
+ obsoletedItems.insert (it->first);
guess = PoolItem();
break;
} else {
if ( ! doesObsoleteItem (guess, it->first ) ) {
it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
}
- obsoletedItems.insert (it->first);
+ obsoletedItems.insert (it->first);
++opt_stats_r.chk_replaced_guessed;
}
}
// Unmaintained packages which does not fit to the updated system
// (broken dependencies) will be deleted.
// Make a solverrun and return it to the calling function
-
+
bool ret=checkUnmaintainedItems ();
// Packages which obsoletes and do NOT required other installed packages will be installed if
&& provider.status().isInstalled()
&& !provider.status().isToBeUninstalled()
&& obsoletedItems.find(provider) == obsoletedItems.end()) {
-
+
// checking if there is another item with the same obsoletes. If there is one
// it would be randomly which package will be taken for update. So it is
// safier not to update at all.
it->status().setToBeInstalled( ResStatus::APPL_HIGH );
} else {
MIL << item << " obsoletes " << provider << " but does not provide it." << endl;
- MIL << " There is another item which obsoletes it too. I do not know whichone has to be taken" << endl;
+ MIL << " There is another item which obsoletes it too. I do not know whichone has to be taken" << endl;
}
- obsoletedItems.insert (provider);
- }
+ obsoletedItems.insert (provider);
+ }
}
}
}
#include "zypp/repo/DeltaCandidates.h"
#include "zypp/repo/PackageProvider.h"
-#include "zypp/repo/ScriptProvider.h"
#include "zypp/repo/SrcPackageProvider.h"
#include "zypp/sat/Pool.h"
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/**
- * \file zypp/ui/PatchContents.cc
- *
- * \author Stefan Hundhammer <sh@suse.de>
- *
- */
-
-#include "zypp/ui/PatchContentsImpl.h"
-
-namespace zypp
-{
- namespace ui
- {
- PatchContents::PatchContents( Patch::constPtr patch )
- : _pimpl( new PatchContents::Impl( patch ) )
- {
- // NOP
- }
-
- PatchContents::const_iterator PatchContents::begin() const
- {
- return _pimpl->begin();
- }
-
- PatchContents::const_iterator PatchContents::end() const
- {
- return _pimpl->end();
- }
-
- bool PatchContents::empty() const
- {
- return _pimpl->empty();
- }
-
- PatchContents::size_type PatchContents::size() const
- {
- return _pimpl->size();
- }
-
- } // namespace ui
-} // namespace zypp
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/**
- * \file zypp/ui/PatchContents.h
- *
- * \author Stefan Hundhammer <sh@suse.de>
- *
- */
-#ifndef ZYPP_UI_PATCH_CONTENTS_H
-#define ZYPP_UI_PATCH_CONTENTS_H
-
-#include <vector>
-#include "zypp/base/PtrTypes.h"
-#include "zypp/Patch.h"
-
-namespace zypp
-{
- namespace ui
- {
- /**
- * Helper class that turns Patch::atomList() into something useful.
- *
- * \deprecated use Patch::contets method instead.
- **/
- class ZYPP_DEPRECATED PatchContents
- {
- protected:
- typedef std::vector<ResObject::constPtr> ContentsCollection;
-
- public:
- class Impl;
-
- typedef ContentsCollection::iterator iterator;
- typedef ContentsCollection::const_iterator const_iterator;
- typedef ContentsCollection::size_type size_type;
-
-
- public:
-
- PatchContents( Patch::constPtr patch ) ZYPP_DEPRECATED;
-
- const_iterator begin() const ZYPP_DEPRECATED;
- const_iterator end () const ZYPP_DEPRECATED;
-
- bool empty() const ZYPP_DEPRECATED;
- size_type size() const ZYPP_DEPRECATED;
-
- private:
- RW_pointer<Impl> _pimpl;
- };
-
-
- } // namespace ui
-} // namespace zypp
-
-#endif // ZYPP_UI_PATCH_CONTENTS_H
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/**
- * \file zypp/ui/PatchContentsImpl.cc
- *
- * \author Stefan Hundhammer <sh@suse.de>
- *
- */
-
-#include <iostream>
-#include "zypp/base/Logger.h"
-#include "zypp/ui/PatchContentsImpl.h"
-#include <zypp/ZYppFactory.h>
-#include <zypp/ResPool.h>
-#include <zypp/Atom.h>
-
-using std::endl;
-
-namespace zypp
-{
- namespace ui
- {
- PatchContents::Impl::Impl( Patch::constPtr patch )
- : _patch( patch )
- {
- Patch::AtomList atomList = _patch->atoms();
- _contents.reserve( atomList.size() );
-
- ResPool pool = getZYpp()->pool();
-
- for( Patch::AtomList::iterator atom_it = atomList.begin();
- atom_it != atomList.end();
- ++atom_it )
- {
- ResPool::byName_iterator foundNames = pool.byNameBegin( (*atom_it)->name() );
- ResPool::byName_iterator foundNamesEnd = pool.byNameEnd ( (*atom_it)->name() );
-
- bool found = false;
-
- while ( ! found
- && foundNames != foundNamesEnd )
- {
- // DBG << "Found " << (*atom_it)->name() << " " << (*foundNames)->edition().asString() << endl;
-
- if ( isKind<Package>( (*foundNames).resolvable() ) &&
- (*atom_it)->edition() <= (*foundNames)->edition() &&
- (*atom_it)->arch() == (*foundNames)->arch() )
- {
- found = true;
- _contents.push_back( *foundNames );
-
- MIL << "Found resolvable for patch atom: "
- << (*foundNames)->name() << "-" << (*foundNames)->edition()
- << " arch: " << (*foundNames)->arch().asString()
- << endl;
- }
- else
- ++foundNames;
- }
-
- if ( ! found )
- {
- Arch system_arch = getZYpp()->architecture();
-
- if (! (*atom_it)->arch().compatibleWith( system_arch) )
- {
- // It's perfectly legitimate for that corresponding resolvable not to be in the pool:
- // The pool only contains resolvables in matching architectures, yet a
- // multi-arch patch might as well contain atoms for different architectures.
-
- continue;
- }
-
- DBG << "No resolvable for patch atom in pool: "
- << (*atom_it)->name() << "-" << (*atom_it)->edition()
- << " arch: " << (*atom_it)->arch().asString()
- << endl;
- }
- }
- }
-
-
- PatchContents::const_iterator PatchContents::Impl::begin() const
- {
- return _contents.begin();
- }
-
-
- PatchContents::const_iterator PatchContents::Impl::end() const
- {
- return _contents.end();
- }
-
-
- bool PatchContents::Impl::empty() const
- {
- return _contents.empty();
- }
-
-
- PatchContents::size_type PatchContents::Impl::size() const
- {
- return _contents.size();
- }
-
- } // namespace ui
-} // namespace zypp
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/**
- * \file zypp/ui/PatchContentsImpl.h
- *
- * \author Stefan Hundhammer <sh@suse.de>
- *
- */
-#ifndef ZYPP_UI_PATCH_CONTENTS_IMPL_H
-#define ZYPP_UI_PATCH_CONTENTS_IMPL_H
-
-#include <vector>
-#include "zypp/base/PtrTypes.h"
-#include "zypp/ui/PatchContents.h"
-
-namespace zypp
-{
- namespace ui
- {
- class PatchContents::Impl
- {
- public:
-
- Impl( Patch::constPtr patch );
-
- const_iterator byKindBegin( const ResObject::Kind & kind_r ) const;
- const_iterator byKindEnd ( const ResObject::Kind & kind_r ) const;
-
- const_iterator begin() const;
- const_iterator end () const;
-
- bool empty() const;
- size_type size() const;
-
- private:
- Patch::constPtr _patch;
- ContentsCollection _contents;
- };
-
-
- } // namespace ui
-} // namespace zypp
-
-#endif // ZYPP_UI_PATCH_CONTENTS_IMPL_H
+++ /dev/null
-/*---------------------------------------------------------------------\
- | ____ _ __ __ ___ |
- | |__ / \ / / . \ . \ |
- | / / \ V /| _/ _/ |
- | / /__ | | | | | | |
- | /_____||_| |_| |_| |
- | |
- \---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternContents.cc
- *
-*/
-
-#include "zypp/ui/PatternContentsImpl.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- PatternContents::PatternContents( const Pattern::constPtr & pattern )
- : _pimpl( new PatternContents::Impl( pattern ) )
- {}
-
- std::set<std::string> PatternContents::install_packages() const
- {
- return _pimpl->install_packages();
- }
-
- /////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
- | ____ _ __ __ ___ |
- | |__ / \ / / . \ . \ |
- | / / \ V /| _/ _/ |
- | / /__ | | | | | | |
- | /_____||_| |_| |_| |
- | |
- \---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternContents.h
- *
-*/
-#ifndef ZYPP_UI_PATTERN_CONTENTS_H
-#define ZYPP_UI_PATTERN_CONTENTS_H
-
-#include "zypp/base/PtrTypes.h"
-#include "zypp/Pattern.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : PatternContents
- //
- /** Helper class that computes a patterns expanded install_packages set.
- *
- * Joins the install_packages sets of this and all included or extending
- * pattens.
- *
- * \deprecated use Pattern::contents method instead.
- */
- class ZYPP_DEPRECATED PatternContents
- {
- public:
- class Impl;
-
- public:
- /** Ctor taking the Pattern to expand. */
- PatternContents( const Pattern::constPtr & pattern ) ZYPP_DEPRECATED;
-
- /** Return the expanded Patterns install_packages. */
- std::set<std::string> install_packages() const ZYPP_DEPRECATED;
-
- private:
- RW_pointer<Impl> _pimpl;
- };
-
- ///////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_UI_PATTERN_CONTENTS_H
+++ /dev/null
-/*---------------------------------------------------------------------\
- | ____ _ __ __ ___ |
- | |__ / \ / / . \ . \ |
- | / / \ V /| _/ _/ |
- | / /__ | | | | | | |
- | /_____||_| |_| |_| |
- | |
- \---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternContentsImpl.cc
- *
-*/
-
-#include <iostream>
-#include "zypp/base/LogTools.h"
-
-#include "zypp/ui/PatternContentsImpl.h"
-#include "zypp/ui/PatternExpander.h"
-
-#include "zypp/ZYppFactory.h"
-#include "zypp/ResPool.h"
-
-using std::endl;
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- namespace
- { /////////////////////////////////////////////////////////////////
-
- struct CollectInstallPackages
- {
- CollectInstallPackages( std::set<std::string> & result )
- : _result( &result )
- {}
-
- void operator()( const Pattern::constPtr & pattern )
- {
-#warning NEEDS FIX
-// std::set<std::string> s( pattern->install_packages() );
- std::set<std::string> s;
- _result->insert( s.begin(), s.end() );
- }
-
- std::set<std::string> * _result;
- };
-
- /////////////////////////////////////////////////////////////////
- } // namespace
- ///////////////////////////////////////////////////////////////////
-
- PatternContents::Impl::Impl( const Pattern::constPtr & pattern )
- : _pattern( pattern )
- {}
-
- std::set<std::string> PatternContents::Impl::install_packages() const
- {
- PatternExpander expander( getZYpp()->pool() );
-
- if ( ! expander.expand( _pattern ) )
- return std::set<std::string>(); // empty pattern set
-
- std::set<std::string> result;
- for_each( expander.begin(),
- expander.end(),
- CollectInstallPackages( result ) );
- return result;
- }
-
- /////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
- | ____ _ __ __ ___ |
- | |__ / \ / / . \ . \ |
- | / / \ V /| _/ _/ |
- | / /__ | | | | | | |
- | /_____||_| |_| |_| |
- | |
- \---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternContentsImpl.h
- *
-*/
-#ifndef ZYPP_UI_PATTERN_CONTENTS_IMPL_H
-#define ZYPP_UI_PATTERN_CONTENTS_IMPL_H
-
-#include "zypp/base/PtrTypes.h"
-#include "zypp/ui/PatternContents.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : PatternContents::Impl
- //
- /** */
- class PatternContents::Impl
- {
- public:
- Impl( const Pattern::constPtr & pattern );
-
- std::set<std::string> install_packages() const;
-
- private:
- Pattern::constPtr _pattern;
- };
-
- /////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_UI_PATTERN_CONTENTS_IMPL_H
+++ /dev/null
-/*---------------------------------------------------------------------\
- | ____ _ __ __ ___ |
- | |__ / \ / / . \ . \ |
- | / / \ V /| _/ _/ |
- | / /__ | | | | | | |
- | /_____||_| |_| |_| |
- | |
- \---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternExpander.cc
- *
-*/
-#include <iostream>
-//#include "zypp/base/LogTools.h"
-
-#include "zypp/ui/PatternExpander.h"
-
-#include "zypp/base/Algorithm.h"
-#include "zypp/base/Function.h"
-#include "zypp/ResPool.h"
-
-using std::endl;
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : PatternExpander::Impl
- //
- /** PatternExpander implementation. */
- class PatternExpander::Impl
- {
- public:
- Impl( const ResPool & pool_r )
- : _pool( pool_r )
- {}
-
- /** Recursively expand Pattern. */
- size_type doExpand( Pattern::constPtr pat_r )
- {
- //INT << "+++ " << pat_r << " ++++++++++++++++++++++++++++++++++" << endl;
- _patternMap.clear();
- if ( pat_r )
- {
- _patternMap[pat_r];
- Pattern::constPtr unprocessed( pat_r );
- //MIL << _patternMap << endl;
- do {
- expandIncludes( unprocessed );
- expandExtending( unprocessed );
- _patternMap[unprocessed] = true;
- //MIL << _patternMap << endl;
- } while( (unprocessed = nextUnprocessed()) );
- }
- //SEC << "--- " << _patternMap.size() << " ----------------------------------" << endl;
- return _patternMap.size();
- }
-
- const PatternMap & patternMap() const
- { return _patternMap; }
-
- private:
- /** Get the next unprocessed Pattern \c _patternMap. */
- Pattern::constPtr nextUnprocessed() const
- {
- for ( PatternMap::const_iterator it = _patternMap.begin(); it != _patternMap.end(); ++it )
- {
- if ( ! it->second )
- return it->first;
- }
- return NULL;
- }
-
- private:
- /** Store all included patterns in \c _patternMap. */
- void expandIncludes( const Pattern::constPtr & pat_r )
- {
- Pattern::NameList c( pat_r->includes() );
- for_( it, c.begin(), c.end() )
- {
- expandInclude( Capability( it->c_str(), ResKind::pattern ) );
- }
- }
-
- /** Store Patterns matching an \c Includes capability in \c _patternMap. */
- void expandInclude( const Capability & include_r )
- {
- sat::WhatProvides w( include_r );
- for_( it, w.begin(), w.end() )
- {
- _patternMap[asKind<Pattern>(PoolItem(*it))];
- }
- }
-
- private:
- /** Store all patterns extending \c pat_r in \c _patternMap. */
- void expandExtending( const Pattern::constPtr & pat_r )
- {
- Pattern::NameList c( pat_r->extends() );
- for_( it, c.begin(), c.end() )
- {
-#warning TBD
- //expandIfExtends( pat_r, Capability( it->c_str(), ResKind::pattern ) );
- }
- }
-
- /** Store \c extending_r if it extends \c pat_r. */
- void expandIfExtends( const Pattern::constPtr & pat_r, const PoolItem & extending_r )
- {
- Pattern::constPtr extending( asKind<Pattern>(extending_r) );
-
- if ( ! extending->extends().empty() )
- {
-#warning TBD
-#if 0
- if ( std::find_if( extending->extends().begin(),
- extending->extends().end(),
- bind( &Impl::providedBy, this, pat_r, _1 ) )
- != extending->extends().end() )
- {
- // an extends matches the Pattern
- _patternMap[extending];
- //DBG << mapEntry(*_patternMap.find(extending)) << endl;
- }
-#endif
- }
- }
-
- /** Return true if Capability \c extends_r is provided by Pattern. */
- bool providedBy( const Pattern::constPtr & pat_r, const Capability & extends_r )
- {
- if ( !pat_r )
- return false;
-
- sat::Solvable pat( pat_r->satSolvable() );
- sat::WhatProvides w( extends_r );
- for_( it, w.begin(), w.end() )
- {
- if ( pat == *it )
- return true;
- }
- return false;
- }
-
- private:
- ResPool _pool;
- PatternMap _patternMap;
- };
- ///////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : PatternExpander
- //
- ///////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : PatternExpander::PatternExpander
- // METHOD TYPE : Ctor
- //
- PatternExpander::PatternExpander( const ResPool & pool_r )
- : _pimpl( new Impl( pool_r ) )
- {}
-
- PatternExpander::size_type PatternExpander::expand( const Pattern::constPtr & pat_r )
- { return _pimpl->doExpand( pat_r ); }
-
- PatternExpander::size_type PatternExpander::size() const
- { return _pimpl->patternMap().size(); }
-
- bool PatternExpander::empty() const
- { return _pimpl->patternMap().empty(); }
-
- PatternExpander::const_iterator PatternExpander::begin() const
- { return make_map_key_begin( _pimpl->patternMap() ); }
-
- PatternExpander::const_iterator PatternExpander::end() const
- { return make_map_key_end( _pimpl->patternMap() ); }
-
- /////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-/** \file zypp/ui/PatternExpander.h
- *
-*/
-#ifndef ZYPP_UI_PATTERNEXPANDER_H
-#define ZYPP_UI_PATTERNEXPANDER_H
-
-#include <iosfwd>
-#include <map>
-
-#include "zypp/base/PtrTypes.h"
-#include "zypp/base/NonCopyable.h"
-#include "zypp/base/DefaultIntegral.h"
-#include "zypp/base/Iterator.h"
-
-#include "zypp/Pattern.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- class ResPool;
-
- ///////////////////////////////////////////////////////////////////
- namespace ui
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : PatternExpander
- //
- /** Recursively expand a Pattern.
- *
- * This means recursively expanding Patterns included by this or
- * extending this. The result is a \c set of <tt>Pattern::constPtr</tt>
- * accessible via iterator.
- */
- class PatternExpander : private base::NonCopyable
- {
- private:
- class Impl;
- typedef std::map<Pattern::constPtr,
- DefaultIntegral<bool, false> > PatternMap;
-
- public:
- typedef PatternMap::size_type size_type;
- typedef PatternMap::key_type value_type;
- typedef MapKVIteratorTraits<PatternMap>::Key_const_iterator const_iterator;
-
- public:
- /** Ctor taking the ResPool to use. */
- PatternExpander( const ResPool & pool_r );
-
- public:
- /** \name Expand a Pattern.
- * \returns Number of Patterns after expansion.
- */
- //@{
- size_type expand( const ResObject::constPtr & obj_r )
- { return expand( asKind<Pattern>(obj_r) ); }
-
- size_type expand( const Pattern::constPtr & pat_r );
- //@}
-
- /** \name Access result of last expansion.. */
- //@{
- size_type size() const;
-
- bool empty() const;
-
- const_iterator begin() const;
-
- const_iterator end() const;
- //@}
-
- private:
- /** Pointer to implementation */
- RW_pointer<Impl> _pimpl;
- };
- ///////////////////////////////////////////////////////////////////
-
- /////////////////////////////////////////////////////////////////
- } // namespace ui
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_UI_PATTERNEXPANDER_H
template<class PkgSet_T> void addPkgSetPackages( set<string> & pkgNames );
static void addPatternPackages ( set<string> & pkgNames );
- static void addLanguagePackages ( set<string> & pkgNames );
static void addPatchPackages ( set<string> & pkgNames );
addDirectlySelectedPackages ( pkgNames );
addPatternPackages ( pkgNames );
- addLanguagePackages ( pkgNames );
addPatchPackages ( pkgNames );
return pkgNames;
}
- static void addLanguagePackages( set<string> & pkgNames )
- {
-#warning NO MORE LANGUAGE RESOLVABLE
-#if 0
- // Build a set of all languages that are to be transacted
-
- set<string> wantedLanguages;
-
- for ( PoolProxyIterator lang_it = langBegin();
- lang_it != langEnd();
- ++lang_it )
- {
- if ( (*lang_it)->toModify() )
- {
- DBG << "Language will be transacted: \"" << (*lang_it)->name() << "\"" << endl;
-
- wantedLanguages.insert( (*lang_it)->name() );
- }
- }
-
-
- // Check all packages if they support any of the wanted languages
-
- for ( PoolProxyIterator pkg_it = pkgBegin();
- pkg_it != pkgEnd();
- ++pkg_it )
- {
- ResObject::constPtr obj = (*pkg_it)->theObj();
-
- if ( obj )
- {
- Capabilities freshens = obj->dep( Dep::FRESHENS );
-
- for ( Capabilities::const_iterator cap_it = freshens.begin();
- cap_it != freshens.end();
- ++cap_it )
- {
- if ( contains( wantedLanguages, (*cap_it).index() ) )
- pkgNames.insert( obj->name() );
- }
- }
- }
-#endif
- }
-
-
-
static void addPatchPackages( set<string> & pkgNames )
{
for ( PoolProxyIterator patch_it = patchesBegin();
DBG << "Patch will be transacted: \"" << patch->name()
<< "\" - \"" << patch->summary() << "\"" << endl;
- Patch::AtomList atomList = patch->atoms();
-
- for ( Patch::AtomList::iterator atom_it = atomList.begin();
- atom_it != atomList.end();
- ++atom_it )
- {
- pkgNames.insert( (*atom_it)->name() );
- }
+ Patch::Contents contents( patch->contents() );
+ for_( it, contents.begin(), contents.end() )
+ {
+ pkgNames.insert( it->name() );
+ }
}
}
}