- Make basic attributes available through ResObject.
authorMichael Andres <ma@suse.de>
Tue, 16 May 2006 19:52:22 +0000 (19:52 +0000)
committerMichael Andres <ma@suse.de>
Tue, 16 May 2006 19:52:22 +0000 (19:52 +0000)
- Let ResObjects which do not require media access during
  commit return ZERO sourceMediaNr (required for #173690)
- Version 1.0.0

37 files changed:
configure.ac
devel/devel.ma/Parse.cc
package/libzypp.changes
testsuite/solver/src/deptestomatic.cc
testsuite/solver/src/helix/HelixPackageImpl.cc
testsuite/solver/src/helix/HelixPackageImpl.h
zypp/Package.cc
zypp/Package.h
zypp/Product.cc
zypp/Product.h
zypp/ResObject.cc
zypp/ResObject.h
zypp/SrcPackage.cc
zypp/SrcPackage.h
zypp/detail/PackageImplIf.cc
zypp/detail/PackageImplIf.h
zypp/detail/ProductImplIf.cc
zypp/detail/ProductImplIf.h
zypp/detail/ResObjectImplIf.cc
zypp/detail/ResObjectImplIf.h
zypp/detail/SelectionImplIf.h
zypp/detail/SrcPackageImplIf.cc
zypp/detail/SrcPackageImplIf.h
zypp/source/SourceImpl.cc
zypp/source/susetags/PackagesLangParser.cc
zypp/source/susetags/SuseTagsImpl.h
zypp/source/susetags/SuseTagsPackageImpl.cc
zypp/source/susetags/SuseTagsPackageImpl.h
zypp/source/susetags/SuseTagsSrcPackageImpl.cc
zypp/source/susetags/SuseTagsSrcPackageImpl.h
zypp/source/yum/YUMPackageImpl.cc
zypp/source/yum/YUMPackageImpl.h
zypp/source/yum/YUMSourceImpl.cc
zypp/target/TargetImpl.cc
zypp/target/rpm/RpmDb.cc
zypp/target/rpm/RpmPackageImpl.cc
zypp/target/rpm/RpmPackageImpl.h

index 8f34e5a..e26d183 100644 (file)
@@ -1,7 +1,7 @@
 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)
@@ -43,13 +43,10 @@ dnl 6) If any interfaces have been removed since the last public release, then
 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)
 
@@ -298,7 +295,7 @@ Configuration:
 
   PACKAGE:              ${PACKAGE}
   VERSION:              ${VERSION}
-  LIBVERSION:           lib${PACKAGE}.so.${LIBZYPP_VERSION}
+  LIBVERSION:           lib${PACKAGE}.so.$LIBZYPP_CURRENT.$LIBZYPP_AGE.$LIBZYPP_REVISION
 
   FEATURES:             ${ZYPP_FEATURES}
 
index dcaa6b0..5a04d2b 100644 (file)
@@ -127,8 +127,65 @@ using zypp::solver::detail::InstallOrder;
 
 ///////////////////////////////////////////////////////////////////
 
+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;
@@ -153,7 +210,7 @@ namespace zypp
     PoolItemSet _toDelete;
     PoolItemSet _skipToDelete;
   };
-
+#endif
   std::ostream & operator<<( std::ostream & str, const CollectTransacting & obj )
   {
     str << "CollectTransacting:" << endl;
@@ -165,46 +222,7 @@ namespace zypp
                    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 );
