dnl Process this file with autoconf to produce a configure script.
dnl ==================================================
-AC_INIT(zypp,0.0.0)
+AC_INIT(zypp,1.0.0)
AC_CONFIG_SRCDIR(zypp/Makefile.am)
AC_PREFIX_DEFAULT(/usr)
dnl set age to 0.
dnl
-LIBZYPP_CURRENT=0
+LIBZYPP_CURRENT=1
LIBZYPP_REVISION=0
LIBZYPP_AGE=0
-LIBZYPP_VERSION=$LIBZYPP_CURRENT.$LIBZYPP_REVISION.$LIBZYPP_AGE
-AC_SUBST(LIBZYPP_VERSION)
-
LIBZYPP_VERSION_INFO="-version-info $LIBZYPP_CURRENT:$LIBZYPP_REVISION:$LIBZYPP_AGE"
AC_SUBST(LIBZYPP_VERSION_INFO)
PACKAGE: ${PACKAGE}
VERSION: ${VERSION}
- LIBVERSION: lib${PACKAGE}.so.${LIBZYPP_VERSION}
+ LIBVERSION: lib${PACKAGE}.so.$LIBZYPP_CURRENT.$LIBZYPP_AGE.$LIBZYPP_REVISION
FEATURES: ${ZYPP_FEATURES}
///////////////////////////////////////////////////////////////////
+struct AddResolvables
+{
+ bool operator()( const Source_Ref & src ) const
+ { getZYpp()->addResolvables( src.resolvables() ); }
+};
+
+///////////////////////////////////////////////////////////////////
+
+struct SetTransactValue
+{
+ SetTransactValue( ResStatus::TransactValue newVal_r, ResStatus::TransactByValue causer_r )
+ : _newVal( newVal_r )
+ , _causer( causer_r )
+ {}
+
+ ResStatus::TransactValue _newVal;
+ ResStatus::TransactByValue _causer;
+
+ bool operator()( const PoolItem & pi ) const
+ { return pi.status().setTransactValue( _newVal, _causer ); }
+};
+
+struct StatusReset : public SetTransactValue
+{
+ StatusReset()
+ : SetTransactValue( ResStatus::KEEP_STATE, ResStatus::USER )
+ {}
+};
+
+
+inline bool selectForTransact( const NameKindProxy & nkp )
+{
+ if ( nkp.availableEmpty() )
+ return false;
+
+ return nkp.availableBegin()->status().setTransact( true, ResStatus::USER );
+}
+
+///////////////////////////////////////////////////////////////////
+
namespace zypp
{
+ namespace pool
+ {
+ struct CollectTransacting
+ {
+ CollectTransacting( const ResPool & pool )
+ {
+ dumpPoolStats( SEC,
+ make_filter_begin<resfilter::ByTransact>(pool),
+ make_filter_end<resfilter::ByTransact>(pool) );
+ }
+
+ typedef std::list<PoolItem> PoolItemList;
+ PoolItemSet _toInstall;
+ PoolItemSet _toDelete;
+ PoolItemSet _skipToDelete;
+ };
+#if 0
struct CollectTransacting
{
typedef std::list<PoolItem> PoolItemList;
PoolItemSet _toDelete;
PoolItemSet _skipToDelete;
};
-
+#endif
std::ostream & operator<<( std::ostream & str, const CollectTransacting & obj )
{
str << "CollectTransacting:" << endl;
obj._skipToDelete.begin(), obj._skipToDelete.end() ) << endl;
return str;
}
-}
-
-///////////////////////////////////////////////////////////////////
-
-struct AddResolvables
-{
- bool operator()( const Source_Ref & src ) const
- { getZYpp()->addResolvables( src.resolvables() ); }
-};
-
-///////////////////////////////////////////////////////////////////
-
-struct SetTransactValue
-{
- SetTransactValue( ResStatus::TransactValue newVal_r, ResStatus::TransactByValue causer_r )
- : _newVal( newVal_r )
- , _causer( causer_r )
- {}
-
- ResStatus::TransactValue _newVal;
- ResStatus::TransactByValue _causer;
-
- bool operator()( const PoolItem & pi ) const
- { return pi.status().setTransactValue( _newVal, _causer ); }
-};
-
-struct StatusReset : public SetTransactValue
-{
- StatusReset()
- : SetTransactValue( ResStatus::KEEP_STATE, ResStatus::USER )
- {}
-};
-
-
-inline bool selectForTransact( const NameKindProxy & nkp )
-{
- if ( nkp.availableEmpty() )
- return false;
-
- return nkp.availableBegin()->status().setTransact( true, ResStatus::USER );
+ }
}
/******************************************************************
INT << "===[END]============================================" << endl << endl;
+ zypp::base::LogControl::instance().logNothing();
return 0;
}
-------------------------------------------------------------------
+Tue May 16 21:35:27 CEST 2006 - ma@suse.de
+
+- Make basic attributes available through ResObject.
+- Let ResObjects which do not require media access during
+ commit return ZERO sourceMediaNr (required for #173690)
+- Version 1.0.0
+
+-------------------------------------------------------------------
Tue May 16 14:00:57 CEST 2006 - schubi@suse.de
- setCandidate accept candidates with compatible architectures too. Not
only with the same architecture. Bug 172594 - If update package has
- differet arch, UI display is wrong
+ differet arch, UI display is wrong
-------------------------------------------------------------------
Tue May 16 09:30:45 CEST 2006 - mvidner@suse.cz
-- Added Source_Ref::resStoreInitialized.
+- Added Source_Ref::resStoreInitialized.
If we know that noone has seen the resolvables yet, we can skip
them too, eg. when deleting a source. (#174840)
- rev 3378
Thu May 11 17:42:29 CEST 2006 - schubi@suse.de
- Do not transact itself (update) in the transactResObject mechanism
- Bug 174290
+ Bug 174290
-------------------------------------------------------------------
Thu May 11 16:37:51 CEST 2006 - mt@suse.de
-------------------------------------------------------------------
Wed May 3 17:40:45 CEST 2006 - dmacvicar@suse.de
-- Fix yum key verification, because a double variable declaration
+- Fix yum key verification, because a double variable declaration
-------------------------------------------------------------------
Wed May 3 15:34:00 CEST 2006 - dmacvicar@suse.de
- use --no-default-keyring to avoid creating a
- default gpg dir in / (#171055)
+ default gpg dir in / (#171055)
- rev 3335
-------------------------------------------------------------------
Wed May 3 14:40:25 CEST 2006 - dmacvicar@suse.de
- Fix YUM signature checking, we were passing the key instead of the
- signature.
+ signature.
- When the user trust a key, sync again. Bye to the session trusted
keys and user being asked all the time. (#171213)
- r3332
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
if (show_mediaid) {
Resolvable::constPtr res = r;
Package::constPtr pkg = asKind<Package>(res);
- if (pkg) str << "[" << pkg->mediaId() << "]";
+ if (pkg) str << "[" << pkg->sourceMediaNr() << "]";
}
if (r->kind() != ResTraits<zypp::Package>::kind)
str << r->kind() << ':';
Resolvable::Kind kind = ResTraits<zypp::Package>::kind;
if (!str.empty()) {
if (str == "package") {
- // empty
+ // empty
}
else if (str == "patch") {
kind = ResTraits<zypp::Patch>::kind;
return lhs.resolvable() < rhs.resolvable();
}
};
-
+
typedef std::set<PoolItem_Ref, KNEAOrder> PoolItemOrderSet;
static void
RESULT << endl;
RESULT << counter << ". set with " << items.size() << " resolvables" << endl;
PoolItemOrderSet orderedset;
-
+
for ( solver::detail::PoolItemList::iterator iter = items.begin(); iter != items.end(); ++iter )
{
orderedset.insert( *iter );
order.setInstalled( items );
}
#endif
-
+
cout << "- - - - - - - - - -" << endl;
}
continue;
}
if (node->equals ("forceResolve")) {
-
+
forceResolve = true;
} else if (node->equals ("system")) {
cerr << "Can't setup 'system'" << endl;
exit( 1 );
}
-
+
} else if (node->equals ("hardwareInfo")) {
Pathname pathname = globalPath + node->getProp ("path");
setenv ("ZYPP_MODALIAS_SYSFS", pathname.asString().c_str(), 1);
- RESULT << "setting HardwareInfo to: " << pathname.asString() << endl;
+ RESULT << "setting HardwareInfo to: " << pathname.asString() << endl;
} else if (node->equals ("channel")) {
string name = node->getProp ("name");
PoolItem_Ref poolItem;
poolItem = get_poolItem ("@system", package_name, kind_name);
-
+
if (! poolItem) {
cerr << "Can't force-uninstall installed package '" << package_name << "'" << endl;
} else {
if (resolver->invalidQueues().empty()) {
cout << "Invalid solutions: " << (long) resolver->invalidQueues().size() << endl;
}
-
+
if (resolver->bestContext()) {
cout << endl << "Best Solution:" << endl;
print_solution (resolver->bestContext(), &count, checksum_list, instorder, mediaorder);
if (complete.size() < 20) {
for (ResolverQueueList::const_iterator iter = complete.begin(); iter != complete.end(); iter++) {
ResolverQueue_Ptr queue = (*iter);
- if (queue->context() != resolver->bestContext())
+ if (queue->context() != resolver->bestContext())
print_solution (queue->context(), &count, checksum_list, instorder, mediaorder);
}
}
{
solver::detail::Resolver_Ptr resolver = *((solver::detail::Resolver_Ptr *)data);
if (status.isNeeded()) {
- poolItem.status().setToBeInstalled(ResStatus::USER);
+ poolItem.status().setToBeInstalled(ResStatus::USER);
// resolver->addPoolItemToInstall (poolItem);
}
RESULT << "Checking for upgrades..." << endl;
int count = foreach_system_upgrade (resolver);
-
+
if (count == 0)
RESULT << "System is up-to-date, no upgrades required" << endl;
else
RESULT << "Problem:" << endl;
RESULT << problem.description() << endl;
RESULT << problem.details() << endl;
-
+
ProblemSolutionList solutions = problem.solutions();
for (ProblemSolutionList::const_iterator iter = solutions.begin();
iter != solutions.end(); ++iter) {
RESULT << "Taking solution: " << solutionNr << endl;
RESULT << "For problem: " << problemNr << endl;
ResolverProblemList problems = resolver->problems ();
-
+
int problemCounter = -1;
int solutionCounter = -1;
// find problem
root = new XmlNode (xmlDocGetRootElement (xml_doc));
DBG << "Parsing file '" << filename << "'" << endl;
-
+
parse_xml_test (root, pool);
-
+
xmlFreeDoc (xml_doc);
}
main (int argc, char *argv[])
{
// setenv("ZYPP_NOLOG","1",1); // no logging
-
+
if (argc != 2) {
cerr << "Usage: deptestomatic testfile.xml" << endl;
exit (0);
bool HelixPackageImpl::installOnly() const
{ return _install_only; }
-unsigned int HelixPackageImpl::mediaId() const
+unsigned int HelixPackageImpl::sourceMediaNr() const
{ return _mediaid; }
/** */
virtual bool installOnly() const;
/** */
- virtual unsigned mediaId() const;
+ virtual unsigned sourceMediaNr() const;
/** */
virtual Source_Ref source() const;
/** */
virtual Vendor vendor() const
{ return "SuSE";}
-
+
protected:
Source_Ref _source;
Changelog Package::changelog() const
{ return pimpl().changelog(); }
- /** Time of package installation */
- Date Package::installtime() const
- { return pimpl().installtime(); }
-
- /** */
- Date Package::buildtime() const
- { return pimpl().buildtime(); }
-
/** */
std::string Package::buildhost() const
{ return pimpl().buildhost(); }
std::string Package::distribution() const
{ return pimpl().distribution(); }
- /** */
- Vendor Package::vendor() const
- { return pimpl().vendor(); }
-
/** */
Label Package::license() const
{ return pimpl().license(); }
ByteCount Package::sourcesize() const
{ return pimpl().sourcesize(); }
- /** */
- ByteCount Package::archivesize() const
- { return pimpl().archivesize(); }
-
DiskUsage Package::diskusage() const
{ return pimpl().diskusage(); }
std::list<std::string> Package::filenames() const
{ return pimpl().filenames(); }
- /** */
- License Package::licenseToConfirm() const
- { return pimpl().licenseToConfirm(); }
-
- bool Package::installOnly() const
- { return pimpl().installOnly(); }
-
- unsigned Package::mediaId() const
- { return pimpl().mediaId(); }
-
Pathname Package::location() const
{ return pimpl().location(); }
* Checksum the source says this package should have
*/
CheckSum checksum() const;
- /** Time of package installation */
- Date installtime() const;
/** Get the package change log */
Changelog changelog() const;
/** */
- Date buildtime() const;
- /** */
std::string buildhost() const;
/** */
std::string distribution() const;
/** */
- Vendor vendor() const;
- /** */
Label license() const;
/** */
std::string packager() const;
/** */
ByteCount sourcesize() const;
/** */
- ByteCount archivesize() const;
- /** */
std::list<std::string> authors() const;
/** */
std::list<std::string> filenames() const;
/** Disk usage per directory */
DiskUsage diskusage() const;
- /** */
- License licenseToConfirm() const;
-
- /** */
- bool installOnly() const;
- /** ID of the media */
- unsigned mediaId() const;
/** location in source */
Pathname location() const;
- // data here:
-
-
protected:
Package( const NVRAD & nvrad_r );
/** Dtor */
{ /////////////////////////////////////////////////////////////////
IMPL_PTR_TYPE(Product);
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : Product::Product
{ return pimpl().flags(); }
/** */
- License Product::licenseToConfirm() const
- { return pimpl().licenseToConfirm(); }
-
- /** */
Label Product::shortName() const
{ return pimpl().shortName().text(); }
{ /////////////////////////////////////////////////////////////////
DEFINE_PTR_TYPE(Product);
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ResObject
std::list<std::string> flags() const;
/** */
- License licenseToConfirm() const;
-
- /** */
Label shortName() const;
/** */
Text ResObject::delnotify() const
{ return pimpl().delnotify().text(); }
+ License ResObject::licenseToConfirm() const
+ { return pimpl().licenseToConfirm().text(); }
+
+ Vendor ResObject::vendor() const
+ { return pimpl().vendor(); }
+
ByteCount ResObject::size() const
{ return pimpl().size(); }
+ ByteCount ResObject::archivesize() const
+ { return pimpl().archivesize(); }
+
Source_Ref ResObject::source() const
{ return pimpl().source(); }
+ unsigned ResObject::sourceMediaNr() const
+ { return pimpl().sourceMediaNr(); }
+
+ bool ResObject::installOnly() const
+ { return pimpl().installOnly(); }
+
+ Date ResObject::buildtime() const
+ { return pimpl().buildtime(); }
+
+ Date ResObject::installtime() const
+ { return pimpl().installtime(); }
+
ZmdId ResObject::zmdid () const
{ return pimpl().zmdid(); }
#ifndef ZYPP_RESOBJECT_H
#define ZYPP_RESOBJECT_H
+#include "zypp/base/Deprecated.h"
+
#include "zypp/detail/ResObjectImplIf.h"
#include "zypp/Resolvable.h"
#include "zypp/TranslatedText.h"
Text delnotify() const;
/** */
+ Text licenseToConfirm() const;
+
+ /** */
+ Vendor vendor() const;
+
+ /** */
ByteCount size() const;
/** */
+ ByteCount archivesize() const;
+
+ /** Backlink to the source providing this. */
Source_Ref source() const;
+ /** Number of the source media that provides the data
+ * required for installation. Zero, if no media access
+ * is required.
+ */
+ unsigned sourceMediaNr() const;
+
+ /** */
+ bool installOnly() const;
+
+ /** */
+ Date buildtime() const;
+
+ /** Time of installation, or \c 0 */
+ Date installtime() const;
+
/** */
ZmdId zmdid () const;
{ /////////////////////////////////////////////////////////////////
IMPL_PTR_TYPE(SrcPackage);
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : SrcPackage::SrcPackage
DiskUsage SrcPackage::diskusage() const
{ return pimpl().diskusage(); }
- unsigned SrcPackage::mediaId() const
- { return pimpl().mediaId(); }
-
Pathname SrcPackage::location() const
{ return pimpl().location(); }
*/
class SrcPackage : public ResObject
{
-
+
public:
typedef detail::SrcPackageImplIf Impl;
typedef SrcPackage Self;
ByteCount archivesize() const;
/** Disk usage per directory */
DiskUsage diskusage() const;
- /** ID of the media */
- unsigned mediaId() const;
/** location in source */
Pathname location() const;
// as far as resonable.
/////////////////////////////////////////////////////////////////
- Date PackageImplIf::buildtime() const
- { return Date(); }
-
CheckSum PackageImplIf::checksum() const
{ return CheckSum(); }
std::string PackageImplIf::buildhost() const
{ return std::string(); }
- Date PackageImplIf::installtime() const
- { return Date(); }
-
std::string PackageImplIf::distribution() const
{ return std::string(); }
- Vendor PackageImplIf::vendor() const
- { return Vendor(); }
-
Label PackageImplIf::license() const
{ return Label(); }
ByteCount PackageImplIf::sourcesize() const
{ return ByteCount(); }
- ByteCount PackageImplIf::archivesize() const
- { return ByteCount(); }
-
DiskUsage PackageImplIf::diskusage() const
- { return DiskUsage(); }
+ { return DiskUsage(); }
std::list<std::string> PackageImplIf::authors() const
{ return std::list<std::string>(); }
std::list<std::string> PackageImplIf::filenames() const
{ return std::list<std::string>(); }
- License PackageImplIf::licenseToConfirm() const
- { return License(); }
-
std::list<DeltaRpm> PackageImplIf::deltaRpms() const
{ return std::list<DeltaRpm>(); }
std::list<PatchRpm> PackageImplIf::patchRpms() const
{ return std::list<PatchRpm>(); }
- bool PackageImplIf::installOnly() const
- { return false; }
-
- unsigned PackageImplIf::mediaId() const
- { return 1; }
-
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
public:
typedef Package ResType;
-#if 0
-
- /**
- * @short Holds Data about file and file type
- * (directory, plain)
- **/
- class FileData {
- public:
- std::string name;
- std::string type;
- FileData();
- FileData(const std::string &name,
- const std::string &type)
- : name(name), type(type)
- {}
- };
-#endif
-
public:
/** \name Rpm Package Attributes. */
//@{
-
+
virtual CheckSum checksum() const PURE_VIRTUAL;
/** */
- virtual Date buildtime() const PURE_VIRTUAL;
- /** */
virtual std::string buildhost() const PURE_VIRTUAL;
/** */
- virtual Date installtime() const PURE_VIRTUAL;
- /** */
virtual std::string distribution() const PURE_VIRTUAL;
/** */
- virtual Vendor vendor() const PURE_VIRTUAL;
- /** */
virtual Label license() const PURE_VIRTUAL;
/** */
virtual std::string packager() const PURE_VIRTUAL;
/** */
virtual ByteCount sourcesize() const PURE_VIRTUAL;
/** */
- virtual ByteCount archivesize() const PURE_VIRTUAL;
- /** */
virtual DiskUsage diskusage() const PURE_VIRTUAL;
/** */
virtual std::list<std::string> authors() const PURE_VIRTUAL;
virtual std::list<DeltaRpm> deltaRpms() const PURE_VIRTUAL;
/** */
virtual std::list<PatchRpm> patchRpms() const PURE_VIRTUAL;
- /** */
- virtual bool installOnly() const PURE_VIRTUAL;
- /** */
- virtual unsigned mediaId() const PURE_VIRTUAL;
//@}
- /** \name Additional Package Attributes.
- * \todo review what's actually needed here. Maybe worth grouping
- * all the package rertieval related stuff in a class. Easier to ship
- * and handle it.
- */
- //@{
- /** */
- virtual License licenseToConfirm() const PURE_VIRTUAL;
-#if 0
- /** */
- virtual std::string sourceloc() const PURE_VIRTUAL;
- /** */
- virtual void du( PkgDu & dudata_r ) const PURE_VIRTUAL;
- /** */
- virtual unsigned int medianr() const PURE_VIRTUAL;
- /** */
- virtual PackageKeywords keywords() const PURE_VIRTUAL;
- /** */
- virtual std::string md5sum() const PURE_VIRTUAL;
- /** */
- virtual std::string externalUrl() const PURE_VIRTUAL;
- /** */
- virtual std::list<Edition> patchRpmBaseVersions() const PURE_VIRTUAL;
- /** */
- virtual ByteCount patchRpmSize() const PURE_VIRTUAL;
- /** */
- virtual bool forceInstall() const PURE_VIRTUAL;
- /** */
- virtual std::string patchRpmMD5() const PURE_VIRTUAL;
- /** */
- virtual bool isRemote() const PURE_VIRTUAL;
- /** */
- virtual PMError providePkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
- /** */
- virtual PMError provideSrcPkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
- /** */
- virtual constInstSrcPtr source() const PURE_VIRTUAL;
- /** */
- virtual std::list<PMPackageDelta> deltas() const PURE_VIRTUAL;
-#endif
- //@}
};
///////////////////////////////////////////////////////////////////
{ /////////////////////////////////////////////////////////////////
/** Get the category of the product - addon or base*/
- std::string ProductImplIf::category() const
- { return std::string(); }
+ std::string ProductImplIf::category() const
+ { return std::string(); }
/** Get the vendor of the product */
- Label ProductImplIf::vendor() const
- { return Label(); }
+ Label ProductImplIf::vendor() const
+ { return Label(); }
Url ProductImplIf::releaseNotesUrl() const
{ return Url(); }
std::list<std::string> ProductImplIf::flags() const
{ return std::list<std::string>(); }
-
- License ProductImplIf::licenseToConfirm() const
- { return License(); }
TranslatedText ProductImplIf::shortName() const
{ return TranslatedText(); }
/** The product flags */
virtual std::list<std::string> flags() const PURE_VIRTUAL;
- virtual License licenseToConfirm() const PURE_VIRTUAL;
-
virtual TranslatedText shortName() const PURE_VIRTUAL;
};
///////////////////////////////////////////////////////////////////
TranslatedText ResObjectImplIf::delnotify() const
{ return TranslatedText::notext; }
+ TranslatedText ResObjectImplIf::licenseToConfirm() const
+ { return TranslatedText::notext; }
+
+ Vendor ResObjectImplIf::vendor() const
+ { return Vendor(); }
+
ByteCount ResObjectImplIf::size() const
- { return 0; }
+ { return ByteCount(); }
- bool ResObjectImplIf::providesSources() const
- { return false; }
+ ByteCount ResObjectImplIf::archivesize() const
+ { return ByteCount(); }
Source_Ref ResObjectImplIf::source() const
{ return Source_Ref::noSource; }
- ZmdId ResObjectImplIf::zmdid() const
+ unsigned ResObjectImplIf::sourceMediaNr() const
{ return 0; }
- Label ResObjectImplIf::instSrcLabel() const
- { return Label(); }
+ bool ResObjectImplIf::installOnly() const
+ { return false; }
- Vendor ResObjectImplIf::instSrcVendor() const
- { return Vendor(); }
+ Date ResObjectImplIf::buildtime() const
+ { return Date(); }
+
+ Date ResObjectImplIf::installtime() const
+ { return Date(); }
+
+ ZmdId ResObjectImplIf::zmdid() const
+ { return 0; }
/////////////////////////////////////////////////////////////////
} // namespace detail
/** \name Common Attributes.
* These should be provided by each kind of Resolvable. Call the
* default implementation if you don't have a value for it.
- * \todo The UI likes to work on ResObject level, but some of
- * the values actually make no sense for several kinds of Resolvable,
- * or may have completely different semantics. See whether we can get
- * rid of ome stuff.
- * \todo Some of these are actually tranlated or translatable.
- * offer some concept to express it.
- * \todo LICENSE HANDLING!
*/
//@{
/** Short label. */
/** \todo well define! */
virtual TranslatedText delnotify() const PURE_VIRTUAL;
+ /** */
+ virtual TranslatedText licenseToConfirm() const PURE_VIRTUAL;
+
+ /** */
+ virtual Vendor vendor() const PURE_VIRTUAL;
+
/** Size. \todo well define which size. */
virtual ByteCount size() const PURE_VIRTUAL;
- /** Wheter there are src.rpm available too. */
- virtual bool providesSources() const PURE_VIRTUAL;
+ /** */
+ virtual ByteCount archivesize() const PURE_VIRTUAL;
- /** Installation source which provides the package */
+ /** Backlink to the source providing this. */
virtual Source_Ref source() const PURE_VIRTUAL;
+ /** Number of the source media that provides the data
+ * required for installation. Zero, if no media access
+ * is required.
+ */
+ virtual unsigned sourceMediaNr() const PURE_VIRTUAL;
+
+ /** */
+ virtual bool installOnly() const PURE_VIRTUAL;
+
+ /** */
+ virtual Date buildtime() const;
+
+ /** Time of installation, or \c 0 */
+ virtual Date installtime() const;
+
/** Id used inside ZMD */
virtual ZmdId zmdid() const PURE_VIRTUAL;
-
- /** \name deprecated
- * \todo These should be replaced by a offering a
- * Ptr to the Source.
- */
- //@{
- /** \deprecated */
- virtual Label instSrcLabel() const PURE_VIRTUAL;
- /** \deprecated */
- virtual Vendor instSrcVendor() const PURE_VIRTUAL;
//@}
- //@}
public:
/** Ctor */
ResObjectImplIf()
/** Dtor. Makes this an abstract class. */
virtual ~ResObjectImplIf() = 0;
+ public:
/** Test whether \c this is already connected to Resolvable. */
bool hasBackRef() const
{ return _backRef; }
- void unmanage()
- { _backRef = NULL; }
-
- public:
/** Access to Resolvable data if connected. */
const Resolvable *const self() const
{ return _backRef; }
- /** Access to Resolvable data if connected. */
- Resolvable *const self()
- { return _backRef; }
private:
/** Manages _backRef when glued to a Resolvable. */
/** */
virtual Label order() const PURE_VIRTUAL;
+ /** */
virtual const std::set<std::string> install_packages( const Locale & lang = Locale("") ) const;
-
-#if 0
- // NOTE LangCode id zypp:Locale
- virtual ByteCount size() const;
- virtual bool providesSources() const;
- virtual std::string instSrcLabel() const;
- virtual Vendor instSrcVendor() const;
- virtual unsigned instSrcRank() const;
- virtual std::list<std::string> inspacks( const LangCode & lang = LangCode("") ) const;
- virtual std::list<std::string> delpacks( const LangCode & lang = LangCode("") ) const;
- virtual PM::LocaleSet supportedLocales() const;
- virtual std::set<PMSelectablePtr> pureInspacks_ptrs( const LangCode & lang ) const;
- virtual std::set<PMSelectablePtr> inspacks_ptrs( const LangCode & lang ) const;
- virtual std::set<PMSelectablePtr> delpacks_ptrs( const LangCode & lang ) const;
- virtual bool isBase() const;
- virtual PMError provideSelToInstall( Pathname & path_r ) const;
-#endif
};
///////////////////////////////////////////////////////////////////
{ return ByteCount(); }
DiskUsage SrcPackageImplIf::diskusage() const
- { return DiskUsage(); }
+ { return DiskUsage(); }
Pathname SrcPackageImplIf::location() const
{ return Pathname(); }
- unsigned SrcPackageImplIf::mediaId() const
- { return 1; }
-
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
virtual DiskUsage diskusage() const PURE_VIRTUAL;
/** */
virtual Pathname location() const PURE_VIRTUAL;
- /** */
- virtual unsigned mediaId() const PURE_VIRTUAL;
-
};
///////////////////////////////////////////////////////////////////
: _report (report_r)
, _resolvable (resolvable_r)
{}
-
- virtual ~DownloadProgressPackageReceiver () {}
-
+
+ virtual ~DownloadProgressPackageReceiver () {}
+
virtual void reportbegin() {}
-
+
virtual void reportend() {}
/**
)
: _report (report_r)
{}
-
- virtual ~DownloadProgressFileReceiver () {}
-
+
+ virtual ~DownloadProgressFileReceiver () {}
+
virtual void reportbegin() {}
-
+
virtual void reportend() {}
/**
Pathname file;
callback::SendReport<source::DownloadResolvableReport> report;
DownloadProgressPackageReceiver download_report( report, package );
-
+
while (retry)
{
report->start( package, package->source().url() );
-
+
callback::TempConnect<media::DownloadProgressReport> tmp_download( download_report );
-
- file = provideJustFile( package->location(), package->mediaId());
+
+ file = provideJustFile( package->location(), package->sourceMediaNr());
report->finish( package, source::DownloadResolvableReport::NO_ERROR, "" );
-
+
CheckSum checksum = package->checksum();
std::string calculated_digest;
-
- // check digest
+
+ // check digest
try
- {
+ {
std::ifstream is(file.asString().c_str(), std::ifstream::binary);
calculated_digest = Digest::digest(checksum.type(), is);
is.close();
{
ERR << "Can't open " << file << " for integrity check." << std::endl;
}
-
+
if ( checksum.checksum() == calculated_digest )
{
MIL << package->location() << " ok. [" << calculated_digest << "]" << std::endl;
- digest_ok = true;
+ digest_ok = true;
retry = false;
}
-
+
if (!digest_ok)
{
std::string package_str = package->name() + "-" + package->edition().asString();
source::DownloadResolvableReport::Action useraction = report->problem(package, source::DownloadResolvableReport::INVALID, "Package " + package_str + " fails integrity check. Do you want to retry downloading it, or abort installation?");
-
+
if( useraction == source::DownloadResolvableReport::ABORT )
{
ZYPP_THROW(Exception("Package " + package->location().asString() + " fails integrity check. Expected: [" + checksum.checksum() + "] Read: [" + calculated_digest + "] (" + checksum.type() + ")"));
}
return file;
}
-
+
const Pathname SourceImpl::provideFile(const Pathname & file_r,
const unsigned media_nr,
bool cached,
bool checkonly )
- {
+ {
callback::SendReport<source::DownloadFileReport> report;
DownloadProgressFileReceiver download_report( report );
-
+
SourceFactory source_factory;
-
+
Url file_url( url().asString() + file_r.asString() );
report->start( source_factory.createFrom(this), file_url );
-
+
callback::TempConnect<media::DownloadProgressReport> tmp_download( download_report );
-
+
Pathname file = provideJustFile( file_r, media_nr, cached, checkonly );
report->finish( file_url, source::DownloadFileReport::NO_ERROR, "" );
-
+
return file;
}
const Pathname SourceImpl::tryToProvideFile( const Pathname & file, const unsigned media_nr )
{
media::MediaAccessId _media = _media_set->getMediaAccessId( media_nr);
- media_mgr.provideFile (_media, file, false, false);
+ media_mgr.provideFile (_media, file, false, false);
return media_mgr.localPath( _media, file );
}
-
+
const Pathname SourceImpl::provideJustFile(const Pathname & file_r,
const unsigned media_nr,
ZYPP_CAUGHT(excpt_r);
ERR << "Failed to release all sources" << endl;
}
-
+
// set up the reason
- media::MediaChangeReport::Error reason
+ media::MediaChangeReport::Error reason
= media::MediaChangeReport::INVALID;
if( typeid(excp) == typeid( media::MediaFileNotFoundException ) ||
report->requestMedia (
source_factory.createFrom( this ),
media_nr,
- reason,
+ reason,
excp.asUserString()
);
}
// set up the reason
media::MediaChangeReport::Error reason = media::MediaChangeReport::INVALID;
-
+
if( typeid(excp) == typeid( media::MediaFileNotFoundException ) || typeid(excp) == typeid( media::MediaNotAFileException ) )
{
reason = media::MediaChangeReport::NOT_FOUND;
reason = media::MediaChangeReport::WRONG;
}
user = report->requestMedia ( source_factory.createFrom( this ), media_nr, reason, excp.asUserString() );
-
+
DBG << "ProvideFile exception caught, callback answer: " << user << endl;
-
+
if( user == media::MediaChangeReport::ABORT )
{
DBG << "Aborting" << endl;
{
// retry
DBG << "Going to try again" << endl;
-
+
// not attaching, media set will do that for us
// this could generate uncaught exception (#158620)
-
+
break;
}
else
{
DBG << "Don't know, let's ABORT" << endl;
-
+
ZYPP_RETHROW ( excp );
}
} while( user == media::MediaChangeReport::EJECT );
{
// TODO: will this work in chroot?
// TODO: better download somewhere else and then copy over
- try{
+ try{
storeMetadata( _cache_dir );
}
catch( const zypp::Exception & excpt )
const PkgContent & _content;
const Locale & _lang;
PkgImplPtr _current;
-
+
NVRA _nvra;
int _count;
std::set<NVRA> _notfound;
Arch _system_arch;
SuseTagsImpl::Ptr _sourceImpl;
-
+
PackagesLangParser ( SuseTagsImpl::Ptr sourceimpl , const PkgContent & content_r, const Locale & lang_r)
: _content( content_r )
, _lang( lang_r)
, _count(0)
, _sourceImpl( sourceimpl )
-
+
{
ZYpp::Ptr z = getZYpp();
_system_arch = z->architecture();
_current = NULL;
return;
}
-
+
PkgContent::const_iterator it = _content.find(NVRAD(_nvra));
if (it == _content.end())
{
_sourceImpl->_package_data[_nvra]._delnotify = TranslatedText (mtag_r.values, _lang);
}
else if ( mtag_r.name == "Eul" )
- {
- for ( std::list<std::string>::const_iterator it = mtag_r.values.begin(); it != mtag_r.values.end(); ++it)
- {
- _sourceImpl->_package_data[_nvra]._license_to_confirm += *it;
- }
- }
+ {
+ _sourceImpl->_package_data[_nvra]._license_to_confirm = TranslatedText (mtag_r.values, _lang);
+ }
}
};
SuseTagsPackageImplData()
{
}
-
+
TranslatedText _summary;
TranslatedText _description;
TranslatedText _insnotify;
TranslatedText _delnotify;
- License _license_to_confirm;
+ TranslatedText _license_to_confirm;
std::list<std::string> _authors;
};
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : SuseTagsImpl
/** Provide only resolvables of a certain kind. */
virtual ResStore provideResolvables(Source_Ref source_r, zypp::Resolvable::Kind kind);
-
+
virtual std::string type(void) const
{ return typeString(); }
*/
static std::string typeString(void)
{ return "YaST"; }
-
+
virtual unsigned numberOfMedia(void) const;
virtual std::string vendor (void) const;
virtual const std::list<Pathname> publicKeys();
virtual std::string unique_id (void) const;
-
+
Pathname sourceDir( const std::string & dir );
virtual void storeMetadata(const Pathname & cache_dir_r);
-
+
/**
* Get media verifier for the specified media
*/
* \throw EXCEPTION on fail
*/
virtual void factoryInit();
-
+
void readContentFile();
-
+
void provideProducts(Source_Ref source_r, ResStore& store);
void providePackages(Source_Ref source_r, ResStore& store);
void provideSelections(Source_Ref source_r, ResStore& store);
void provideSelection(Source_Ref source_r, ResStore& store);
void providePatterns(Source_Ref source_r, ResStore& store);
-
+
/**
* verify media mode (use the new META tags)
*/
bool verifyChecksumsMode();
-
- /**
+
+ /**
* Verify file checksum
* \throw EXCEPTION on verification file
*/
void verifyFile( const Pathname &path, const std::string &key);
-
+
unsigned _media_count;
-
+
// descr dir we are using
// depends if we are on media or
// cache
Pathname _descr_dir;
Pathname _data_dir;
-
+
// descr dir on media.
// we need it if we refresh
// already running from cache
Pathname _orig_descr_dir;
-
+
Pathname _content_file;
Pathname _content_file_sig;
Pathname _content_file_key;
-
+
std::string _vendor;
std::string _media_id;
/**
* we need it to access the checksums if we are in verify mode
*/
detail::ResImplTraits<SuseTagsProductImpl>::Ptr _prodImpl;
- Product::Ptr _product;
+ Product::Ptr _product;
public:
-
+
// shared data between packages with same NVRA
std::map<NVRA, SuseTagsPackageImplData> _package_data;
// list of packages which depend on another package for its data
std::map<NVRA, bool> _is_shared;
-
+
// list of translation files
std::list<std::string> _pkg_translations;
};
{ /////////////////////////////////////////////////////////////////
IMPL_PTR_TYPE(SuseTagsImpl);
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : PackageImpl::PackageImpl
// METHOD TYPE : Ctor
//
- SuseTagsPackageImpl::SuseTagsPackageImpl(Source_Ref source_r) :
- _source( source_r )
+ SuseTagsPackageImpl::SuseTagsPackageImpl(Source_Ref source_r)
+ : _media_number( 1 )
+ , _source( source_r )
{}
///////////////////////////////////////////////////////////////////
SuseTagsPackageImpl::~SuseTagsPackageImpl()
{}
- CheckSum SuseTagsPackageImpl::checksum() const
- { return _checksum; }
-
TranslatedText SuseTagsPackageImpl::summary() const
{
return _sourceImpl->_package_data[_data_index]._summary;
}
TranslatedText SuseTagsPackageImpl::description() const
- {
+ {
return _sourceImpl->_package_data[_data_index]._description;
}
TranslatedText SuseTagsPackageImpl::insnotify() const
- {
+ {
return _sourceImpl->_package_data[_data_index]._insnotify;
}
return _sourceImpl->_package_data[_data_index]._delnotify;
}
+ TranslatedText SuseTagsPackageImpl::licenseToConfirm() const
+ {
+ return _sourceImpl->_package_data[_data_index]._license_to_confirm;
+ }
+
+ Source_Ref SuseTagsPackageImpl::source() const
+ { return _source; }
+
+ unsigned SuseTagsPackageImpl::sourceMediaNr() const
+ { return _media_number; }
+
+ CheckSum SuseTagsPackageImpl::checksum() const
+ { return _checksum; }
+
Date SuseTagsPackageImpl::buildtime() const
{ return _buildtime; }
std::list<std::string> SuseTagsPackageImpl::filenames() const
{ return std::list<std::string>(); }
- License SuseTagsPackageImpl::licenseToConfirm() const
- {
- return _sourceImpl->_package_data[_data_index]._license_to_confirm;
- }
-
std::list<DeltaRpm> SuseTagsPackageImpl::deltaRpms() const
{ return std::list<DeltaRpm>(); }
bool SuseTagsPackageImpl::installOnly() const
{ return false; }
- Source_Ref SuseTagsPackageImpl::source() const
- { return _source; }
-
- unsigned SuseTagsPackageImpl::mediaId() const
- { return _media_number; }
-
/////////////////////////////////////////////////////////////////
} // namespace susetags
///////////////////////////////////////////////////////////////////
{ /////////////////////////////////////////////////////////////////
namespace susetags
{ /////////////////////////////////////////////////////////////////
-
+
DEFINE_PTR_TYPE(SuseTagsImpl);
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : PackageImpl
SuseTagsPackageImpl(Source_Ref source_r);
virtual ~SuseTagsPackageImpl();
- /** \name Rpm Package Attributes. */
+ /** \name ResObject attributes. */
//@{
virtual TranslatedText summary() const;
virtual TranslatedText description() const;
virtual TranslatedText insnotify() const;
virtual TranslatedText delnotify() const;
+ virtual TranslatedText licenseToConfirm() const;
+ virtual Source_Ref source() const;
+ virtual unsigned sourceMediaNr() const;
+ //@}
virtual CheckSum checksum() const;
/** */
/** */
virtual bool installOnly() const;
- virtual License licenseToConfirm() const;
-
- virtual unsigned mediaId() const;
-
// which entry in sourceImpl::_package_data has
// the shared data for this package
NVRA _data_index;
NVRA _nvra;
-
+
PackageGroup _group;
std::list<std::string> _authors;
std::list<std::string> _keywords;
ByteCount _size;
ByteCount _archivesize;
Label _license;
- Label _license_to_confirm;
Date _buildtime;
- unsigned int _media_number;
+ unsigned _media_number;
Pathname _location;
DiskUsage _diskusage;
CheckSum _checksum;
-
+
SuseTagsImpl_Ptr _sourceImpl;
-
+
private:
Source_Ref _source;
- public:
- Source_Ref source() const;
-
-/*
-=Grp: System/Base
-=Lic: GPL
-=Src: 3ddiag 0.724 3 src
-=Tim: 1111489970
-=Loc: 1 3ddiag-0.724-3.i586.rpm
-
-*/
-
};
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
{ /////////////////////////////////////////////////////////////////
namespace susetags
{ /////////////////////////////////////////////////////////////////
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : SrcPackageImpl::SrcPackageImpl
// METHOD TYPE : Ctor
//
- SuseTagsSrcPackageImpl::SuseTagsSrcPackageImpl(Source_Ref source_r) :
- _source( source_r )
+ SuseTagsSrcPackageImpl::SuseTagsSrcPackageImpl(Source_Ref source_r)
+ : _media_number( 1 )
+ , _source( source_r )
{}
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : SrcPackageImpl::~SrcPackageImpl
Source_Ref SuseTagsSrcPackageImpl::source() const
{ return _source; }
- unsigned SuseTagsSrcPackageImpl::mediaId() const
+ unsigned SuseTagsSrcPackageImpl::sourceMediaNr() const
{ return _media_number; }
/////////////////////////////////////////////////////////////////
} // namespace susetags
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
- } // namespace
+ } // namespace
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
{ /////////////////////////////////////////////////////////////////
namespace susetags
{ /////////////////////////////////////////////////////////////////
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : SrcPackageImpl
SuseTagsSrcPackageImpl(Source_Ref source_r);
virtual ~SuseTagsSrcPackageImpl();
- /** \name Rpm Package Attributes. */
- //@{
/** */
virtual Pathname location() const;
/** */
/** */
virtual DiskUsage diskusage() const;
/** */
- virtual unsigned mediaId() const;
+ virtual unsigned sourceMediaNr() const;
private:
Source_Ref _source;
ByteCount _archivesize;
- unsigned int _media_number;
+ unsigned _media_number;
Pathname _location;
DiskUsage _diskusage;
public:
Source_Ref source() const;
-
-/*
-=Grp: System/Base
-=Lic: GPL
-=Src: 3ddiag 0.724 3 src
-=Tim: 1111489970
-=Loc: 1 3ddiag-0.724-3.i586.rpm
-
-*/
-
};
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
const zypp::parser::yum::YUMOtherData & other
)
: _summary(parsed.summary),
- _description(),
+ _description(parsed.description),
+ _license_to_confirm(parsed.license_to_confirm), // TODO add to metadata
_buildtime(strtol(parsed.timeBuild.c_str(), 0, 10)),
_buildhost(parsed.buildhost),
_url(parsed.url),
_group(parsed.group),
_changelog(), // TODO
_type(parsed.type),
- _license_to_confirm(), // TODO add to metadata
_authors(parsed.authors),
_keywords( parsed.keywords),
- _mediaid(strtol(parsed.media.c_str(), 0, 10)),
+ _mediaNumber(strtol(parsed.media.c_str(), 0, 10)),
_checksum(parsed.checksumType,
parsed.checksum),
_filenames(),
_dir_sizes(parsed.dirSizes),
#endif
{
- _description.setText(parsed.description);
- _license_to_confirm = parsed.license_to_confirm.asString();
for (std::list<FileData>::const_iterator it = filelist.files.begin();
it != filelist.files.end();
it++)
const zypp::parser::yum::YUMPatchPackage & parsed
)
: _summary(parsed.summary),
- _description(),
+ _description(parsed.description),
+ _license_to_confirm(parsed.license_to_confirm),
_buildtime(strtol(parsed.timeBuild.c_str(), 0, 10)),
_buildhost(parsed.buildhost),
_url(parsed.url),
_group(parsed.group),
_changelog(), // TODO
_type(parsed.type),
- _license_to_confirm(),
_authors(parsed.authors),
_keywords( parsed.keywords),
- _mediaid(strtol(parsed.media.c_str(), 0, 10)),
+ _mediaNumber(strtol(parsed.media.c_str(), 0, 10)),
_checksum(parsed.checksumType,
parsed.checksum),
_filenames(),
_dir_sizes(parsed.dirSizes),
#endif
{
- _description.setText(parsed.description);
- _license_to_confirm = parsed.license_to_confirm.asString();
for (std::list<FileData>::const_iterator it = parsed.files.begin();
it != parsed.files.end();
it++)
TranslatedText YUMPackageImpl::description() const
{ return _description; }
+ /** */
+ TranslatedText YUMPackageImpl::licenseToConfirm() const
+ { return _license_to_confirm; }
+
+ /** */
ByteCount YUMPackageImpl::size() const
#warning fixme
{ return 0; }
std::list<std::string> YUMPackageImpl::filenames() const
{ return _filenames; }
- License YUMPackageImpl::licenseToConfirm() const
- { return _license_to_confirm; }
-
/** */
std::string YUMPackageImpl::type() const
{ return _type; }
bool YUMPackageImpl::installOnly() const
{ return _install_only; }
- unsigned YUMPackageImpl::mediaId() const
- { return _mediaid; }
+ unsigned YUMPackageImpl::sourceMediaNr() const
+ { return _mediaNumber; }
CheckSum YUMPackageImpl::checksum() const
{ return _checksum; }
Source_Ref YUMPackageImpl::source() const
{ return _source; }
-#if 0
- /** */
- unsigned YUMPackageImpl::packageSize() const
- { return _size_package; }
- /** */
- unsigned YUMPackageImpl::archiveSize() const
- { return _size_archive; }
- /** */
- unsigned YUMPackageImpl::installedSize() const
- { return _size_installed; }
-// FIXME do not understand items below
- /** */
- bool YUMPackageImpl::providesSources() const
- {
- return false;
- }
- /** */
- std::string YUMPackageImpl::instSrcLabel() const
- {
- return "";
- }
- /** */
- std::string YUMPackageImpl::instSrcVendor() const
- {
- return "";
- }
- /** */
- unsigned YUMPackageImpl::instSrcRank() const
- {
- return 0;
- }
- /** */
- std::string YUMPackageImpl::buildhost() const
- {
- return _buildhost;
- }
- /** */
- std::string YUMPackageImpl::distribution() const
- {
- return "";
- }
- /** */
- std::string YUMPackageImpl::vendor() const
- {
- return _vendor;
- }
- /** */
- std::string YUMPackageImpl::license() const
- {
- return _license;
- }
- /** */
- std::list<std::string> YUMPackageImpl::licenseToConfirm() const
- {
- return std::list<std::string>();
- }
- /** */
- std::string YUMPackageImpl::packager() const
- {
- return _packager;
- }
- /** */
- std::string YUMPackageImpl::group() const
- {
- return _group;
- }
- /** */
- std::list<std::string> YUMPackageImpl::changelog() const
- {}
- /** */
- std::string YUMPackageImpl::url() const
- {
- return _url;
- }
- /** */
- std::string YUMPackageImpl::os() const
- {}
- /** */
- std::list<std::string> YUMPackageImpl::prein() const
- {}
- /** */
- std::list<std::string> YUMPackageImpl::postin() const
- {}
- /** */
- std::list<std::string> YUMPackageImpl::preun() const
- {}
- /** */
- std::list<std::string> YUMPackageImpl::postun() const
- {}
- /** */
- std::string YUMPackageImpl::sourcepkg() const
- { return _sourcepkg; }
- /** */
- std::list<std::string> YUMPackageImpl::authors() const
- { return _authors; }
- /** */
- std::list<std::string> YUMPackageImpl::filenames() const
- {}
- /** */
- std::string YUMPackageImpl::location() const
- {}
- /** */
- std::string YUMPackageImpl::md5sum() const
- {}
- /** */
- std::string YUMPackageImpl::externalUrl() const
- {}
- /** */
- std::list<Edition> YUMPackageImpl::patchRpmBaseVersions() const
- {}
- /** */
- unsigned YUMPackageImpl::patchRpmSize() const
- {}
- /** */
- bool YUMPackageImpl::forceInstall() const
- {}
- /** */
- std::string YUMPackageImpl::patchRpmMD5() const
- {}
- /** */
- bool YUMPackageImpl::isRemote() const
- {}
- /** */
- bool YUMPackageImpl::prefererCandidate() const
- {}
-
-#endif
-
} // namespace yum
/////////////////////////////////////////////////////////////////
} // namespace source
virtual TranslatedText summary() const;
/** Package description */
virtual TranslatedText description() const;
+ /** */
+ virtual TranslatedText licenseToConfirm() const;
+ /** */
virtual ByteCount size() const;
/** */
virtual Date buildtime() const;
/** */
virtual std::list<std::string> filenames() const;
/** */
- virtual License licenseToConfirm() const;
- /** */
virtual std::string type() const;
/** */
virtual std::list<std::string> keywords() const;
/** */
virtual bool installOnly() const;
/** */
- virtual unsigned mediaId() const;
+ virtual unsigned sourceMediaNr() const;
/** */
virtual CheckSum checksum() const;
/** */
/** */
virtual std::list<PatchRpm> patchRpms() const;
-#if 0
- /** */
- virtual unsigned packageSize() const;
- /** */
- virtual unsigned installedSize() const;
- /** */
- virtual unsigned archiveSize() const;
- /** */
- virtual bool providesSources() const;
- /** */
- virtual std::string instSrcLabel() const;
- /** */
- virtual std::string instSrcVendor() const;
- /** */
- virtual unsigned instSrcRank() const;
- /** */
- virtual std::string buildhost() const;
- /** */
- virtual std::string distribution() const;
- /** */
- virtual std::string vendor() const;
- /** */
- virtual std::string license() const;
- /** */
- virtual std::list<std::string> licenseToConfirm() const;
- /** */
- virtual std::string packager() const;
- /** */
- virtual std::string group() const;
- /** */
- virtual std::list<std::string> changelog() const;
- /** */
- virtual std::string url() const;
- /** */
- virtual std::string os() const;
- /** */
- virtual std::list<std::string> prein() const;
- /** */
- virtual std::list<std::string> postin() const;
- /** */
- virtual std::list<std::string> preun() const;
- /** */
- virtual std::list<std::string> postun() const;
- /** */
- virtual std::string sourcepkg() const;
- /** */
- virtual std::list<std::string> authors() const;
- /** */
- virtual std::list<std::string> filenames() const;
- /** */
- virtual unsigned int medianr() const;
- /** */
- virtual std::string md5sum() const;
- /** */
- virtual std::string externalUrl() const;
- /** */
- virtual std::list<Edition> patchRpmBaseVersions() const;
- /** */
- virtual unsigned patchRpmSize() const;
- /** */
- virtual bool forceInstall() const;
- /** */
- virtual std::string patchRpmMD5() const;
- /** */
- virtual bool isRemote() const;
- /** */
- virtual bool prefererCandidate() const;
-#endif
protected:
TranslatedText _summary;
TranslatedText _description;
+ TranslatedText _license_to_confirm;
Date _buildtime;
std::string _buildhost;
std::string _url;
PackageGroup _group;
Changelog _changelog;
std::string _type;
- License _license_to_confirm;
std::list<std::string> _authors;
std::list<std::string> _keywords;
- unsigned _mediaid;
+ unsigned _mediaNumber;
CheckSum _checksum;
std::list<std::string> _filenames;
Pathname _location;
void YUMSourceImpl::factoryInit()
{
bool cache = cacheExists();
-
+
try
{
media::MediaManager media_mgr;
MIL << "Adding no media verifier" << endl;
-
+
// don't try to attach media
media::MediaAccessId _media = _media_set->getMediaAccessId(1, true);
media_mgr.delVerifier(_media);
ZYPP_CAUGHT(excpt_r);
WAR << "Verifier not found" << endl;
}
-
+
if ( cache )
{
DBG << "Cached metadata found in [" << _cache_dir << "]." << endl;
_repomd_file = _cache_dir + "/repodata/repomd.xml";
-
+
if (PathInfo(_cache_dir + "/repodata/repomd.xml.asc").isExist())
_repomd_signature = _cache_dir + "/repodata/repomd.xml.asc";
-
+
if (PathInfo(_cache_dir + "/repodata/repomd.xml.key").isExist())
_repomd_key = _cache_dir + "/repodata/repomd.xml.key";
}
else
{
DBG << "Cached metadata not found in [" << _cache_dir << "]. Reading from " << _path << endl;
- _repomd_file = provideFile(_path + "/repodata/repomd.xml");
-
+ _repomd_file = provideFile(_path + "/repodata/repomd.xml");
+
// key and signature are optional
-
+
try {
_repomd_key = tryToProvideFile( _path + "/repodata/repomd.xml.key");
}
catch( const Exception &e ) {
WAR << "Repository does not contain repomd signing key" << std::endl;
}
-
+
try {
_repomd_signature = tryToProvideFile( _path + "/repodata/repomd.xml.asc");
}
catch( const Exception &e ) {
WAR << "Repository does not contain repomd signature" << std::endl;
- }
+ }
// if they not exists both will be Pathname()
}
-
+
if ( ! PathInfo(_repomd_file).isExist() )
ZYPP_THROW(Exception("repodata/repomd.xml not found"));
else
MIL << "repomd file is [" << _repomd_file << "]" << std::endl;
-
+
MIL << "Trying to get the key" << endl;
if ( ! _repomd_key.empty() )
{
{
WAR << "Source provides no key" << std::endl;
}
-
+
checkMetadataChecksums(cache);
}
void YUMSourceImpl::checkMetadataChecksums(bool from_cache)
{
bool cache = from_cache;
-
+
MIL << "Checking [" << _repomd_file << "] integrity" << endl;
-
+
if (! getZYpp()->keyRing()->verifyFileSignatureWorkflow(_repomd_file, (_path + "/repodata/repomd.xml").asString()+ " (" + url().asString() + ")", _repomd_signature))
ZYPP_THROW(Exception(N_("Signed repomd.xml file fails signature check")));
-
+
DBG << "Reading file " << _repomd_file << " to check integrity of metadata." << endl;
ifstream repo_st(_repomd_file.asString().c_str());
YUMRepomdParser repomd(repo_st, "");
-
+
for(; ! repomd.atEnd(); ++repomd)
{
if ((*repomd)->type == "other")
{
ZYPP_THROW(Exception( (*repomd)->location + " " + N_("fails checksum verification.") ));
}
-
+
// now parse patches mentioned if we are in patches.xml
-
+
if ((*repomd)->type == "patches")
{
Pathname patch_index = file_to_check;
ZYPP_THROW(Exception( (*patch)->location + " " + N_("fails checksum verification.") ));
}
}
- }
+ }
}
}
}
-
+
void YUMSourceImpl::storeMetadata(const Pathname & cache_dir_r)
{
_cache_dir = cache_dir_r;
// before really download all the data and init the cache, check
// if the source has really changed, otherwise, make it quick
Pathname cached_repomd = cache_dir_r + "/repodata/repomd.xml";
-
+
// we can only assume repomd intact means the source changed if the source is signed.
if ( cacheExists() && PathInfo( _cache_dir + "/repodata/repomd.xml.asc").isExist() )
{
}
}
MIL << "YUM source " << alias() << "has changed. Re-reading metadata into " << cache_dir_r << endl;
-
-
+
+
MIL << "Cleaning up cache dir" << std::endl;
filesystem::clean_dir(cache_dir_r);
// re-read all data
_repomd_file = remote_repomd;
-
+
// provide optional files
Pathname remote_repomd_key;
Pathname remote_repomd_signature;
// check again all file integrity, on the just downloaded files
checkMetadataChecksums(false);
-
+
filesystem::copy( remote_repomd, dst + "repomd.xml");
-
+
if (PathInfo(remote_repomd_key).isExist())
filesystem::copy( remote_repomd_key, dst + "repomd.xml.key");
if (PathInfo(remote_repomd_signature).isExist())
filesystem::copy( remote_repomd_signature, dst + "repomd.xml.asc");
-
+
DBG << "Reading file " << remote_repomd << endl;
ifstream repo_st(remote_repomd.asString().c_str());
YUMRepomdParser repomd(repo_st, "");
-
+
for(;
! repomd.atEnd();
++repomd)
continue;
Pathname src = provideFile(_path + (*repomd)->location);
-
+
dst = cache_dir_r + (*repomd)->location;
filesystem::copy(src, dst);
if ((*repomd)->type == "patches")
? _cache_dir + "/repodata/repomd.xml"
: provideFile(_path + "/repodata/repomd.xml");
_metadata_files.push_back("/repodata/repomd.xml");
-
+
DBG << "Reading ifgz file " << filename << endl;
ifgzstream repo_st(filename.asString().c_str());
YUMRepomdParser repomd(repo_st, "");
++repomd)
{
// note that we skip adding other.xml to the list of files to provide
-
+
if ((*repomd)->type == "primary")
repo_primary.push_back(*repomd);
else if ((*repomd)->type == "filelists")
Pathname filename = cacheExists()
? _cache_dir + (*it)->location
: provideFile(_path + (*it)->location);
-
+
_metadata_files.push_back((*it)->location);
DBG << "Reading file " << filename << endl;
ifgzstream st ( filename.asString().c_str() );
Pathname filename = cacheExists()
? _cache_dir + (*it)->location
: provideFile(_path + (*it)->location);
-
+
_metadata_files.push_back((*it)->location);
DBG << "Reading file " << filename << endl;
ifgzstream st ( filename.asString().c_str() );
Pathname filename = cacheExists()
? _cache_dir + (*it)->location
: provideFile(_path + (*it)->location);
-
+
_metadata_files.push_back((*it)->location);
DBG << "Reading file " << filename << endl;
ifgzstream st ( filename.asString().c_str() );
Pathname filename = cacheExists()
? _cache_dir + (*it)->location
: provideFile(_path + (*it)->location);
-
+
_metadata_files.push_back((*it)->location);
DBG << "Reading file " << filename << endl;
ifgzstream st ( filename.asString().c_str() );
Pathname filename = cacheExists()
? _cache_dir + (*it)->location
: provideFile(_path + (*it)->location);
-
+
_metadata_files.push_back((*it)->location);
DBG << "Reading file " << filename << endl;
ifgzstream st ( filename.asString().c_str() );
else
{
ResImplTraits<YUMPackageImpl>::Ptr impl = it->second.impl;
- Package::Ptr package = it->second.package;
- //DBG << "found " << *package << ", impl " << impl << endl;
-
- _store.erase( package );
- impl->unmanage();
-
- // Atoms are inserted in the store after patch creation
- //DBG << "Inserting atom " << *atom << endl;
- //DBG << "with deps " << deps << endl;
- //_store.insert( atom );
-
- // Collect augmented package data
- NVRAD packagedata( nvra, package->deps() );
if (!parsed.location.empty()) {
impl->_location = parsed.location;
- impl->_mediaid = str::strtonum<unsigned>( parsed.media );
+ impl->_mediaNumber = str::strtonum<unsigned>( parsed.media );
impl->_checksum = CheckSum(parsed.checksumType, parsed.checksum);
}
impl->_install_only = parsed.installOnly;
);
impl->_delta_rpms.push_back(delta_rpm);
}
-
- Package::Ptr new_package = detail::makeResolvableFromImpl(
- packagedata, impl
- );
-
- //DBG << "new_package " << *new_package << endl;
-
- _store.insert( new_package );
}
return atom;
}
{
Resolvable::constPtr res( it->resolvable() );
Package::constPtr pkg( asKind<Package>(res) );
- if (pkg && policy_r.restrictToMedia() != pkg->mediaId()) // check medianr for packages only
+ if (pkg && policy_r.restrictToMedia() != pkg->sourceMediaNr()) // check medianr for packages only
{
- XXX << "Package " << *pkg << ", wrong media " << pkg->mediaId() << endl;
+ XXX << "Package " << *pkg << ", wrong media " << pkg->sourceMediaNr() << endl;
result._remaining.push_back( *it );
}
else
{
Resolvable::constPtr res( it->resolvable() );
Package::constPtr pkg( asKind<Package>(res) );
- if (pkg && policy_r.restrictToMedia() != pkg->mediaId()) // check medianr for packages only
+ if (pkg && policy_r.restrictToMedia() != pkg->sourceMediaNr()) // check medianr for packages only
{
- XXX << "Package " << *pkg << ", wrong media " << pkg->mediaId() << endl;
+ XXX << "Package " << *pkg << ", wrong media " << pkg->sourceMediaNr() << endl;
result._srcremaining.push_back( *it );
}
else {
it->status().resetTransact( ResStatus::USER );
}
progress.disconnect();
- p->source().releaseFile( p->location(), p->mediaId() );
+ p->source().releaseFile( p->location(), p->sourceMediaNr() );
}
else
{
other_list.push_back( *cit );
continue;
}
- XXX << "Package " << *cpkg << ", media " << cpkg->mediaId() << " last_medianum " << last_medianum << " best_medianum " << best_medianum << endl;
+ XXX << "Package " << *cpkg << ", media " << cpkg->sourceMediaNr() << " last_medianum " << last_medianum << " best_medianum " << best_medianum << endl;
if ( cpkg->source().numericId() == last_prio &&
- cpkg->mediaId() == last_medianum ) {
+ cpkg->sourceMediaNr() == last_medianum ) {
// prefer packages on current media.
last_list.push_back( *cit );
continue;
if ( cpkg->source().numericId() < best_prio ) {
best_list.clear(); // new best
} else if ( cpkg->source().numericId() == best_prio ) {
- if ( cpkg->mediaId() < best_medianum ) {
+ if ( cpkg->sourceMediaNr() < best_medianum ) {
best_list.clear(); // new best
- } else if ( cpkg->mediaId() == best_medianum ) {
+ } else if ( cpkg->sourceMediaNr() == best_medianum ) {
best_list.push_back( *cit ); // same as best -> add
continue;
} else {
// first package or new best
best_list.push_back( *cit );
best_prio = cpkg->source().numericId();
- best_medianum = cpkg->mediaId();
+ best_medianum = cpkg->sourceMediaNr();
continue;
}
}
{
connect();
}
-
+
~KeyRingSignalReceiver()
{
disconnect();
}
-
+
virtual void trustedKeyAdded( const KeyRing &keyring, const std::string &keyid, const std::string &keyname, const std::string &fingerprint )
{
MIL << "trusted key added to zypp Keyring. Syncronizing keys with rpm keyring" << std::endl;
_rpmdb.importZyppKeyRingTrustedKeys();
_rpmdb.exportTrustedKeysInZyppKeyRing();
}
-
+
virtual void trustedKeyRemoved( const KeyRing &keyring, const std::string &keyid, const std::string &keyname, const std::string &fingerprint )
{
-
+
}
-
+
RpmDb &_rpmdb;
};
-
+
static shared_ptr<KeyRingSignalReceiver> sKeyRingReceiver;
-
+
unsigned diffFiles(const std::string file1, const std::string file2, std::string& out, int maxlines)
{
const char* argv[] =
if(maxlines<0?true:count<maxlines)
out+=line;
}
-
+
return prog.close();
}
// by librpm. On demand it will be reopened readonly and should
// not hold any lock.
librpmDb::dbRelease( true );
-
+
MIL << "Syncronizing keys with zypp keyring" << std::endl;
importZyppKeyRingTrustedKeys();
exportTrustedKeysInZyppKeyRing();
-
+
MIL << "InitDatabase: " << *this << endl;
}
void RpmDb::exportTrustedKeysInZyppKeyRing()
{
MIL << "Exporting rpm keyring into zypp trusted keyring" <<std::endl;
-
+
std::set<Edition> rpm_keys = pubkeyEditions();
-
+
std::list<PublicKey> zypp_keys;
zypp_keys = getZYpp()->keyRing()->trustedPublicKeys();
-
+
for ( std::set<Edition>::const_iterator it = rpm_keys.begin(); it != rpm_keys.end(); ++it)
{
// search the zypp key into the rpm keys
ERR << "Could not dump key " << (*it) << " in tmp file " << file.path() << std::endl;
// just ignore the key
}
-
+
// now import the key in zypp
try
{
ERR << "Could not import key " << (*it) << " in zypp keyring" << std::endl;
}
}
- }
+ }
}
void RpmDb::importZyppKeyRingTrustedKeys()
{
MIL << "Importing zypp trusted keyring" << std::endl;
-
+
std::list<PublicKey> rpm_keys = pubkeys();
-
+
std::list<PublicKey> zypp_keys;
-
+
zypp_keys = getZYpp()->keyRing()->trustedPublicKeys();
-
+
for ( std::list<PublicKey>::const_iterator it = zypp_keys.begin(); it != zypp_keys.end(); ++it)
- {
+ {
// we find only the left part of the long gpg key, as rpm does not support long ids
std::list<PublicKey>::iterator ik = find( rpm_keys.begin(), rpm_keys.end(), (*it));
if ( ik != rpm_keys.end() )
ERR << "Could not dump key " << (*it).id << " (" << (*it).name << ") in tmp file " << file.path() << std::endl;
// just ignore the key
}
-
+
// now import the key in rpm
try
{
continue;
}
Date installtime = iter->tag_installtime();
-#if 0
-This prevented from having packages multiple times
- Package::Ptr & nptr = _packages._index[name]; // be sure to get a reference!
-
- if ( nptr ) {
- WAR << "Multiple entries for package '" << name << "' in rpmdb" << endl;
- if ( nptr->installtime() > installtime )
- continue;
- // else overwrite previous entry
- }
-#endif
Package::Ptr pptr = makePackageFromHeader( *iter, &_filerequires, location, Source_Ref() );
return _packages._list;
}
-#warning Uncomment this function if it is needed
-#if 0
-///////////////////////////////////////////////////////////////////
-//
-//
-// METHOD NAME : RpmDb::traceFileRel
-// METHOD TYPE : void
-//
-// DESCRIPTION :
-//
-void RpmDb::traceFileRel( const PkgRelation & rel_r )
-{
- if ( ! rel_r.isFileRel() )
- return;
-
- if ( ! _filerequires.insert( rel_r.name() ).second )
- return; // already got it in _filerequires
-
- if ( ! _packages._valid )
- return; // collect only. Evaluated in first call to getPackages()
-
- //
- // packages already initialized. Must check and insert here
- //
- librpmDb::db_const_iterator iter;
- if ( iter.dbError() ) {
- ERR << "No database access: " << iter.dbError() << endl;
- return;
- }
-
- for ( iter.findByFile( rel_r.name() ); *iter; ++iter ) {
- Package::Ptr pptr = _packages.lookup( iter->tag_name() );
- if ( !pptr ) {
- WAR << "rpmdb.findByFile returned unpknown package " << *iter << endl;
- continue;
- }
- pptr->addProvides( rel_r.name() );
- }
-}
-#endif
-
///////////////////////////////////////////////////////////////////
//
//
ByteCount RPMPackageImpl::size() const
{ return _size; }
- bool RPMPackageImpl::providesSources() const
- { return ResObjectImplIf::providesSources(); }
-
- Label RPMPackageImpl::instSrcLabel() const
- { return ResObjectImplIf::instSrcLabel(); }
-
- Vendor RPMPackageImpl::instSrcVendor() const
- { return ResObjectImplIf::instSrcVendor(); }
-
/** */
Date RPMPackageImpl::buildtime() const
{ return _buildtime; }
std::list<std::string> RPMPackageImpl::filenames() const
{ return _filenames; }
- License RPMPackageImpl::licenseToConfirm() const
- { return _license_to_confirm; }
-
/** */
std::string RPMPackageImpl::type() const
{ return _type; }
/** */
Source_Ref RPMPackageImpl::source() const
{ return _source; }
-#if 0
- /** */
- unsigned RPMPackageImpl::packageSize() const
- { return _size_package; }
- /** */
- unsigned RPMPackageImpl::archiveSize() const
- { return _size_archive; }
- /** */
- unsigned RPMPackageImpl::installedSize() const
- { return _size_installed; }
-// FIXME do not understand items below
- /** */
- bool RPMPackageImpl::providesSources() const
- {
- return false;
- }
- /** */
- std::string RPMPackageImpl::instSrcLabel() const
- {
- return "";
- }
- /** */
- std::string RPMPackageImpl::instSrcVendor() const
- {
- return "";
- }
- /** */
- unsigned RPMPackageImpl::instSrcRank() const
- {
- return 0;
- }
- /** */
- std::string RPMPackageImpl::buildhost() const
- {
- return _buildhost;
- }
- /** */
- std::string RPMPackageImpl::distribution() const
- {
- return "";
- }
- /** */
- std::string RPMPackageImpl::vendor() const
- {
- return _vendor;
- }
- /** */
- std::string RPMPackageImpl::license() const
- {
- return _license;
- }
- /** */
- std::list<std::string> RPMPackageImpl::licenseToConfirm() const
- {
- return std::list<std::string>();
- }
- /** */
- std::string RPMPackageImpl::packager() const
- {
- return _packager;
- }
- /** */
- std::string RPMPackageImpl::group() const
- {
- return _group;
- }
- /** */
- std::list<std::string> RPMPackageImpl::changelog() const
- {}
- /** */
- std::string RPMPackageImpl::url() const
- {
- return _url;
- }
- /** */
- std::string RPMPackageImpl::os() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::prein() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::postin() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::preun() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::postun() const
- {}
- /** */
- std::string RPMPackageImpl::sourcepkg() const
- { return _sourcepkg; }
- /** */
- std::list<std::string> RPMPackageImpl::authors() const
- { return _authors; }
- /** */
- std::list<std::string> RPMPackageImpl::filenames() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::recommends() const
- {}
- /** */
- std::list<std::string> RPMPackageImpl::suggests() const
- {}
- /** */
- std::string RPMPackageImpl::location() const
- {}
- /** */
- std::string RPMPackageImpl::md5sum() const
- {}
- /** */
- std::string RPMPackageImpl::externalUrl() const
- {}
- /** */
- std::list<Edition> RPMPackageImpl::patchRpmBaseVersions() const
- {}
- /** */
- unsigned RPMPackageImpl::patchRpmSize() const
- {}
- /** */
- bool RPMPackageImpl::forceInstall() const
- {}
- /** */
- std::string RPMPackageImpl::patchRpmMD5() const
- {}
- /** */
- bool RPMPackageImpl::isRemote() const
- {}
- /** */
- bool RPMPackageImpl::prefererCandidate() const
- {}
-
-#endif
} // namespace rpm
/////////////////////////////////////////////////////////////////
virtual TranslatedText summary() const;
/** Package description */
virtual TranslatedText description() const;
+ /** */
virtual ByteCount size() const;
- virtual bool providesSources() const;
- virtual Label instSrcLabel() const;
- virtual Vendor instSrcVendor() const;
/** */
virtual Date buildtime() const;
/** */
/** */
virtual std::list<std::string> filenames() const;
/** */
- virtual License licenseToConfirm() const;
- /** */
virtual std::string type() const;
/** */
virtual std::list<std::string> keywords() const;
Changelog _changelog;
Pathname _location; // for 'local' rpms
std::string _type;
- License _license_to_confirm;
std::list<std::string> _authors;
std::list<std::string>_keywords;
std::list<std::string> _filenames;