- remove patch rpms
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Tue, 23 Sep 2008 11:52:38 +0000 (11:52 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Tue, 23 Sep 2008 11:52:38 +0000 (11:52 +0000)
zypp/repo/DeltaCandidates.cc
zypp/repo/DeltaCandidates.h
zypp/repo/PackageDelta.cc
zypp/repo/PackageDelta.h
zypp/repo/PackageProvider.cc
zypp/repo/PackageProvider.h

index 617e4a4..73702f6 100644 (file)
@@ -63,34 +63,6 @@ namespace zypp
     DeltaCandidates::~DeltaCandidates()
     {}
 
-    std::list<PatchRpm> DeltaCandidates::patchRpms(const Package::constPtr & package ) const
-    {
-      std::list<PatchRpm> candidates;
-
-      // query all repos
-      for ( std::list<Repository>::const_iterator it = _pimpl->repos.begin();
-            it != _pimpl->repos.end();
-            ++it )
-      {
-        // all delta in repo
-       #warning patchRpms are not implemented
-       std::list<PatchRpm> candidates_in_repo; // = (*it).patchRpms();
-        for ( std::list<PatchRpm>::const_iterator dit = candidates_in_repo.begin();
-              dit != candidates_in_repo.end();
-              ++dit )
-        {
-          if ( ! package
-               || (    package->name()    == dit->name()
-                    && package->edition() == dit->edition()
-                    && package->arch()    == dit->arch() ) )
-          {
-            candidates.push_back( *dit );
-          }
-        }
-      }
-      return candidates;
-    }
-
     std::list<DeltaRpm> DeltaCandidates::deltaRpms(const Package::constPtr & package) const
     {
       std::list<DeltaRpm> candidates;
index 70bb086..a843e5b 100644 (file)
@@ -51,8 +51,6 @@ namespace zypp
       /** Dtor */
       ~DeltaCandidates();
 
-
-      std::list<packagedelta::PatchRpm> patchRpms(const Package::constPtr & package) const;
       std::list<packagedelta::DeltaRpm> deltaRpms(const Package::constPtr & package) const;
 
     private:
index cb7cf8a..71dbf14 100644 (file)
@@ -31,17 +31,6 @@ namespace zypp
   { /////////////////////////////////////////////////////////////////
 
 
-    std::ostream & operator<<( std::ostream & str, const PatchRpm & obj )
-    {
-      str
-      << "PatchRpm[" << obj.name() << "-" << obj.edition() << "." << obj.arch()
-      << "](" << obj.location()
-      << '|' << obj.buildtime()
-      << '|';
-      return dumpRangeLine( str, obj.baseversions().begin(), obj.baseversions().end() )
-      << ')';
-    }
-
     DeltaRpm::DeltaRpm(const Repository & repo, sat::detail::IdType extraid)
       : _repo(repo)
     {
index 4a7985d..3313d40 100644 (file)
@@ -30,52 +30,6 @@ namespace zypp
   namespace packagedelta
   { /////////////////////////////////////////////////////////////////
 
-    ///////////////////////////////////////////////////////////////////
-
-    /** \todo cheap copy! (switch to RWCOW) */
-    class PatchRpm
-    {
-    public:
-      typedef Edition                BaseVersion;
-      typedef std::list<BaseVersion> BaseVersions;
-
-    public:
-      PatchRpm()
-      {}
-
-    public:
-      /** \name Target package ident. */
-      //@{
-      const std::string &     name()         const { return _name; }
-      const Edition &         edition()      const { return _edition; }
-      const Arch &            arch()         const { return _arch; }
-      //@}
-      const OnMediaLocation & location()     const { return _location; }
-      const BaseVersions &    baseversions() const { return _baseversions; }
-      const Date &            buildtime()    const { return _buildtime;}
-
-    public:
-      PatchRpm & setName( const std::string & val_r )         { _name = val_r; return *this; }
-      PatchRpm & setEdition( const Edition & val_r )          { _edition = val_r; return *this; }
-      PatchRpm & setArch( const Arch & val_r )                { _arch = val_r; return *this; }
-      PatchRpm & setLocation( const OnMediaLocation & val_r ) { _location = val_r; return *this; }
-      PatchRpm & setBaseversions( const BaseVersions & val_r ){ _baseversions = val_r; return *this; }
-      PatchRpm & addBaseversion( const BaseVersion & val_r )  { _baseversions.push_back( val_r ); return *this; }
-      PatchRpm & setBuildtime( const Date & val_r )           { _buildtime = val_r; return *this; }
-
-    private:
-      std::string     _name;
-      Edition         _edition;
-      Arch            _arch;
-      OnMediaLocation _location;
-      BaseVersions    _baseversions;
-      Date            _buildtime;
-    };
-
-    /** \relates PatchRpm Stream output. */
-    std::ostream & operator<<( std::ostream & str, const PatchRpm & obj );
-
-    ///////////////////////////////////////////////////////////////////
 
     /** \todo cheap copy! (switch to RWCOW) */
     class DeltaRpm
index 41c2493..a0d0159 100644 (file)
@@ -136,16 +136,7 @@ namespace zypp
             _deltas.deltaRpms( _package ).swap( deltaRpms );
           }
 
-          std::list<PatchRpm> patchRpms;
-#warning cleanup patchrpm
-#if 0
-          if ( ZConfig::instance().download_use_patchrpm() )
-          {
-            _deltas.patchRpms( _package ).swap( patchRpms );
-          }
-#endif
-
-          if ( ! ( deltaRpms.empty() && patchRpms.empty() )
+          if ( ! ( deltaRpms.empty() )
                && queryInstalled() )
             {
               if ( ! deltaRpms.empty() && applydeltarpm::haveApplydeltarpm() )
@@ -159,42 +150,6 @@ namespace zypp
                         return ret;
                     }
                 }
-
-              if ( ! patchRpms.empty() )
-                {
-                  for( std::list<PatchRpm>::const_iterator it = patchRpms.begin();
-                       it != patchRpms.end(); ++it )
-                    {
-                      DBG << "tryPatch " << *it << endl;
-                      ManagedFile ret( tryPatch( *it ) );
-                      if ( ! ret->empty() )
-                        return ret;
-                    }
-                }
-            }
-        }
-      else
-        {
-          // allow patch rpm from local source
-          std::list<PatchRpm> patchRpms;
-#warning cleanup patchrpm
-#if 0
-          if ( ZConfig::instance().download_use_patchrpm() )
-          {
-            _deltas.patchRpms( _package ).swap( patchRpms );
-          }
-#endif
-
-          if ( ! patchRpms.empty() && queryInstalled() )
-            {
-              for( std::list<PatchRpm>::const_iterator it = patchRpms.begin();
-                   it != patchRpms.end(); ++it )
-                {
-                  DBG << "tryPatch " << *it << endl;
-                  ManagedFile ret( tryPatch( *it ) );
-                  if ( ! ret->empty() )
-                    return ret;
-                }
             }
         }
 
@@ -258,35 +213,6 @@ namespace zypp
       return ManagedFile( destination, filesystem::unlink );
     }
 
-    ManagedFile PackageProvider::tryPatch( const PatchRpm & patch_r ) const
-    {
-      // installed edition is in baseversions?
-      const PatchRpm::BaseVersions & baseversions( patch_r.baseversions() );
-
-      if ( std::find_if( baseversions.begin(), baseversions.end(),
-                         bind( &PackageProvider::queryInstalled, this, _1 ) )
-           == baseversions.end() )
-        return ManagedFile();
-
-      report()->startPatchDownload( patch_r.location().filename(),
-                                    patch_r.location().downloadSize() );
-      ManagedFile patch;
-      try
-        {
-          ProvideFilePolicy policy;
-          policy.progressCB( bind( &PackageProvider::progressPatchDownload, this, _1 ) );
-          patch = _access.provideFile( _package->repoInfo(), patch_r.location(), policy );
-        }
-      catch ( const Exception & excpt )
-        {
-          report()->problemPatchDownload( excpt.asUserString() );
-          return ManagedFile();
-        }
-      report()->finishPatchDownload();
-
-      return patch;
-    }
-
     PackageProvider::ScopedGuard PackageProvider::newReport() const
     {
       _report.reset( new Report );
@@ -306,9 +232,6 @@ namespace zypp
     void PackageProvider::progressDeltaApply( int value ) const
     { return report()->progressDeltaApply( value ); }
 
-    bool PackageProvider::progressPatchDownload( int value ) const
-    { return report()->progressPatchDownload( value ); }
-
     bool PackageProvider::progressPackageDownload( int value ) const
     { return report()->progress( value, _package ); }
 
index 7502a23..2931e2e 100644 (file)
@@ -59,7 +59,7 @@ namespace zypp
     // CLASS NAME : PackageProvider
     //
     /** Provide a package from a Source.
-     * Use available delta/patch-rpm if apropriate.
+     * Use available deltarpm if apropriate.
     */
     class PackageProvider : private base::NonCopyable
     {
@@ -67,8 +67,6 @@ namespace zypp
       typedef callback::SendReport<repo::DownloadResolvableReport> Report;
 
       typedef packagedelta::DeltaRpm                         DeltaRpm;
-      typedef packagedelta::PatchRpm                         PatchRpm;
-
 
     public:
       /** Ctor taking the Package to provide. */
@@ -87,14 +85,12 @@ namespace zypp
     private:
       ManagedFile doProvidePackage() const;
       ManagedFile tryDelta( const DeltaRpm & delta_r ) const;
-      ManagedFile tryPatch( const PatchRpm & patch_r ) const;
 
     private:
       ScopedGuard newReport() const;
       Report & report() const;
       bool progressDeltaDownload( int value ) const;
       void progressDeltaApply( int value ) const;
-      bool progressPatchDownload( int value ) const;
       bool progressPackageDownload( int value ) const;
       bool failOnChecksumError() const;
       bool queryInstalled( const Edition & ed_r = Edition() ) const;