+  }
 }
 
 /******************************************************************
@@ -272,6 +290,7 @@ int main( int argc, char * argv[] )
 
 
   INT << "===[END]============================================" << endl << endl;
+  zypp::base::LogControl::instance().logNothing();
   return 0;
 }
 
index 0063213..08e432a 100644 (file)
@@ -1,14 +1,22 @@
 -------------------------------------------------------------------
+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
@@ -30,7 +38,7 @@ Mon May 15 11:15:03 CEST 2006 - kkaempf@suse.de
 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
@@ -93,20 +101,20 @@ Thu May  4 15:15:37 CEST 2006 - kkaempf@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
index fd1b63b..0910217 100644 (file)
  * 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
@@ -123,7 +123,7 @@ printRes ( std::ostream & str, ResObject::constPtr r )
     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() << ':';
@@ -152,7 +152,7 @@ string2kind (const std::string & str)
     Resolvable::Kind kind = ResTraits<zypp::Package>::kind;
     if (!str.empty()) {
        if (str == "package") {
-           // empty 
+           // empty
        }
        else if (str == "patch") {
            kind = ResTraits<zypp::Patch>::kind;
@@ -329,7 +329,7 @@ struct KNEAOrder : public std::binary_function<PoolItem_Ref,PoolItem_Ref,bool>
            return lhs.resolvable() < rhs.resolvable();
        }
 };
-       
+
 typedef std::set<PoolItem_Ref, KNEAOrder> PoolItemOrderSet;
 
 static void
@@ -422,7 +422,7 @@ print_solution (ResolverContext_Ptr context, int *count, ChecksumList & checksum
            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 );
@@ -434,7 +434,7 @@ print_solution (ResolverContext_Ptr context, int *count, ChecksumList & checksum
            order.setInstalled( items );
        }
 #endif
-       
+
        cout << "- - - - - - - - - -" << endl;
     }
 
@@ -786,7 +786,7 @@ parse_xml_setup (XmlNode_Ptr node)
            continue;
        }
        if (node->equals ("forceResolve")) {
-           
+
            forceResolve = true;
        } else if (node->equals ("system")) {
 
@@ -795,12 +795,12 @@ parse_xml_setup (XmlNode_Ptr node)
                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");
@@ -859,7 +859,7 @@ parse_xml_setup (XmlNode_Ptr node)
            PoolItem_Ref poolItem;
 
            poolItem = get_poolItem ("@system", package_name, kind_name);
-           
+
            if (! poolItem) {
                cerr << "Can't force-uninstall installed package '" << package_name << "'" << endl;
            } else {
@@ -940,7 +940,7 @@ report_solutions ( solver::detail::Resolver_Ptr resolver, bool instorder, bool m
     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);
@@ -952,7 +952,7 @@ report_solutions ( solver::detail::Resolver_Ptr resolver, bool instorder, bool m
        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);
            }
        }
@@ -1103,7 +1103,7 @@ freshen_marked_cb (PoolItem_Ref poolItem, const ResStatus & status, void *data)
 {
     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);
     }
 
@@ -1250,7 +1250,7 @@ parse_xml_trial (XmlNode_Ptr node, const ResPool & pool)
            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
@@ -1404,7 +1404,7 @@ parse_xml_trial (XmlNode_Ptr node, const ResPool & pool)
                    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) {
@@ -1425,7 +1425,7 @@ parse_xml_trial (XmlNode_Ptr node, const ResPool & pool)
            RESULT << "Taking solution: " << solutionNr << endl;
            RESULT << "For problem:     " << problemNr << endl;
            ResolverProblemList problems = resolver->problems ();
-           
+
            int problemCounter = -1;
            int solutionCounter = -1;
            // find problem
@@ -1618,9 +1618,9 @@ process_xml_test_file (const string & filename, const ResPool & pool)
     root = new XmlNode (xmlDocGetRootElement (xml_doc));
 
     DBG << "Parsing file '" << filename << "'" << endl;
-    
+
     parse_xml_test (root, pool);
-    
+
     xmlFreeDoc (xml_doc);
 }
 
@@ -1631,7 +1631,7 @@ int
 main (int argc, char *argv[])
 {
 //    setenv("ZYPP_NOLOG","1",1); // no logging
-    
+
     if (argc != 2) {
        cerr << "Usage: deptestomatic testfile.xml" << endl;
        exit (0);
index 28c1490..5bf12e8 100644 (file)
@@ -66,7 +66,7 @@ ByteCount HelixPackageImpl::archivesize() const
 bool HelixPackageImpl::installOnly() const
 { return _install_only; }
 
-unsigned int HelixPackageImpl::mediaId() const
+unsigned int HelixPackageImpl::sourceMediaNr() const
 { return _mediaid; }
 
 
index 9ab8483..c2b1afa 100644 (file)
@@ -46,14 +46,14 @@ public:
        /** */
        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;
