Imported Upstream version 14.30.2 17/94617/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:30:52 +0000 (10:30 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:30:53 +0000 (10:30 +0900)
Change-Id: Iac82ab41da78a600cc601e03e4785ec75c4bb234
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
12 files changed:
VERSION.cmake
libzypp.spec.cmake
package/libzypp.changes
po/zypp-po.tar.bz2
zypp/Package.cc
zypp/repo/Downloader.cc
zypp/repo/Downloader.h
zypp/repo/susetags/Downloader.cc
zypp/repo/yum/Downloader.cc
zypp/sat/detail/PoolImpl.cc
zypp/target/TargetCallbackReceiver.cc
zypp/target/rpm/RpmDb.cc

index 52455af..2fc4a63 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "14")
 SET(LIBZYPP_COMPATMINOR "30")
 SET(LIBZYPP_MINOR "30")
-SET(LIBZYPP_PATCH "1")
+SET(LIBZYPP_PATCH "2")
 #
-# LAST RELEASED: 14.30.1 (30)
+# LAST RELEASED: 14.30.2 (30)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index ec29e41..23cecf7 100644 (file)
@@ -75,7 +75,7 @@ BuildRequires:  pkgconfig
 BuildRequires:  pkg-config
 %endif
 
-BuildRequires:  libsolv-devel >= 0.6.5
+BuildRequires:  libsolv-devel >= 0.6.6
 %if 0%{?suse_version} >= 1100
 BuildRequires:  libsolv-tools
 %requires_eq    libsolv-tools
index 0b2e2f5..9943ef2 100644 (file)
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Tue Nov 11 17:09:28 CET 2014 - ma@suse.de
+
+- Call rpm with '--noglob' (bnc#892431)
+- Downloader: unify workflow downloading a (signed) master index file
+- Fix iostream includes (fixes #34)
+- Explicitly call libsolv:pool_setdisttype (fixes #36)
+- version 14.30.2 (30)
+
+-------------------------------------------------------------------
+Sun Nov  9 01:13:17 CET 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Nov  2 01:14:10 CET 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
 Mon Oct 27 11:38:00 CET 2014 - ma@suse.de
 
 - doc: add hint to code 12 pattern packages
index 0a89111..09d02d2 100644 (file)
Binary files a/po/zypp-po.tar.bz2 and b/po/zypp-po.tar.bz2 differ
index ecac7c9..db58620 100644 (file)
@@ -9,6 +9,7 @@
 /** \file      zypp/Package.cc
  *
 */
+#include <iostream>
 #include <fstream>
 
 #include "zypp/base/Logger.h"
index 319e86d..2bf752c 100644 (file)
 #include <fstream>
 #include "zypp/base/String.h"
 #include "zypp/base/Logger.h"
-#include "zypp/base/Function.h"
-
-#include "zypp/Date.h"
+#include "zypp/base/Gettext.h"
 
 #include "Downloader.h"
-#include "zypp/repo/MediaInfoDownloader.h"
-#include "zypp/base/UserRequestException.h"
+#include "zypp/KeyContext.h"
+#include "zypp/ZYppCallbacks.h"
 
 using namespace std;
 
@@ -29,7 +27,7 @@ Downloader::Downloader()
 {
 }
 Downloader::Downloader(const RepoInfo & repoinfo) : _repoinfo(repoinfo)
-{  
+{
 }
 Downloader::~Downloader()
 {
@@ -48,6 +46,46 @@ void Downloader::download( MediaSetAccess &media,
   WAR << "Non implemented" << endl;
 }
 
+void Downloader::defaultDownloadMasterIndex( MediaSetAccess & media_r, const Pathname & destdir_r, const Pathname & masterIndex_r )
+{
+  Pathname sigpath = masterIndex_r.extend( ".asc" );
+  Pathname keypath = masterIndex_r.extend( ".key" );
+
+  SignatureFileChecker sigchecker;
+
+  enqueue( OnMediaLocation( sigpath, 1 ).setOptional( true ) );
+  start( destdir_r, media_r );
+  reset();
+
+  // only add the signature if it exists
+  if ( PathInfo(destdir_r / sigpath).isExist() )
+    sigchecker = SignatureFileChecker( destdir_r / sigpath );
+
+  enqueue( OnMediaLocation( keypath, 1 ).setOptional( true ) );
+  start( destdir_r, media_r );
+  reset();
+
+  KeyContext context;
+  context.setRepoInfo( repoInfo() );
+  // only add the key if it exists
+  if ( PathInfo(destdir_r / keypath).isExist() )
+    sigchecker.addPublicKey( destdir_r / keypath, context );
+  else
+    // set the checker context even if the key is not known (unsigned repo, key
+    // file missing; bnc #495977)
+    sigchecker.setKeyContext( context );
+
+  if ( ! repoInfo().gpgCheck() )
+  {
+    WAR << "Signature checking disabled in config of repository " << repoInfo().alias() << endl;
+  }
+  enqueue( OnMediaLocation( masterIndex_r, 1 ),
+          repoInfo().gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) );
+  start( destdir_r, media_r );
+  reset();
+}
+
+
 }// ns repo
 } // ns zypp
 
index ff4cf07..64c6a41 100644 (file)
@@ -25,7 +25,7 @@ namespace zypp
     /**
       * \short Downloader base class
       *
-      * a Downloader encapsulates all the knowledge of 
+      * a Downloader encapsulates all the knowledge of
       * which files have to be downloaded to the local disk.
       *
       */
@@ -57,6 +57,10 @@ namespace zypp
 
       const RepoInfo & repoInfo() const { return _repoinfo; }
 
+      protected:
+       /** Common workflow downloading a (signed) master index file */
+       void defaultDownloadMasterIndex( MediaSetAccess & media_r, const Pathname & destdir_r, const Pathname & masterIndex_r );
+
       private:
         RepoInfo _repoinfo;
     };
index 9652a3e..c6b1c58 100644 (file)
@@ -3,6 +3,7 @@
 #include <fstream>
 
 #include "zypp/base/LogTools.h"
+#include "zypp/base/Gettext.h"
 #include "zypp/base/String.h"
 #include "zypp/base/Regex.h"
 #include "zypp/OnMediaLocation.h"
@@ -15,7 +16,6 @@
 #include "zypp/parser/ParseException.h"
 #include "zypp/parser/susetags/RepoIndex.h"
 #include "zypp/base/UserRequestException.h"
-#include "zypp/KeyContext.h" // for SignatureFileChecker
 
 using namespace std;
 using namespace zypp::parser;
@@ -52,54 +52,20 @@ static Pathname search_deltafile( const Pathname &dir, const Pathname &file )
   return Pathname();
 }
 
