Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libzypp for openSUSE:Factory checked 
in at 2024-08-05 17:20:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libzypp (Old)
 and      /work/SRC/openSUSE:Factory/.libzypp.new.7232 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libzypp"

Mon Aug  5 17:20:51 2024 rev:497 rq:1191639 version:17.35.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes  2024-07-31 
13:29:12.951611234 +0200
+++ /work/SRC/openSUSE:Factory/.libzypp.new.7232/libzypp.changes        
2024-08-05 17:20:57.202332752 +0200
@@ -1,0 +2,19 @@
+Mon Aug  5 12:04:25 CEST 2024 - m...@suse.de
+
+- single_rpmtrans: fix installation of .src.rpms (bsc#1228647)
+- version 17.35.9 (35)
+
+-------------------------------------------------------------------
+Fri Aug  2 12:46:50 CEST 2024 - m...@suse.de
+
+- Make sure not to statically linked installed tools (bsc#1228787)
+- version 17.35.8 (35)
+
+-------------------------------------------------------------------
+Thu Aug  1 17:35:44 CEST 2024 - m...@suse.de
+
+- MediaPluginType must be resolved to a valid MediaHandler
+  (bsc#1228208)
+- version 17.35.7 (35)
+
+-------------------------------------------------------------------

Old:
----
  libzypp-17.35.6.tar.bz2

New:
----
  libzypp-17.35.9.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.NlWj4e/_old  2024-08-05 17:20:58.074368481 +0200
+++ /var/tmp/diff_new_pack.NlWj4e/_new  2024-08-05 17:20:58.090369137 +0200
@@ -57,7 +57,7 @@
 %bcond_with enable_preview_single_rpmtrans_as_default_for_zypper
 
 Name:           libzypp
-Version:        17.35.6
+Version:        17.35.9
 Release:        0
 License:        GPL-2.0-or-later
 URL:            https://github.com/openSUSE/libzypp

++++++ libzypp-17.35.6.tar.bz2 -> libzypp-17.35.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.35.6/VERSION.cmake 
new/libzypp-17.35.9/VERSION.cmake
--- old/libzypp-17.35.6/VERSION.cmake   2024-07-30 17:00:08.000000000 +0200
+++ new/libzypp-17.35.9/VERSION.cmake   2024-08-05 12:05:52.000000000 +0200
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "35")
 SET(LIBZYPP_MINOR "35")
-SET(LIBZYPP_PATCH "6")
+SET(LIBZYPP_PATCH "9")
 #
-# LAST RELEASED: 17.35.6 (35)
+# LAST RELEASED: 17.35.9 (35)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.35.6/package/libzypp.changes 
new/libzypp-17.35.9/package/libzypp.changes
--- old/libzypp-17.35.6/package/libzypp.changes 2024-07-30 17:00:08.000000000 
+0200
+++ new/libzypp-17.35.9/package/libzypp.changes 2024-08-05 12:05:52.000000000 
+0200
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Mon Aug  5 12:04:25 CEST 2024 - m...@suse.de
+
+- single_rpmtrans: fix installation of .src.rpms (bsc#1228647)
+- version 17.35.9 (35)
+
+-------------------------------------------------------------------
+Fri Aug  2 12:46:50 CEST 2024 - m...@suse.de
+
+- Make sure not to statically linked installed tools (bsc#1228787)
+- version 17.35.8 (35)
+
+-------------------------------------------------------------------
+Thu Aug  1 17:35:44 CEST 2024 - m...@suse.de
+
+- MediaPluginType must be resolved to a valid MediaHandler
+  (bsc#1228208)
+- version 17.35.7 (35)
+
+-------------------------------------------------------------------
 Tue Jul 30 16:59:53 CEST 2024 - m...@suse.de
 
 - Export CredentialManager for legacy YAST versions (bsc#1228420)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.35.6/tools/CMakeLists.txt 
new/libzypp-17.35.9/tools/CMakeLists.txt
--- old/libzypp-17.35.6/tools/CMakeLists.txt    2024-07-08 14:00:08.000000000 
+0200
+++ new/libzypp-17.35.9/tools/CMakeLists.txt    2024-08-02 12:47:28.000000000 
+0200
@@ -2,12 +2,21 @@
 
 FILE( GLOB ALLCC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc" )
 STRING( REPLACE ".cc" ";" APLLPROG ${ALLCC} )
+
+# make sure not to statically linked installed tools
+SET( LINKALLSYM CalculateReusableBlocks DownloadFiles )
+
 FOREACH( loop_var ${APLLPROG} )
   ADD_EXECUTABLE( ${loop_var}
     ${loop_var}.cc
   )
   TARGET_LINK_LIBRARIES( ${loop_var} PUBLIC zypp_exe_compiler_flags 
${Boost_PROGRAM_OPTIONS_LIBRARY} )
-  TARGET_LINK_LIBRARIES( ${loop_var} PUBLIC zypp-allsym  )
+  LIST( FIND LINKALLSYM ${loop_var} NEEDALLSYM )
+  if ( NEEDALLSYM EQUAL -1 )
+    TARGET_LINK_LIBRARIES( ${loop_var} PUBLIC zypp )
+  ELSE()
+    TARGET_LINK_LIBRARIES( ${loop_var} PUBLIC zypp-allsym )
+  ENDIF()
 ENDFOREACH( loop_var )
 
 ## ############################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.35.6/tools/zypp-rpm/main.cc 
new/libzypp-17.35.9/tools/zypp-rpm/main.cc
--- old/libzypp-17.35.6/tools/zypp-rpm/main.cc  2024-06-07 10:50:10.000000000 
+0200
+++ new/libzypp-17.35.9/tools/zypp-rpm/main.cc  2024-08-05 12:05:52.000000000 
+0200
@@ -1,3 +1,6 @@
+#include <optional>
+#include <vector>
+
 #include <zypp-core/zyppng/core/ByteArray>
 #include <zypp-core/zyppng/rpc/stompframestream.h>
 #include <zypp-core/zyppng/base/private/linuxhelpers_p.h>
@@ -51,6 +54,86 @@
   }
 } // namespace env
 
+namespace dbg
+{
+  struct _dumpTransactionStep
+  {
+    _dumpTransactionStep( const zypp::proto::target::TransactionStep *const 
step_r )
+    : _step { step_r }
+    {}
+    std::ostream & dumpOn( std::ostream & str ) const
+    {
+      str << "TStep(";
+      if ( _step ) {
+        if ( std::holds_alternative<zypp::proto::target::InstallStep>(*_step) 
) {
+          const auto &step = 
std::get<zypp::proto::target::InstallStep>(*_step);
+          str << step.stepId << "|" << step.pathname;
+        } else if ( 
std::holds_alternative<zypp::proto::target::RemoveStep>(*_step) ) {
+          const auto &step = std::get<zypp::proto::target::RemoveStep>(*_step);
+          str << step.stepId << "|" << step.name << "-" << step.version << "-" 
<< step.release << "." << step.arch;
+        } else {
+          str << "OOPS";
+        }
+      } else {
+        str << "NULL";
+      }
+      return str << ")";
+    }
+    const zypp::proto::target::TransactionStep *const _step;
+  };
+  inline std::ostream & operator<<( std::ostream & str, const 
_dumpTransactionStep & obj )
+  { return obj.dumpOn( str ); }
+  inline _dumpTransactionStep dump( const zypp::proto::target::TransactionStep 
*const obj )
+  { return _dumpTransactionStep( obj ); }
+  inline _dumpTransactionStep dump( const zypp::proto::target::TransactionStep 
& obj )
+  { return _dumpTransactionStep( &obj ); }
+
+  struct _dumpRpmCallbackType
+  {
+    _dumpRpmCallbackType( rpmCallbackType_e flag_r )
+    : _flag { flag_r }
+    {}
+    std::ostream & dumpOn( std::ostream & str ) const
+    {
+      str << "RPMCALLBACK";
+      if ( _flag ) {
+#define OUTS(E) if ( _flag & RPMCALLBACK_##E ) str << "_" << #E
+        OUTS( INST_PROGRESS   );
+        OUTS( INST_START      );
+        OUTS( INST_OPEN_FILE  );
+        OUTS( INST_CLOSE_FILE );
+        OUTS( TRANS_PROGRESS  );
+        OUTS( TRANS_START     );
+        OUTS( TRANS_STOP      );
+        OUTS( UNINST_PROGRESS );
+        OUTS( UNINST_START    );
+        OUTS( UNINST_STOP     );
+        OUTS( UNPACK_ERROR    );
+        OUTS( CPIO_ERROR      );
+        OUTS( SCRIPT_ERROR    );
+        OUTS( SCRIPT_START    );
+        OUTS( SCRIPT_STOP     );
+        OUTS( INST_STOP       );
+        OUTS( ELEM_PROGRESS   );
+#ifdef HAVE_RPM_VERIFY_TRANSACTION_STEP
+        OUTS( VERIFY_PROGRESS );
+        OUTS( VERIFY_START    );
+        OUTS( VERIFY_STOP     );
+#endif
+#undef OUTS
+      } else {
+        str << "_UNKNOWN";
+      }
+      return str;
+    }
+    rpmCallbackType_e _flag;
+  };
+  inline std::ostream & operator<<( std::ostream & str, const 
_dumpRpmCallbackType & obj )
+  { return obj.dumpOn( str ); }
+  inline _dumpRpmCallbackType dump( rpmCallbackType obj )
+  { return _dumpRpmCallbackType( obj ); }
+}
+
 // this is the order we expect the FDs we need to communicate to be set up
 // by the parent. This is not pretty but it works and is less effort than
 // setting up a Unix Domain Socket and sending FDs over that.
@@ -174,15 +257,38 @@
   return std::make_pair( h, res );
 }
 
+// Remember 'install source rpm' transaction steps (bsc#1228647, installed 
separately)
+struct SourcePackageInstallHelper
+{
+  // < transaction step index, path to the .src.rpm >
+  using StepIndex = std::pair<std::size_t,zypp::Pathname>;
+  using StepIndices = std::vector<StepIndex>;
+
+  void remember( std::size_t stepIndex_r, zypp::Pathname pathname_r )
+  {
+    if ( not stepIndices ) stepIndices = StepIndices();
+    stepIndices->push_back( {stepIndex_r, std::move(pathname_r)} );
+  }
+
+  std::optional<StepIndices> stepIndices;   // Remembered source rpm installs
+  std::optional<std::size_t> currentStep;   // Current transaction step index 
for rpmLibCallback
+};
 
 struct TransactionData {
+  TransactionData( zypp::proto::target::Commit & commitData_r )
+  : commitData { commitData_r }
+  {}
+
   zypp::proto::target::Commit &commitData;
 
   // dbinstance of removals to transaction step index
-  std::unordered_map<int, int> removePckIndex = {};
+  std::unordered_map<int, std::size_t> removePckIndex = {};
 
   // the fd used by rpm to dump script output
   zypp::AutoDispose<FD_t> rpmFd = {};
+
+  // Remember 'install source rpm' transaction steps (bsc#1228647, installed 
separately)
+  SourcePackageInstallHelper sourcePackageInstallHelper;
 };
 
 int main( int, char ** )
@@ -341,7 +447,7 @@
   // do we care about knowing the public key?
   const bool allowUntrusted = ( rpmInstFlags & 
RpmInstFlag::RPMINST_ALLOWUNTRUSTED );
 
-  for ( int i = 0; i < msg.transactionSteps.size(); i++ ) {
+  for ( std::size_t i = 0; i < msg.transactionSteps.size(); ++i ) {
     const auto &step = msg.transactionSteps[i];
 
     if ( std::holds_alternative<zypp::proto::target::InstallStep>(step) ) {
@@ -382,6 +488,14 @@
         return FailedToReadPackage;
       }
 
+      // bsc#1228647: ::rpmtsInstallElement accepts source rpms without an 
error, but
+      // is not able to handle them correctly within ::rpmtsRun. We need to 
remember
+      // them and run ::rpmInstallSourcePackage after the ::rpmtsRun is done.
+      if ( ::headerIsSource( rpmHeader.first.get() ) ) {
+        data.sourcePackageInstallHelper.remember( i, install.pathname );
+        continue;
+      }
+
       const auto res = ::rpmtsAddInstallElement( ts, rpmHeader.first.get(), 
&step, !install.multiversion, nullptr  );
       if ( res ) {
         ZERR << zypp::str::Format( "Failed to add %1% to the transaction." )% 
file << std::endl;
@@ -549,6 +663,27 @@
     return err;
   }
 
+  // bsc#1228647: ::rpmtsInstallElement accepts source rpms without an error, 
but
+  // is not able to handle them correctly within ::rpmtsRun. We need to 
remember
+  // them and run ::rpmInstallSourcePackage after the ::rpmtsRun is done.
+  if ( data.sourcePackageInstallHelper.stepIndices ) {
+    ::rpmtsEmpty( ts );   // Re-create an empty transaction set.
+    auto err = NoError;
+    for ( const auto & [stepi,path] : 
*data.sourcePackageInstallHelper.stepIndices ) {
+      zypp::AutoDispose<FD_t> fd { ::Fopen( path.c_str(), "r" ), ::Fclose };
+      data.sourcePackageInstallHelper.currentStep = stepi; // rpmLibCallback 
needs to look it up
+      ::rpmRC res = ::rpmInstallSourcePackage( ts, fd, nullptr, nullptr );
+      if ( res != 0 ) {
+        ZERR << "RPM InstallSourcePackage " << path << " failed: " << res << 
std::endl;
+        err = RpmFinishedWithError;
+      }
+    }
+    data.sourcePackageInstallHelper.currentStep = std::nullopt; // done
+    if ( err != NoError ) {
+      return err;
+    }
+  }
+
   //ZDBG << "Success !!!!" << std::endl;
 
   return NoError;
@@ -596,15 +731,30 @@
   const BinHeader header( (Header)h );
 
   auto iStep = key ? reinterpret_cast< const 
zypp::proto::target::TransactionStep * >( key ) : nullptr;
-  if ( !iStep && h ) {
-    auto key = headerGetInstance( header.get() );
-    if ( key > 0 ) {
-      auto i = that->removePckIndex.find(key);
-      if ( i != that->removePckIndex.end() )
-        iStep = &that->commitData.transactionSteps[i->second];
+  if ( !iStep ) {
+    if ( that->sourcePackageInstallHelper.currentStep ) {
+      // we're in ::rpmInstallSourcePackage
+      iStep = 
&that->commitData.transactionSteps[*(that->sourcePackageInstallHelper.currentStep)];
+    }
+    else if ( h ) {
+      auto key = headerGetInstance( header.get() );
+      if ( key > 0 ) {
+        auto i = that->removePckIndex.find(key);
+        if ( i != that->removePckIndex.end() )
+          iStep = &that->commitData.transactionSteps[i->second];
+      }
     }
   }
 
+#if 0
+  // dbg log callback sequence (collapsing RPMCALLBACK_INST_PROGRESS)
+  static rpmCallbackType prev = RPMCALLBACK_UNKNOWN;
+  if ( what != RPMCALLBACK_INST_PROGRESS || prev != RPMCALLBACK_INST_PROGRESS 
) {
+    ZDBG << "LibCB " << dbg::dump(what) << ": " << dbg::dump(iStep) << " - "  
<< header.nvra() << std::endl;
+    prev = what;
+  }
+#endif
+
   const auto &sendEndOfScriptTag = [&](){
     //ZDBG << "Send end of script" << std::endl;
     ::Fflush( that->rpmFd );
@@ -687,7 +837,7 @@
     case RPMCALLBACK_INST_STOP: {
 
       if ( !iStep ) {
-        ZERR << "Could not find package " << header << " in transaction 
elements for " << what << std::endl;
+        ZERR << "Could not find package " << header << " in transaction 
elements for " << dbg::dump(what) << std::endl;
         return rc;
       }
 
@@ -729,7 +879,7 @@
     case RPMCALLBACK_UNPACK_ERROR: {
 
       if ( !iStep ) {
-        ZERR << "Could not find package " << header << " in transaction 
elements for " << what << std::endl;
+        ZERR << "Could not find package " << header << " in transaction 
elements for " << dbg::dump(what) << std::endl;
         return rc;
       }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.35.6/zypp/media/MediaHandlerFactory.cc 
new/libzypp-17.35.9/zypp/media/MediaHandlerFactory.cc
--- old/libzypp-17.35.6/zypp/media/MediaHandlerFactory.cc       2024-06-04 
11:50:11.000000000 +0200
+++ new/libzypp-17.35.9/zypp/media/MediaHandlerFactory.cc       2024-08-01 
17:36:13.000000000 +0200
@@ -54,19 +54,16 @@
       ZYPP_THROW(MediaBadUrlException(o_url));
     }
 
-    std::unique_ptr<MediaHandler> _handler;
-
     UrlResolverPlugin::HeaderList custom_headers;
     Url url = UrlResolverPlugin::resolveUrl(o_url, custom_headers);
+    MIL << "Trying scheme '" << url.getScheme() << "'" << std::endl;
 
-
-    MIL << "Trying scheme '" << o_url.getScheme() << "'" << std::endl;
-
-    const auto hdlType = handlerType( o_url );
+    const auto hdlType = handlerType( url );
     if ( !hdlType ) {
       ZYPP_THROW(MediaUnsupportedUrlSchemeException(url));
     }
 
+    std::unique_ptr<MediaHandler> _handler;
     switch(*hdlType) {
       case MediaCDType: {
         _handler = std::make_unique<MediaCD> (url,preferred_attach_point);
@@ -152,7 +149,10 @@
         break;
       }
       case MediaPluginType: {
-        _handler = std::make_unique<MediaPlugin> (url,preferred_attach_point);
+        // bsc#1228208: MediaPluginType must be resolved to a valid schema by 
the
+        // above UrlResolverPlugin::resolveUrl call. MediaPlugin exists as a 
stub,
+        // but is not a usable handler type.
+        ZYPP_THROW(MediaUnsupportedUrlSchemeException(url));
         break;
       }
     }

Reply via email to