index 2161be3..bd452c3 100644 (file)
@@ -47,14 +47,6 @@ namespace zypp
   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(); }
@@ -66,10 +58,6 @@ namespace zypp
   std::string Package::distribution() const
   { return pimpl().distribution(); }
 
-    /** */
-  Vendor Package::vendor() const
-  { return pimpl().vendor(); }
-
   /** */
   Label Package::license() const
   { return pimpl().license(); }
@@ -112,10 +100,6 @@ namespace zypp
   ByteCount Package::sourcesize() const
   { return pimpl().sourcesize(); }
 
-  /** */
-  ByteCount Package::archivesize() const
-  { return pimpl().archivesize(); }
-
   DiskUsage Package::diskusage() const
   { return pimpl().diskusage(); }
 
@@ -127,16 +111,6 @@ namespace zypp
   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(); }
 
index 72ef0bb..b3b5aad 100644 (file)
@@ -42,19 +42,13 @@ namespace zypp
      * 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;
@@ -76,8 +70,6 @@ namespace zypp
     /** */
     ByteCount sourcesize() const;
     /** */
-    ByteCount archivesize() const;
-    /** */
     std::list<std::string> authors() const;
     /** */
     std::list<std::string> filenames() const;
@@ -85,19 +77,9 @@ namespace zypp
     /** 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 */
index cb9bc68..f4d8e90 100644 (file)
@@ -20,7 +20,7 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   IMPL_PTR_TYPE(Product);
-  
+
   ///////////////////////////////////////////////////////////////////
   //
   //   METHOD NAME : Product::Product
@@ -60,10 +60,6 @@ namespace zypp
   { return pimpl().flags(); }
 
   /** */
-  License Product::licenseToConfirm() const
-  { return pimpl().licenseToConfirm(); }
-
-  /** */
   Label Product::shortName() const
   { return pimpl().shortName().text(); }
 
index 6d23c8a..8f06acd 100644 (file)
@@ -23,7 +23,7 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   DEFINE_PTR_TYPE(Product);
-  
+
   ///////////////////////////////////////////////////////////////////
   //
   //   CLASS NAME : ResObject
@@ -57,9 +57,6 @@ namespace zypp
     std::list<std::string> flags() const;
 
     /** */
-    License licenseToConfirm() const;
-
-    /** */
     Label shortName() const;
 
     /** */
index 5b7c962..0f374b2 100644 (file)
@@ -55,12 +55,33 @@ namespace zypp
   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(); }
 
index c36115b..e8b2c12 100644 (file)
@@ -12,6 +12,8 @@
 #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"
@@ -56,11 +58,35 @@ namespace zypp
     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;
 
index acd945d..0ce93b9 100644 (file)
@@ -20,7 +20,7 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   IMPL_PTR_TYPE(SrcPackage);
-    
+
   ///////////////////////////////////////////////////////////////////
   //
   //   METHOD NAME : SrcPackage::SrcPackage
@@ -50,9 +50,6 @@ namespace zypp
   DiskUsage SrcPackage::diskusage() const
   { return pimpl().diskusage(); }
 
-  unsigned SrcPackage::mediaId() const
-  { return pimpl().mediaId(); }
-
   Pathname SrcPackage::location() const
   { return pimpl().location(); }
 
index b7f3575..099898c 100644 (file)
@@ -29,7 +29,7 @@ namespace zypp
   */
   class SrcPackage : public ResObject
   {
-    
+
   public:
     typedef detail::SrcPackageImplIf    Impl;
     typedef SrcPackage                  Self;
@@ -42,8 +42,6 @@ namespace zypp
     ByteCount archivesize() const;
     /** Disk usage per directory */
     DiskUsage diskusage() const;
-    /** ID of the media */
-    unsigned mediaId() const;
     /** location in source */
     Pathname location() const;
 
index 09bbbab..63d723c 100644 (file)
@@ -26,24 +26,15 @@ namespace zypp
     // 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(); }
 
@@ -80,11 +71,8 @@ namespace zypp
       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>(); }