+
+/** \todo: Downloading/sigcheck of master index shoudl be common in base class */
 void Downloader::download( MediaSetAccess &media,
                            const Pathname &dest_dir,
                            const ProgressData::ReceiverFnc & progress )
 {
   downloadMediaInfo( dest_dir, media );
 
-  SignatureFileChecker sigchecker/*(repoInfo().name())*/;
-
-  Pathname sig = repoInfo().path() + "/content.asc";
-
-  enqueue( OnMediaLocation( sig, 1 ).setOptional(true) );
-  start( dest_dir, media );
-  // only if there is a signature in the destination directory
-  if ( PathInfo(dest_dir / sig ).isExist() )
-      sigchecker = SignatureFileChecker( dest_dir + sig/*, repoInfo().name() */);
-  reset();
-
-  Pathname key = repoInfo().path() + "/content.key";
-
-  enqueue( OnMediaLocation( key, 1 ).setOptional(true) );
-  start( dest_dir, media );
-
-  KeyContext context;
-  context.setRepoInfo(repoInfo());
-  // only if there is a key in the destination directory
-  if ( PathInfo(dest_dir / key).isExist() )
-    sigchecker.addPublicKey(dest_dir + key, context);
-  // set the checker context even if the key is not known (unsigned repo, key
-  // file missing; bnc #495977)
-  else
-    sigchecker.setKeyContext(context);
-
-  reset();
-
-  if ( ! repoInfo().gpgCheck() )
-  {
-    WAR << "Signature checking disabled in config of repository " << repoInfo().alias() << endl;
-  }
-  enqueue( OnMediaLocation( repoInfo().path() + "/content", 1 ),
-                 repoInfo().gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) );
-  start( dest_dir, media );
-  reset();
-
-  Pathname descr_dir;
+  Pathname masterIndex( repoInfo().path() / "/content" );
+  defaultDownloadMasterIndex( media, dest_dir, masterIndex );
 
   // Content file first to get the repoindex
   {
-    Pathname inputfile( dest_dir +  repoInfo().path() + "/content" );
+    Pathname inputfile( dest_dir / masterIndex );
     ContentFileReader content;
     content.setRepoIndexConsumer( bind( &Downloader::consumeIndex, this, _1 ) );
     content.parse( inputfile );
@@ -119,7 +85,7 @@ void Downloader::download( MediaSetAccess &media,
   }
 
   // Prepare parsing
-  descr_dir = _repoindex->descrdir; // path below reporoot
+  Pathname descr_dir = _repoindex->descrdir; // path below reporoot
   //_datadir  = _repoIndex->datadir;  // path below reporoot
 
   std::map<std::string,RepoIndex::FileChecksumMap::const_iterator> availablePackageTranslations;
index 8ca42fc..a27dd2f 100644 (file)
 #include "zypp/base/Logger.h"
 #include "zypp/base/Function.h"
 
-#include "zypp/Date.h"
-
 #include "zypp/parser/yum/RepomdFileReader.h"
 #include "zypp/parser/yum/PatchesFileReader.h"
 #include "Downloader.h"
 #include "zypp/repo/MediaInfoDownloader.h"
 #include "zypp/base/UserRequestException.h"
 #include "zypp/parser/xml/Reader.h"
-#include "zypp/KeyContext.h"
 
 using namespace std;
 using namespace zypp::xml;
@@ -126,69 +123,20 @@ bool Downloader::repomd_Callback( const OnMediaLocation &loc,
   return true;
 }
 
+/** \todo: Downloading/sigcheck of master index shoudl be common in base class */
 void Downloader::download( MediaSetAccess &media,
                            const Pathname &dest_dir,
                            const ProgressData::ReceiverFnc & progressrcv )
 {
-  Pathname repomdpath =  repoInfo().path() + "/repodata/repomd.xml";
-  Pathname keypath =  repoInfo().path() + "/repodata/repomd.xml.key";
-  Pathname sigpath =  repoInfo().path() + "/repodata/repomd.xml.asc";
+  Pathname masterIndex( repoInfo().path() / "/repodata/repomd.xml" );
+  defaultDownloadMasterIndex( media, dest_dir, masterIndex );
 
   _media_ptr = (&media);
-
-  ProgressData progress;
-  progress.sendTo(progressrcv);
-  progress.toMin();
-
-  //downloadMediaInfo( dest_dir, _media );
-
   _dest_dir = dest_dir;
-
-#warning Do we need SignatureFileChecker(string descr)?
-  SignatureFileChecker sigchecker/*(repoInfo().name())*/;
-
-  this->enqueue( OnMediaLocation(sigpath,1).setOptional(true) );
-  this->start( dest_dir, *_media_ptr);
-  // only add the signature if it exists
-  if ( PathInfo(dest_dir / sigpath).isExist() )
-      sigchecker = SignatureFileChecker(dest_dir / sigpath);
-  this->reset();
-
-  this->enqueue( OnMediaLocation(keypath,1).setOptional(true) );
-  this->start( dest_dir, *_media_ptr);
-
-  KeyContext context;
-  context.setRepoInfo(repoInfo());
-  // only add the key if it exists
-  if ( PathInfo(dest_dir / keypath).isExist() )
-    sigchecker.addPublicKey(dest_dir + keypath, context);
-  // set the checker context even if the key is not known (unsigned repo, key
-  // file missing; bnc #495977)
-  else
-    sigchecker.setKeyContext(context);
-
-  this->reset();
-
-  if ( ! progress.tick() )
-    ZYPP_THROW(AbortRequestException());
-
-  if ( ! repoInfo().gpgCheck() )
-    WAR << "Signature checking disabled in config of repository " << repoInfo().alias() << endl;
-
-  this->enqueue( OnMediaLocation(repomdpath,1),
-                 repoInfo().gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) );
-  this->start( dest_dir, *_media_ptr);
-
-  if ( ! progress.tick() )
-        ZYPP_THROW(AbortRequestException());
-
-  this->reset();
-
-  RepomdFileReader( dest_dir + repoInfo().path() + "/repodata/repomd.xml", bind( &Downloader::repomd_Callback, this, _1, _2));
+  RepomdFileReader( dest_dir / masterIndex, bind( &Downloader::repomd_Callback, this, _1, _2));
 
   // ready, go!
-  this->start( dest_dir, *_media_ptr);
-  progress.toMax();
+  start( dest_dir, media );
 }
 
 }// ns yum
index be3082e..eb77b4e 100644 (file)
@@ -183,6 +183,9 @@ namespace zypp
         {
           ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
         }
+        // by now we support only a RPM backend
+        ::pool_setdisttype(_pool, DISTTYPE_RPM );
+
         // initialialize logging
        if ( env::LIBSOLV_DEBUGMASK() )
        {
index 0d02f92..2f53a4f 100644 (file)
@@ -9,6 +9,7 @@
 /** \file      zypp/target/TargetCallbackReceiver.cc
  *
 */
+#include <iostream>
 
 #include "zypp/target/TargetCallbackReceiver.h"
 
index 0ba8226..67b47e1 100644 (file)
@@ -1869,6 +1869,7 @@ void RpmDb::doInstallPackage( const Pathname & filename, RpmInstFlags flags, cal
     opts.push_back("-U");
 
   opts.push_back("--percent");
+  opts.push_back("--noglob");
 
   // ZConfig defines cross-arch installation
   if ( ! ZConfig::instance().systemArchitecture().compatibleWith( ZConfig::instance().defaultSystemArchitecture() ) )