@@ -92,21 +80,12 @@ namespace zypp
       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
   ///////////////////////////////////////////////////////////////////
index d308778..4218d1a 100644 (file)
@@ -44,40 +44,16 @@ namespace zypp
     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;
@@ -103,8 +79,6 @@ namespace zypp
       /** */
       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;
@@ -114,54 +88,9 @@ namespace zypp
       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
-      //@}
     };
     ///////////////////////////////////////////////////////////////////
 
index 5d0adf8..6cb2d71 100644 (file)
@@ -21,12 +21,12 @@ namespace zypp
   { /////////////////////////////////////////////////////////////////
 
       /** 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(); }
@@ -36,9 +36,6 @@ namespace zypp
 
       std::list<std::string> ProductImplIf::flags() const
       { return std::list<std::string>(); }
-      
-      License ProductImplIf::licenseToConfirm() const
-      { return License(); }
 
       TranslatedText ProductImplIf::shortName() const
       { return TranslatedText(); }
index 34e862b..7f5e997 100644 (file)
@@ -54,8 +54,6 @@ namespace zypp
       /** The product flags */
       virtual std::list<std::string> flags() const PURE_VIRTUAL;
 
-      virtual License licenseToConfirm() const PURE_VIRTUAL;
-
       virtual TranslatedText shortName() const PURE_VIRTUAL;
     };
     ///////////////////////////////////////////////////////////////////
index 801ff2f..f2a1489 100644 (file)
@@ -37,23 +37,35 @@ namespace zypp
       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
index a0506e6..6c70354 100644 (file)
@@ -56,13 +56,6 @@ namespace zypp
       /** \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. */
@@ -77,30 +70,40 @@ namespace zypp
       /** \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()
@@ -109,20 +112,14 @@ namespace zypp
       /** 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. */
index 79f28df..ffe5515 100644 (file)
@@ -47,24 +47,8 @@ namespace zypp
         /** */
        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
     };
     ///////////////////////////////////////////////////////////////////
 
index 25f4719..2878511 100644 (file)
@@ -30,14 +30,11 @@ namespace zypp
       { return ByteCount(); }
 
       DiskUsage SrcPackageImplIf::diskusage() const
-      { return DiskUsage(); }      
+      { return DiskUsage(); }
 
       Pathname SrcPackageImplIf::location() const
       { return Pathname(); }
 
-      unsigned SrcPackageImplIf::mediaId() const
-      { return 1; }
-
     /////////////////////////////////////////////////////////////////
   } // namespace detail
   ///////////////////////////////////////////////////////////////////
index d0e4d74..98580b3 100644 (file)
@@ -46,9 +46,6 @@ namespace zypp
       virtual DiskUsage diskusage() const PURE_VIRTUAL;
       /** */
       virtual Pathname location() const PURE_VIRTUAL;
-      /** */
-      virtual unsigned mediaId() const PURE_VIRTUAL;
-
     };
     ///////////////////////////////////////////////////////////////////
 
index 3bbac8e..f7b419d 100644 (file)
@@ -47,11 +47,11 @@ namespace zypp
        : _report (report_r)
        , _resolvable (resolvable_r)
        {}
-       
-       virtual ~DownloadProgressPackageReceiver () {} 
-       
+
+       virtual ~DownloadProgressPackageReceiver () {}
+
        virtual void reportbegin() {}
-       
+
        virtual void reportend() {}
 
         /**
@@ -77,11 +77,11 @@ namespace zypp
        )
        : _report (report_r)
        {}
-       
-       virtual ~DownloadProgressFileReceiver () {} 
-       
+
+       virtual ~DownloadProgressFileReceiver () {}
+
        virtual void reportbegin() {}
-       
+
        virtual void reportend() {}
 
         /**
@@ -200,23 +200,23 @@ namespace zypp
       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();
@@ -225,19 +225,19 @@ namespace zypp
         {
           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() + ")"));
@@ -250,37 +250,37 @@ namespace zypp
       }
       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,
@@ -327,9 +327,9 @@ namespace zypp
                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 )  ||
@@ -346,7 +346,7 @@ namespace zypp
              report->requestMedia (
                source_factory.createFrom( this ),
                media_nr,
-               reason, 
+               reason,
                excp.asUserString()
              );
 
@@ -446,7 +446,7 @@ namespace zypp
             }
             // 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;
@@ -456,9 +456,9 @@ namespace zypp
               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;
@@ -483,16 +483,16 @@ namespace zypp
             {
               // 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 );
@@ -554,7 +554,7 @@ namespace zypp
     {
        // 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 )
index f538b31..2addbb6 100644 (file)
@@ -39,20 +39,20 @@ namespace zypp
         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();
@@ -78,7 +78,7 @@ namespace zypp
                _current = NULL;
                return;
            }
-            
+
             PkgContent::const_iterator it = _content.find(NVRAD(_nvra));
            if (it == _content.end())
             {
@@ -120,12 +120,9 @@ namespace zypp
               _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);
+            }
         }
       };
 
index b38f924..e024ba2 100644 (file)
@@ -37,15 +37,15 @@ namespace zypp
         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
@@ -71,7 +71,7 @@ namespace zypp
 
        /** 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(); }
 
@@ -81,15 +81,15 @@ namespace zypp
          */
        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
          */
@@ -106,43 +106,43 @@ namespace zypp
          * \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;
         /**
@@ -150,14 +150,14 @@ namespace zypp
          * 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;
       };
index 2e38734..8f47104 100644 (file)
@@ -25,14 +25,15 @@ namespace zypp
     { /////////////////////////////////////////////////////////////////
 
       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 )
       {}
 
       ///////////////////////////////////////////////////////////////////
@@ -43,21 +44,18 @@ namespace zypp
       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;
       }
 
@@ -66,6 +64,20 @@ namespace zypp
         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; }
 
@@ -135,11 +147,6 @@ namespace zypp
       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>(); }
 
@@ -149,12 +156,6 @@ namespace zypp
       bool SuseTagsPackageImpl::installOnly() const
       { return false; }
 
-      Source_Ref SuseTagsPackageImpl::source() const
-      { return _source; }
-
-      unsigned SuseTagsPackageImpl::mediaId() const
-      { return _media_number; }
-
       /////////////////////////////////////////////////////////////////
     } // namespace susetags
     ///////////////////////////////////////////////////////////////////
index 76d8ac0..3399cb7 100644 (file)
@@ -25,9 +25,9 @@ namespace zypp
   { /////////////////////////////////////////////////////////////////
     namespace susetags
     { /////////////////////////////////////////////////////////////////
-      
+
       DEFINE_PTR_TYPE(SuseTagsImpl);
-      
+
       ///////////////////////////////////////////////////////////////////
       //
       //       CLASS NAME : PackageImpl
@@ -39,12 +39,16 @@ namespace zypp
         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;
         /** */
@@ -99,44 +103,27 @@ namespace zypp
         /** */
         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
-
-*/
-
       };
       ///////////////////////////////////////////////////////////////////
       /////////////////////////////////////////////////////////////////
index 080b73d..09d56c4 100644 (file)
@@ -21,16 +21,17 @@ namespace zypp
   { /////////////////////////////////////////////////////////////////
     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
@@ -52,14 +53,14 @@ namespace zypp
       Source_Ref SuseTagsSrcPackageImpl::source() const
       { return _source; }
 
-      unsigned SuseTagsSrcPackageImpl::mediaId() const
+      unsigned SuseTagsSrcPackageImpl::sourceMediaNr() const
       { return _media_number; }
 
       /////////////////////////////////////////////////////////////////
     } // namespace susetags
     ///////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////
-  } // namespace 
+  } // namespace
   ///////////////////////////////////////////////////////////////////
 
   /////////////////////////////////////////////////////////////////
index 8aa20c3..9fa7a01 100644 (file)
@@ -24,7 +24,7 @@ namespace zypp
   { /////////////////////////////////////////////////////////////////
     namespace susetags
     { /////////////////////////////////////////////////////////////////
-  
+
       ///////////////////////////////////////////////////////////////////
       //
       //       CLASS NAME : SrcPackageImpl
@@ -36,8 +36,6 @@ namespace zypp
         SuseTagsSrcPackageImpl(Source_Ref source_r);
         virtual ~SuseTagsSrcPackageImpl();
 
-        /** \name Rpm Package Attributes. */
-        //@{
         /** */
         virtual Pathname location() const;
         /** */
@@ -45,26 +43,16 @@ namespace zypp
         /** */
         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
-
-*/
-
       };
       ///////////////////////////////////////////////////////////////////
       /////////////////////////////////////////////////////////////////
index 539e463..88eb030 100644 (file)
@@ -41,7 +41,8 @@ namespace zypp
        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),
@@ -51,10 +52,9 @@ namespace zypp
        _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(),
@@ -72,8 +72,6 @@ namespace zypp
        _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++)
@@ -96,7 +94,8 @@ namespace zypp
        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),
@@ -106,10 +105,9 @@ namespace zypp
        _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(),
@@ -127,8 +125,6 @@ namespace zypp
        _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++)
@@ -203,6 +199,11 @@ namespace zypp
       TranslatedText YUMPackageImpl::description() const
       { return _description; }
 
+      /** */
+      TranslatedText YUMPackageImpl::licenseToConfirm() const
+      { return _license_to_confirm; }
+
+      /** */
       ByteCount YUMPackageImpl::size() const
 #warning fixme
       { return 0; }
@@ -296,9 +297,6 @@ namespace zypp
       std::list<std::string> YUMPackageImpl::filenames() const
       { return _filenames; }
 
-      License YUMPackageImpl::licenseToConfirm() const
-      { return _license_to_confirm; }
-
       /** */
       std::string YUMPackageImpl::type() const
       { return _type; }
@@ -310,8 +308,8 @@ namespace zypp
       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; }
@@ -325,134 +323,6 @@ namespace zypp
       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
index 18ac92b..f4196a5 100644 (file)
@@ -55,6 +55,9 @@ namespace zypp
        virtual TranslatedText summary() const;
        /** Package description */
        virtual TranslatedText description() const;
+        /** */
+        virtual TranslatedText licenseToConfirm() const;
+       /** */
        virtual ByteCount size() const;
        /** */
        virtual Date buildtime() const;
@@ -98,15 +101,13 @@ namespace zypp
        /** */
        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;
         /** */
@@ -114,77 +115,10 @@ namespace zypp
         /** */
        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;
@@ -194,10 +128,9 @@ namespace zypp
        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;
index c003859..ad509f6 100644 (file)
@@ -77,12 +77,12 @@ namespace zypp
       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);
@@ -94,46 +94,46 @@ namespace zypp
           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() )
         {
@@ -152,23 +152,23 @@ namespace zypp
         {
           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")
@@ -182,9 +182,9 @@ namespace zypp
             {
               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;
@@ -199,11 +199,11 @@ namespace zypp
                   ZYPP_THROW(Exception( (*patch)->location + " " + N_("fails checksum verification.") ));
                 }
               }
-            }  
+            }
           }
         }
       }
-      
+
       void YUMSourceImpl::storeMetadata(const Pathname & cache_dir_r)
       {
        _cache_dir = cache_dir_r;
@@ -229,7 +229,7 @@ namespace zypp
         // 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() )
         {
@@ -242,8 +242,8 @@ namespace zypp
           }
         }
         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);
 
@@ -257,7 +257,7 @@ namespace zypp
        // re-read all data
 
        _repomd_file = remote_repomd;
-               
+
         // provide optional files
         Pathname remote_repomd_key;
         Pathname remote_repomd_signature;
@@ -278,18 +278,18 @@ namespace zypp
 
         // 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)
@@ -298,7 +298,7 @@ namespace zypp
                continue;
 
            Pathname src = provideFile(_path + (*repomd)->location);
-           
+
             dst = cache_dir_r + (*repomd)->location;
            filesystem::copy(src, dst);
            if ((*repomd)->type == "patches")
@@ -345,7 +345,7 @@ namespace zypp
           ? _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, "");
@@ -354,7 +354,7 @@ namespace zypp
              ++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")
@@ -464,7 +464,7 @@ namespace zypp
           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() );
@@ -525,7 +525,7 @@ namespace zypp
           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() );
@@ -559,7 +559,7 @@ namespace zypp
           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() );
@@ -593,7 +593,7 @@ namespace zypp
           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() );
@@ -627,7 +627,7 @@ namespace zypp
             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() );
@@ -774,23 +774,10 @@ namespace zypp
         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;
@@ -842,14 +829,6 @@ namespace zypp
            );
            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;
     }
index 384afed..b606e63 100644 (file)
@@ -175,9 +175,9 @@ namespace zypp
         {
           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
@@ -192,9 +192,9 @@ namespace zypp
         {
           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 {
@@ -321,7 +321,7 @@ namespace zypp
              it->status().resetTransact( ResStatus::USER );
             }
             progress.disconnect();
-           p->source().releaseFile( p->location(), p->mediaId() );
+           p->source().releaseFile( p->location(), p->sourceMediaNr() );
           }
           else
           {
@@ -737,9 +737,9 @@ MIL << "order.computeNextSet: " << items.size() << " resolvables" << endl;
            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;
@@ -753,9 +753,9 @@ MIL << "order.computeNextSet: " << items.size() << " resolvables" << endl;
            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 {
@@ -771,7 +771,7 @@ MIL << "order.computeNextSet: " << items.size() << " resolvables" << endl;
            // first package or new best
            best_list.push_back( *cit );
            best_prio     = cpkg->source().numericId();
-           best_medianum = cpkg->mediaId();
+           best_medianum = cpkg->sourceMediaNr();
            continue;
          }
        }
index b2b4894..5f6f8c0 100644 (file)
@@ -59,29 +59,29 @@ namespace zypp {
         {
           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[] =
@@ -106,7 +106,7 @@ unsigned diffFiles(const std::string file1, const std::string file2, std::string
        if(maxlines<0?true:count<maxlines)
            out+=line;
     }
-    
+
     return prog.close();
 }
 
@@ -477,11 +477,11 @@ void RpmDb::initDatabase( Pathname root_r, Pathname dbPath_r )
   // 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;
 }
 
@@ -858,12 +858,12 @@ void RpmDb::doRebuildDatabase(callback::SendReport<RebuildDBReport> & report)
 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
@@ -896,7 +896,7 @@ void RpmDb::exportTrustedKeysInZyppKeyRing()
         ERR << "Could not dump key " << (*it) << " in tmp file " << file.path() << std::endl;
         // just ignore the key
       }
-      
+
       // now import the key in zypp
       try
       {
@@ -908,21 +908,21 @@ void RpmDb::exportTrustedKeysInZyppKeyRing()
         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() )
@@ -948,7 +948,7 @@ void RpmDb::importZyppKeyRingTrustedKeys()
         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
       {
@@ -1242,17 +1242,6 @@ const std::list<Package::Ptr> & RpmDb::doGetPackages(callback::SendReport<ScanDB
       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() );
 
@@ -1283,47 +1272,6 @@ This prevented from having packages multiple times
   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
-
 ///////////////////////////////////////////////////////////////////
 //
 //
index cff6d93..7ede180 100644 (file)
@@ -77,15 +77,6 @@ namespace zypp
       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; }
@@ -174,9 +165,6 @@ namespace zypp
       std::list<std::string> RPMPackageImpl::filenames() const
       { return _filenames; }
 
-      License RPMPackageImpl::licenseToConfirm() const
-      { return _license_to_confirm; }
-
       /** */
       std::string RPMPackageImpl::type() const
       { return _type; }
@@ -192,139 +180,6 @@ namespace zypp
       /** */
       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
     /////////////////////////////////////////////////////////////////
index 116d83c..0a1a6d9 100644 (file)
@@ -45,10 +45,8 @@ namespace zypp
        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;
        /** */
@@ -91,8 +89,6 @@ namespace zypp
        /** */
        virtual std::list<std::string> filenames() const;
         /** */
-        virtual License licenseToConfirm() const;
-        /** */
         virtual std::string type() const;
         /** */
         virtual std::list<std::string> keywords() const;
@@ -118,7 +114,6 @@ namespace zypp
        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;