Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libzypp for openSUSE:Factory checked 
in at 2023-12-15 21:47:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libzypp (Old)
 and      /work/SRC/openSUSE:Factory/.libzypp.new.25432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libzypp"

Fri Dec 15 21:47:18 2023 rev:483 rq:1133058 version:17.31.25

Changes:
--------
--- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes  2023-10-27 
22:27:45.922573028 +0200
+++ /work/SRC/openSUSE:Factory/.libzypp.new.25432/libzypp.changes       
2023-12-15 21:47:23.314389866 +0100
@@ -1,0 +2,23 @@
+Thu Dec 14 11:09:24 CET 2023 - m...@suse.de
+
+- Fix build issue with zchunk build flags (fixes #500)
+- version 17.31.25 (22)
+
+-------------------------------------------------------------------
+Thu Dec 14 10:48:01 CET 2023 - m...@suse.de
+
+- Open rpmdb just once during execution of %posttrans scripts
+  (bsc#1216412)
+- Avoid using select() since it does not support fd numbers >
+  1024 (fixes #447)
+- tools/DownloadFiles: use standard zypp progress bar (fixes #489)
+- Revert "Color download progress bar" (fixes #475)
+  Cyan is already used for the output of RPM scriptlets. Avoid this
+  colorific collision between download progress bar and scriptlet
+  output.
+- Fix ProgressBar's calculation of the printed tag position (fixes #494)
+- Switch zypp::Digest to Openssl 3.0 Provider API (fixes #144)
+- Fix usage of deprecated CURL features (fixes #486)
+- version 17.31.24 (22)
+
+-------------------------------------------------------------------

Old:
----
  libzypp-17.31.23.tar.bz2

New:
----
  libzypp-17.31.25.tar.bz2

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

Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.vMxH84/_old  2023-12-15 21:47:25.006451714 +0100
+++ /var/tmp/diff_new_pack.vMxH84/_new  2023-12-15 21:47:25.010451860 +0100
@@ -42,7 +42,7 @@
 %bcond_with enable_preview_single_rpmtrans_as_default_for_zypper
 
 Name:           libzypp
-Version:        17.31.23
+Version:        17.31.25
 Release:        0
 License:        GPL-2.0-or-later
 URL:            https://github.com/openSUSE/libzypp

++++++ libzypp-17.31.23.tar.bz2 -> libzypp-17.31.25.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/CMakeLists.txt 
new/libzypp-17.31.25/CMakeLists.txt
--- old/libzypp-17.31.23/CMakeLists.txt 2023-10-05 11:30:08.000000000 +0200
+++ new/libzypp-17.31.25/CMakeLists.txt 2023-12-14 11:10:07.000000000 +0100
@@ -322,8 +322,18 @@
 IF (ENABLE_ZCHUNK_COMPRESSION)
   MESSAGE("Building with zchunk support enabled.")
   PKG_CHECK_MODULES (ZCHUNK zck REQUIRED)
-  SET( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} ${ZCHUNK_CFLAGS}" )
-  SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ZCHUNK_CFLAGS}" )
+
+  # work around some cmake versions where JOIN fails in case a list has only
+  # one element
+  list(LENGTH ZCHUNK_CFLAGS ZCHUNK_CFLAGS_len )
+  if ( ZCHUNK_CFLAGS_len GREATER 1 )
+    list(JOIN ZCHUNK_CFLAGS " " ZCHUNK_CFLAGS_STR)
+  else()
+    set( ZCHUNK_CFLAGS_STR "${ZCHUNK_CFLAGS}" )
+  endif()
+
+  SET( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} ${ZCHUNK_CFLAGS_STR}" )
+  SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ZCHUNK_CFLAGS_STR}" )
   ADD_DEFINITIONS (-DENABLE_ZCHUNK_COMPRESSION=1)
 ENDIF(ENABLE_ZCHUNK_COMPRESSION)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/VERSION.cmake 
new/libzypp-17.31.25/VERSION.cmake
--- old/libzypp-17.31.23/VERSION.cmake  2023-10-25 16:10:07.000000000 +0200
+++ new/libzypp-17.31.25/VERSION.cmake  2023-12-14 11:10:07.000000000 +0100
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "22")
 SET(LIBZYPP_MINOR "31")
-SET(LIBZYPP_PATCH "23")
+SET(LIBZYPP_PATCH "25")
 #
-# LAST RELEASED: 17.31.23 (22)
+# LAST RELEASED: 17.31.25 (22)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/package/libzypp.changes 
new/libzypp-17.31.25/package/libzypp.changes
--- old/libzypp-17.31.23/package/libzypp.changes        2023-10-25 
16:10:07.000000000 +0200
+++ new/libzypp-17.31.25/package/libzypp.changes        2023-12-14 
11:10:07.000000000 +0100
@@ -1,4 +1,27 @@
 -------------------------------------------------------------------
+Thu Dec 14 11:09:24 CET 2023 - m...@suse.de
+
+- Fix build issue with zchunk build flags (fixes #500)
+- version 17.31.25 (22)
+
+-------------------------------------------------------------------
+Thu Dec 14 10:48:01 CET 2023 - m...@suse.de
+
+- Open rpmdb just once during execution of %posttrans scripts
+  (bsc#1216412)
+- Avoid using select() since it does not support fd numbers >
+  1024 (fixes #447)
+- tools/DownloadFiles: use standard zypp progress bar (fixes #489)
+- Revert "Color download progress bar" (fixes #475)
+  Cyan is already used for the output of RPM scriptlets. Avoid this
+  colorific collision between download progress bar and scriptlet
+  output.
+- Fix ProgressBar's calculation of the printed tag position (fixes #494)
+- Switch zypp::Digest to Openssl 3.0 Provider API (fixes #144)
+- Fix usage of deprecated CURL features (fixes #486)
+- version 17.31.24 (22)
+
+-------------------------------------------------------------------
 Wed Oct 25 16:03:51 CEST 2023 - m...@suse.de
 
 - Stop using boost version 1 timer library (fixes #489,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/tools/CMakeLists.txt 
new/libzypp-17.31.25/tools/CMakeLists.txt
--- old/libzypp-17.31.23/tools/CMakeLists.txt   2023-07-19 11:53:07.000000000 
+0200
+++ new/libzypp-17.31.25/tools/CMakeLists.txt   2023-11-14 10:00:07.000000000 
+0100
@@ -7,7 +7,7 @@
     ${loop_var}.cc
   )
   TARGET_LINK_LIBRARIES( ${loop_var}
-    zypp
+    zypp zypp-tui
     ${Boost_PROGRAM_OPTIONS_LIBRARY}
   )
 ENDFOREACH( loop_var )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/tools/DownloadFiles.cc 
new/libzypp-17.31.25/tools/DownloadFiles.cc
--- old/libzypp-17.31.23/tools/DownloadFiles.cc 2023-10-25 16:00:08.000000000 
+0200
+++ new/libzypp-17.31.25/tools/DownloadFiles.cc 2023-11-14 10:00:07.000000000 
+0100
@@ -11,6 +11,8 @@
 #include <zypp/ZYppCallbacks.h>
 #include <zypp-core/ManagedFile.h>
 #include <zypp-core/fs/TmpPath.h>
+#include <zypp-tui/application.h>
+#include <zypp-tui/output/Out.h>
 #include <yaml-cpp/yaml.h>
 
 #include <boost/program_options.hpp>
@@ -28,22 +30,19 @@
 // https://www.boost.org/doc/libs/1_83_0/libs/timer/doc/original_timer.html
 // A simple handcrafted substitute for <boost/progress.hpp> progress_display
 struct PCBar {
-  PCBar() {
-    std::cout << std::endl;
-    std::cout << "0%   10   20   30   40   50   60   70   80   90   100%" << 
std::endl;
-    std::cout << "|----|----|----|----|----|----|----|----|----|----|" << 
std::endl;
-  }
-  ~PCBar() {
-    std::cout << std::endl;
+  PCBar() : bar(app.out(), "") {
+    bar->range(100);
+    bar->set(0);
+    bar.print();
   }
   void set( int pcval_r ) {
-    if ( pcval_r <= 0 )
-      std::cout << "\033[2K\r" << std::flush;
-    else if ( pcval_r < 100 )
-      std::cout << "\033[2K\r" << std::string( 1+pcval_r/2, '*' ) << 
std::flush;
-    else
-      std::cout << "\033[2K\r" << std::string( 51, '*' ) << std::flush;
+    bar->set(pcval_r);
+    bar.print();
   }
+
+  private:
+  ztui::Application app;
+  ztui::Out::ProgressBar bar;
 };
 
 // progress for downloading a file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/PluginScript.cc 
new/libzypp-17.31.25/zypp/PluginScript.cc
--- old/libzypp-17.31.23/zypp/PluginScript.cc   2023-07-19 11:53:07.000000000 
+0200
+++ new/libzypp-17.31.25/zypp/PluginScript.cc   2023-11-22 11:10:07.000000000 
+0100
@@ -15,6 +15,8 @@
 #include <iostream>
 #include <sstream>
 
+#include <glib.h>
+
 #include <zypp/base/LogTools.h>
 #include <zypp-core/base/DefaultIntegral>
 #include <zypp/base/String.h>
@@ -293,15 +295,12 @@
       const char * buffer = data.c_str();
       ssize_t buffsize = data.size();
       do {
-        fd_set wfds;
-        FD_ZERO( &wfds );
-        FD_SET( fd, &wfds );
-
-        struct timeval tv;
-        tv.tv_sec = _sendTimeout;
-        tv.tv_usec = 0;
+        GPollFD watchFd;
+        watchFd.fd = fd;
+        watchFd.events =  G_IO_OUT | G_IO_ERR;
+        watchFd.revents = 0;
 
-        int retval = select( fd+1, NULL, &wfds, NULL, &tv );
+        int retval = g_poll( &watchFd, 1, _sendTimeout * 1000 );
         if ( retval > 0 )      // FD_ISSET( fd, &wfds ) will be true.
         {
           //DBG << "Ready to write..." << endl;
@@ -385,16 +384,13 @@
           if ( errno == EWOULDBLOCK )
           {
             // wait a while for fd to become ready for reading...
-            fd_set rfds;
-            FD_ZERO( &rfds );
-            FD_SET( fd, &rfds );
-
-            struct timeval tv;
-            tv.tv_sec = _receiveTimeout;
-            tv.tv_usec = 0;
+            GPollFD rfd;
+            rfd.fd = fd;
+            rfd.events =  G_IO_IN | G_IO_HUP | G_IO_ERR;
+            rfd.revents = 0;
 
-            int retval = select( fd+1, &rfds, NULL, NULL, &tv );
-            if ( retval > 0 )  // FD_ISSET( fd, &rfds ) will be true.
+            int retval = g_poll( &rfd, 1, _receiveTimeout * 1000 );
+            if ( retval > 0 )  // rfd.revents was filled
             {
               ::clearerr( filep );
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/media/MediaCurl.cc 
new/libzypp-17.31.25/zypp/media/MediaCurl.cc
--- old/libzypp-17.31.23/zypp/media/MediaCurl.cc        2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp/media/MediaCurl.cc        2023-11-21 
18:20:08.000000000 +0100
@@ -139,7 +139,7 @@
                   zypp::ByteCount expectedFileSize_r = 0,
                   
zypp::callback::SendReport<zypp::media::DownloadProgressReport> *_report = 
nullptr );
 
-    void updateStats( double dltotal = 0.0, double dlnow = 0.0 );
+    void updateStats( curl_off_t dltotal = 0.0, curl_off_t dlnow = 0.0 );
 
     int reportProgress() const;
 
@@ -172,9 +172,9 @@
     time_t _timeRcv    = 0;    ///< Start of no-data timeout
     time_t _timeNow    = 0;    ///< Now
 
-    double _dnlTotal   = 0.0;  ///< Bytes to download or 0 if unknown
-    double _dnlLast    = 0.0;  ///< Bytes downloaded at period start
-    double _dnlNow     = 0.0;  ///< Bytes downloaded now
+    curl_off_t _dnlTotal = 0.0;        ///< Bytes to download or 0 if unknown
+    curl_off_t _dnlLast         = 0.0; ///< Bytes downloaded at period start
+    curl_off_t _dnlNow  = 0.0; ///< Bytes downloaded now
 
     int    _dnlPercent= 0;     ///< Percent completed or 0 if _dnlTotal is 
unknown
 
@@ -194,7 +194,7 @@
     , report( _report )
   {}
 
-  void ProgressData::updateStats(double dltotal, double dlnow)
+  void ProgressData::updateStats( curl_off_t dltotal, curl_off_t dlnow )
   {
     time_t now = _timeNow = time(0);
 
@@ -221,14 +221,14 @@
 
     // percentage:
     if ( _dnlTotal )
-      _dnlPercent = int(_dnlNow * 100 / _dnlTotal);
+      _dnlPercent = int( _dnlNow * 100 / _dnlTotal );
 
     // download rates:
-    _drateTotal = _dnlNow / std::max( int(now - _timeStart), 1 );
+    _drateTotal = double(_dnlNow) / std::max( int(now - _timeStart), 1 );
 
     if ( _timeLast < now )
     {
-      _drateLast = (_dnlNow - _dnlLast) / int(now - _timeLast);
+      _drateLast = double(_dnlNow - _dnlLast) / int(now - _timeLast);
       // start new period
       _timeLast  = now;
       _dnlLast   = _dnlNow;
@@ -477,11 +477,20 @@
   {
 #if CURLVERSION_AT_LEAST(7,19,4)
     // restrict following of redirections from https to https only
-    if ( _url.getHost() == "download.opensuse.org" )
+    if ( _url.getHost() == "download.opensuse.org" ) {
+#if CURLVERSION_AT_LEAST(7,85,0)
+      SET_OPTION( CURLOPT_REDIR_PROTOCOLS_STR, "http,https" );
+#else
       SET_OPTION( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
-    else
+#endif
+    } else {
+#if CURLVERSION_AT_LEAST(7,85,0)
+      SET_OPTION( CURLOPT_REDIR_PROTOCOLS_STR, "https" );
+#else
       SET_OPTION( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
 #endif
+    }
+#endif // if CURLVERSION_AT_LEAST(7,19,4)
 
     if( _settings.verifyPeerEnabled() ||
         _settings.verifyHostEnabled() )
@@ -624,13 +633,14 @@
    *---------------------------------------------------------------*/
 
   _currentCookieFile = _cookieFile.asString();
-  filesystem::assert_file_mode( _currentCookieFile, 0600 );
+  if ( ::geteuid() == 0 || PathInfo(_currentCookieFile).owner() == ::geteuid() 
)
+    filesystem::assert_file_mode( _currentCookieFile, 0600 );
   if ( str::strToBool( _url.getQueryParam( "cookies" ), true ) )
     SET_OPTION(CURLOPT_COOKIEFILE, _currentCookieFile.c_str() );
   else
     MIL << "No cookies requested" << endl;
   SET_OPTION(CURLOPT_COOKIEJAR, _currentCookieFile.c_str() );
-  SET_OPTION(CURLOPT_PROGRESSFUNCTION, &progressCallback );
+  SET_OPTION(CURLOPT_XFERINFOFUNCTION, &progressCallback );
   SET_OPTION(CURLOPT_NOPROGRESS, 0L);
 
 #if CURLVERSION_AT_LEAST(7,18,0)
@@ -1334,7 +1344,7 @@
 
 ///////////////////////////////////////////////////////////////////
 //
-int MediaCurl::aliveCallback( void *clientp, double /*dltotal*/, double dlnow, 
double /*ultotal*/, double /*ulnow*/ )
+int MediaCurl::aliveCallback( void *clientp, curl_off_t /*dltotal*/, 
curl_off_t dlnow, curl_off_t /*ultotal*/, curl_off_t /*ulnow*/ )
 {
   internal::ProgressData *pdata = reinterpret_cast<internal::ProgressData *>( 
clientp );
   if( pdata )
@@ -1348,7 +1358,7 @@
   return 0;
 }
 
-int MediaCurl::progressCallback( void *clientp, double dltotal, double dlnow, 
double ultotal, double ulnow )
+int MediaCurl::progressCallback( void *clientp, curl_off_t dltotal, curl_off_t 
dlnow, curl_off_t ultotal, curl_off_t ulnow )
 {
   internal::ProgressData *pdata = reinterpret_cast<internal::ProgressData *>( 
clientp );
   if( pdata )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/media/MediaCurl.h 
new/libzypp-17.31.25/zypp/media/MediaCurl.h
--- old/libzypp-17.31.23/zypp/media/MediaCurl.h 2023-07-19 11:53:07.000000000 
+0200
+++ new/libzypp-17.31.25/zypp/media/MediaCurl.h 2023-10-26 14:20:08.000000000 
+0200
@@ -111,9 +111,9 @@
 
   protected:
     /** Callback sending just an alive trigger to the UI, without stats (e.g. 
during metalink download). */
-    static int aliveCallback( void *clientp, double dltotal, double dlnow, 
double ultotal, double ulnow );
+    static int aliveCallback( void *clientp, curl_off_t dltotal, curl_off_t 
dlnow, curl_off_t ultotal, curl_off_t ulnow );
     /** Callback reporting download progress. */
-    static int progressCallback( void *clientp, double dltotal, double dlnow, 
double ultotal, double ulnow );
+    static int progressCallback( void *clientp, curl_off_t dltotal, curl_off_t 
dlnow, curl_off_t ultotal, curl_off_t ulnow );
     static CURL *progressCallback_getcurl( void *clientp );
     /**
      * check the url is supported by the curl library
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/media/MediaMultiCurl.cc 
new/libzypp-17.31.25/zypp/media/MediaMultiCurl.cc
--- old/libzypp-17.31.23/zypp/media/MediaMultiCurl.cc   2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp/media/MediaMultiCurl.cc   2023-11-22 
11:10:07.000000000 +0100
@@ -61,8 +61,8 @@
   void disableCompetition();
 
   void checkdns();
-  void adddnsfd(fd_set &rset, int &maxfd);
-  void dnsevent(fd_set &rset);
+  void adddnsfd( std::vector<curl_waitfd> &waitFds );
+  void dnsevent( const std::vector<curl_waitfd> &waitFds );
 
   int _workerno;
 
@@ -506,20 +506,28 @@
 }
 
 void
-multifetchworker::adddnsfd(fd_set &rset, int &maxfd)
+multifetchworker::adddnsfd(std::vector<curl_waitfd> &waitFds)
 {
   if (_state != WORKER_LOOKUP)
     return;
-  FD_SET(_dnspipe, &rset);
-  if (maxfd < _dnspipe)
-    maxfd = _dnspipe;
+
+  waitFds.push_back (
+        curl_waitfd {
+          .fd = _dnspipe,
+          .events = CURL_WAIT_POLLIN,
+          .revents = 0
+        });
 }
 
 void
-multifetchworker::dnsevent(fd_set &rset)
+multifetchworker::dnsevent( const std::vector<curl_waitfd> &waitFds )
 {
 
-  if (_state != WORKER_LOOKUP || !FD_ISSET(_dnspipe, &rset))
+  bool hasEvent = std::any_of( waitFds.begin (), waitFds.end(),[this]( const 
curl_waitfd &waitfd ){
+    return ( waitfd.fd == _dnspipe && waitfd.revents != 0 );
+  });
+
+  if (_state != WORKER_LOOKUP || !hasEvent)
     return;
   int status;
   while (waitpid(_pid, &status, 0) == -1)
@@ -851,8 +859,8 @@
   std::vector<Url>::iterator urliter = urllist.begin();
   for (;;)
     {
-      fd_set rset, wset, xset;
-      int maxfd, nqueue;
+      // our custom fd's we want to poll
+      std::vector<curl_waitfd> extraWaitFds;
 
       if (_finished)
         {
@@ -891,53 +899,50 @@
           break;
         }
 
-      FD_ZERO(&rset);
-      FD_ZERO(&wset);
-      FD_ZERO(&xset);
-
-      curl_multi_fdset(_multi, &rset, &wset, &xset, &maxfd);
-
       if (_lookupworkers)
         for (std::list<multifetchworker *>::iterator workeriter = 
_workers.begin(); workeriter != _workers.end(); ++workeriter)
-          (*workeriter)->adddnsfd(rset, maxfd);
+          (*workeriter)->adddnsfd( extraWaitFds );
 
-      timeval tv;
       // if we added a new job we have to call multi_perform once
       // to make it show up in the fd set. do not sleep in this case.
-      tv.tv_sec = 0;
-      tv.tv_usec = _havenewjob ? 0 : 200000;
-      if (_sleepworkers && !_havenewjob)
-        {
-          if (_minsleepuntil == 0)
-            {
-              for (std::list<multifetchworker *>::iterator workeriter = 
_workers.begin(); workeriter != _workers.end(); ++workeriter)
-                {
-                  multifetchworker *worker = *workeriter;
-                  if (worker->_state != WORKER_SLEEP)
-                    continue;
-                  if (!_minsleepuntil || _minsleepuntil > worker->_sleepuntil)
-                    _minsleepuntil = worker->_sleepuntil;
-                }
-            }
-          double sl = _minsleepuntil - currentTime();
-          if (sl < 0)
-            {
-              sl = 0;
-              _minsleepuntil = 0;
-            }
-          if (sl < .2)
-            tv.tv_usec = sl * 1000000;
+      int timeoutMs = _havenewjob ? 0 : 200;
+      if (_sleepworkers && !_havenewjob) {
+        if (_minsleepuntil == 0) {
+          for (std::list<multifetchworker *>::iterator workeriter = 
_workers.begin(); workeriter != _workers.end(); ++workeriter) {
+            multifetchworker *worker = *workeriter;
+            if (worker->_state != WORKER_SLEEP)
+              continue;
+            if (!_minsleepuntil || _minsleepuntil > worker->_sleepuntil)
+              _minsleepuntil = worker->_sleepuntil;
+          }
         }
-      int r = select(maxfd + 1, &rset, &wset, &xset, &tv);
+        double sl = _minsleepuntil - currentTime();
+        if (sl < 0) {
+          sl = 0;
+          _minsleepuntil = 0;
+        }
+        if (sl < .2)
+          timeoutMs = sl * 1000;
+      }
+
+      int r = 0;
+#if CURLVERSION_AT_LEAST(7,66,0)
+      CURLMcode mcode = curl_multi_poll( _multi, extraWaitFds.data(), 
extraWaitFds.size(), timeoutMs, &r );
+#else
+      CURLMcode mcode = curl_multi_wait( _multi, extraWaitFds.data(), 
extraWaitFds.size(), timeoutMs, &r );
+#endif
+      if ( mcode != CURLM_OK ) {
+        ZYPP_THROW(MediaCurlException(_baseurl, "curl_multi_poll() failed", 
str::Str() << "curl_multi_poll() returned CurlMcode: " << mcode ));
+      }
       if (r == -1 && errno != EINTR)
-        ZYPP_THROW(MediaCurlException(_baseurl, "select() failed", "unknown 
error"));
+        ZYPP_THROW(MediaCurlException(_baseurl, "curl_multi_poll() failed", 
"unknown error"));
       if (r != 0 && _lookupworkers)
         for (std::list<multifetchworker *>::iterator workeriter = 
_workers.begin(); workeriter != _workers.end(); ++workeriter)
           {
             multifetchworker *worker = *workeriter;
             if (worker->_state != WORKER_LOOKUP)
               continue;
-            (*workeriter)->dnsevent(rset);
+            (*workeriter)->dnsevent( extraWaitFds );
             if (worker->_state != WORKER_LOOKUP)
               _lookupworkers--;
           }
@@ -990,6 +995,7 @@
 
       // collect all curl results, reschedule new jobs
       CURLMsg *msg;
+      int nqueue;
       while ((msg = curl_multi_info_read(_multi, &nqueue)) != 0)
         {
           if (msg->msg != CURLMSG_DONE)
@@ -1262,7 +1268,7 @@
 // here we try to suppress all progress coming from a metalink download
 // bsc#1021291: Nevertheless send alive trigger (without stats), so UIs
 // are able to abort a hanging metalink download via callback response.
-int MediaMultiCurl::progressCallback( void *clientp, double dltotal, double 
dlnow, double ultotal, double ulnow)
+int MediaMultiCurl::progressCallback( void *clientp, curl_off_t dltotal, 
curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
 {
   CURL *_curl = MediaCurl::progressCallback_getcurl(clientp);
   if (!_curl)
@@ -1306,10 +1312,10 @@
       // this is a metalink file change the expected filesize
       MediaCurl::resetExpectedFileSize( clientp, ByteCount( 2, ByteCount::MB) 
);
       // we're downloading the metalink file. Just trigger aliveCallbacks
-      curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, 
&MediaCurl::aliveCallback);
+      curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, 
&MediaCurl::aliveCallback);
       return MediaCurl::aliveCallback(clientp, dltotal, dlnow, ultotal, ulnow);
     }
-  curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, 
&MediaCurl::progressCallback);
+  curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, 
&MediaCurl::progressCallback);
   return MediaCurl::progressCallback(clientp, dltotal, dlnow, ultotal, ulnow);
 }
 
@@ -1366,7 +1372,7 @@
   // change header to include Accept: metalink
   curl_easy_setopt(_curl, CURLOPT_HTTPHEADER, _customHeadersMetalink);
   // change to our own progress funcion
-  curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, &progressCallback);
+  curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, &progressCallback);
   curl_easy_setopt(_curl, CURLOPT_PRIVATE, (*file) );  // important to pass 
the FILE* explicitly (passing through varargs)
   try
     {
@@ -1504,7 +1510,7 @@
             ZYPP_THROW(MediaWriteException(destNew));
 
           // use the default progressCallback
-          curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, 
&MediaCurl::progressCallback);
+          curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, 
&MediaCurl::progressCallback);
           MediaCurl::doGetFileCopyFile(srcFile, dest, file, report, options | 
OPTION_NO_REPORT_START);
         }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/media/MediaMultiCurl.h 
new/libzypp-17.31.25/zypp/media/MediaMultiCurl.h
--- old/libzypp-17.31.23/zypp/media/MediaMultiCurl.h    2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp/media/MediaMultiCurl.h    2023-10-26 
14:20:08.000000000 +0200
@@ -65,7 +65,7 @@
 
   virtual void setupEasy() override;
   void checkFileDigest(Url &url, FILE *fp, MediaBlockList *blklist) const;
-  static int progressCallback( void *clientp, double dltotal, double dlnow, 
double ultotal, double ulnow );
+  static int progressCallback(void *clientp, curl_off_t dltotal, curl_off_t 
dlnow, curl_off_t ultotal, curl_off_t ulnow );
 
 private:
   // the custom headers from MediaCurl plus a "Accept: metalink" header
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/repo/Downloader.cc 
new/libzypp-17.31.25/zypp/repo/Downloader.cc
--- old/libzypp-17.31.23/zypp/repo/Downloader.cc        2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp/repo/Downloader.cc        2023-11-03 
17:08:35.000000000 +0100
@@ -24,6 +24,17 @@
 
 namespace zypp
 {
+  namespace env {
+    bool ZYPP_REPOMD_WITH_PKCS7()
+    {
+      static bool val = [](){
+        const char * env = getenv("ZYPP_REPOMD_WITH_PKCS7");
+        return( env && zypp::str::strToBool( env, true ) );
+      }();
+      return val;
+    }
+  } // namespace env
+
 namespace repo
 {
   class ExtraSignatureFileChecker : public SignatureFileChecker
@@ -148,6 +159,10 @@
   setMediaSetAccess( media_r );
   enqueue( OnMediaLocation( sigpath, 1 ).setOptional( true ).setDownloadSize( 
ByteCount( 20, ByteCount::MB ) ) );
   enqueue( OnMediaLocation( keypath, 1 ).setOptional( true ).setDownloadSize( 
ByteCount( 20, ByteCount::MB ) ) );
+  if ( env::ZYPP_REPOMD_WITH_PKCS7() ) {
+    Pathname pkcs7path = masterIndex_r.extend( ".pkcs7" );
+    enqueue( OnMediaLocation( pkcs7path, 1 ).setOptional( true 
).setDownloadSize( ByteCount( 20, ByteCount::MB ) ) );
+  }
   start( destdir_r );
   reset();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp/repo/yum/Downloader.cc 
new/libzypp-17.31.25/zypp/repo/yum/Downloader.cc
--- old/libzypp-17.31.23/zypp/repo/yum/Downloader.cc    2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp/repo/yum/Downloader.cc    2023-11-29 
16:10:08.000000000 +0100
@@ -26,6 +26,26 @@
 
 namespace zypp
 {
+  namespace env {
+    bool ZYPP_REPOMD_WITH_OTHER()
+    {
+      static bool val = [](){
+        const char * env = getenv("ZYPP_REPOMD_WITH_OTHER");
+        return( env && zypp::str::strToBool( env, true ) );
+      }();
+      return val;
+    }
+
+    bool ZYPP_REPOMD_WITH_FILELISTS()
+    {
+      static bool val = [](){
+        const char * env = getenv("ZYPP_REPOMD_WITH_FILELISTS");
+        return( env && zypp::str::strToBool( env, true ) );
+      }();
+      return val;
+    }
+  } // namespace env
+
 namespace repo
 {
 namespace yum
@@ -118,7 +138,10 @@
 #endif
 
       // filter well known resource types
-      if ( basetype == "other" || basetype == "filelists" )
+      if ( basetype == "other" && not env::ZYPP_REPOMD_WITH_OTHER() )
+        return true;   // skip it
+
+      if ( basetype == "filelists" && not env::ZYPP_REPOMD_WITH_FILELISTS() )
         return true;   // skip it
 
       // filter localized susedata
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libzypp-17.31.23/zypp/target/RpmPostTransCollector.cc 
new/libzypp-17.31.25/zypp/target/RpmPostTransCollector.cc
--- old/libzypp-17.31.23/zypp/target/RpmPostTransCollector.cc   2023-09-21 
11:40:08.000000000 +0200
+++ new/libzypp-17.31.25/zypp/target/RpmPostTransCollector.cc   2023-11-29 
17:50:07.000000000 +0100
@@ -234,6 +234,7 @@
             str::Format fmtScriptFailedMsg { "warning: %%posttrans(%1%) 
scriptlet failed, exit status %2%\n" };
             str::Format fmtPosttrans { "%%posttrans(%1%)" };
 
+            rpm::librpmDb::db_const_iterator it;  // Open DB only once
             while ( ! _scripts->empty() )
             {
               const auto &scriptPair = _scripts->front();
@@ -242,9 +243,8 @@
               startNewScript( fmtPosttrans % pkgident );
 
               int npkgs = 0;
-              rpm::librpmDb::db_const_iterator it;
               for ( it.findByName( scriptPair.second ); *it; ++it )
-                npkgs++;
+                ++npkgs;
 
               MIL << "EXECUTE posttrans: " << script << " with argument: " << 
npkgs << endl;
               ExternalProgram::Arguments cmd {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-core/Digest.cc 
new/libzypp-17.31.25/zypp-core/Digest.cc
--- old/libzypp-17.31.23/zypp-core/Digest.cc    2023-07-19 11:53:07.000000000 
+0200
+++ new/libzypp-17.31.25/zypp-core/Digest.cc    2023-10-27 14:00:08.000000000 
+0200
@@ -13,15 +13,20 @@
 */
 
 #include <cstdio> // snprintf
+
 #include <openssl/evp.h>
 #include <openssl/conf.h>
+#if OPENSSL_API_LEVEL < 30000
 #include <openssl/engine.h>
+#endif
+
 #include <string>
 #include <string.h>
 
 #include <iostream>
 #include <sstream>
 
+#include <zypp-core/AutoDispose.h>
 #include <zypp-core/Digest.h>
 #include <zypp-core/base/PtrTypes.h>
 
@@ -59,8 +64,11 @@
         ~P();
 
         EvpDataPtr mdctx;
-
+#if OPENSSL_API_LEVEL >= 30000
+        AutoDispose<EVP_MD *> md;
+#else
         const EVP_MD *md;
+#endif
         unsigned char md_value[EVP_MAX_MD_SIZE];
         unsigned md_len;
         zypp::ByteCount bytesHashed;
@@ -93,16 +101,32 @@
     {
       if(!openssl_digests_added)
       {
+#if OPENSSL_API_LEVEL >= 30000
+        // openssl 3.0 does not use engines anymore, instead we fetch 
algorithms via a new API
+        // also it seems initialization is implicit, i'm not sure if that call 
here is even required.
+        OPENSSL_init_crypto( OPENSSL_INIT_LOAD_CONFIG | 
OPENSSL_INIT_ADD_ALL_DIGESTS, nullptr );
+#else
+# if OPENSSL_API_LEVEL >= 10100
+        OPENSSL_init_crypto( OPENSSL_INIT_LOAD_CONFIG, nullptr );
+# else
         OPENSSL_config(NULL);
+# endif
         ENGINE_load_builtin_engines();
         ENGINE_register_all_complete();
         OpenSSL_add_all_digests();
+#endif
         openssl_digests_added = true;
       }
 
       if(!mdctx)
       {
+#if OPENSSL_API_LEVEL >= 30000
+        // this fetches the new provider based algorithms, returned objects 
have to be free'd
+        // i wonder if we could cache the providers instead of querying them 
for every Digest instance....
+        md = AutoDispose<EVP_MD *>( EVP_MD_fetch (nullptr, name.c_str(), 
nullptr), EVP_MD_free );
+#else
         md = EVP_get_digestbyname(name.c_str());
+#endif
         if(!md)
           return false;
 
@@ -130,6 +154,9 @@
 
     void Digest::P::cleanup()
     {
+#if OPENSSL_API_LEVEL >= 30000
+      md.reset();
+#endif
       mdctx.reset();
       finalized = false;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-core/ExternalProgram.cc 
new/libzypp-17.31.25/zypp-core/ExternalProgram.cc
--- old/libzypp-17.31.23/zypp-core/ExternalProgram.cc   2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp-core/ExternalProgram.cc   2023-11-22 
11:10:07.000000000 +0100
@@ -375,17 +375,18 @@
           do
           {
             /* Watch inputFile to see when it has input. */
-            fd_set rfds;
-            FD_ZERO( &rfds );
-            FD_SET( inputfileFd, &rfds );
+            GPollFD rfd;
+            rfd.fd = inputfileFd;
+            rfd.events =  G_IO_IN | G_IO_HUP | G_IO_ERR;
+            rfd.revents = 0;
 
-            /* Wait up to 1 seconds. */
-            struct timeval tv;
-            tv.tv_sec  = (delay < 0 ? 1 : 0);
-            tv.tv_usec = (delay < 0 ? 0 : delay*100000);
+            // each try increases our wait by 0.1 seconds, until we have
+            // 1 sec max timout.
+            gint timeout = delay < 0 ? 1000 : delay*100;
             if ( delay >= 0 && ++delay > 9 )
               delay = -1;
-            int retval = select( inputfileFd+1, &rfds, NULL, NULL, &tv );
+
+            int retval = g_poll( &rfd, 1, timeout );
 
             if ( retval == -1 )
             {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-core/base/IOTools.h 
new/libzypp-17.31.25/zypp-core/base/IOTools.h
--- old/libzypp-17.31.23/zypp-core/base/IOTools.h       2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp-core/base/IOTools.h       2023-11-22 
11:10:07.000000000 +0100
@@ -74,7 +74,7 @@
   };
 
   using timeout_type = size_t;
-  static const timeout_type no_timeout = static_cast<timeout_type>(-1);
+  static constexpr timeout_type no_timeout = static_cast<timeout_type>(-1);
 
   /*!
    * Reads data from \a file until it finds a seperator \a c, hits the end of 
the file or times out.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-curl/ng/network/request.cc 
new/libzypp-17.31.25/zypp-curl/ng/network/request.cc
--- old/libzypp-17.31.23/zypp-curl/ng/network/request.cc        2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp-curl/ng/network/request.cc        2023-10-26 
14:20:08.000000000 +0200
@@ -238,11 +238,20 @@
       {
 #if CURLVERSION_AT_LEAST(7,19,4)
         // restrict following of redirections from https to https only
-        if ( _url.getHost() == "download.opensuse.org" )
+        if ( _url.getHost() == "download.opensuse.org" ) {
+#if CURLVERSION_AT_LEAST(7,85,0)
+          setCurlOption( CURLOPT_REDIR_PROTOCOLS_STR, "http,https" );
+#else
           setCurlOption( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | 
CURLPROTO_HTTPS );
-        else
+#endif
+        } else {
+#if CURLVERSION_AT_LEAST(7,85,0)
+          setCurlOption( CURLOPT_REDIR_PROTOCOLS_STR, "https" );
+#else
           setCurlOption( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
 #endif
+        }
+#endif // #if CURLVERSION_AT_LEAST(7,19,4)
 
         if( locSet.verifyPeerEnabled() ||
              locSet.verifyHostEnabled() )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-tui/output/Out.cc 
new/libzypp-17.31.25/zypp-tui/output/Out.cc
--- old/libzypp-17.31.23/zypp-tui/output/Out.cc 2023-07-19 11:53:07.000000000 
+0200
+++ new/libzypp-17.31.25/zypp-tui/output/Out.cc 2023-11-13 12:40:07.000000000 
+0100
@@ -71,7 +71,7 @@
 
     // else: less boring
     std::string tag( zypp::str::Str() << '<' << percentHint << "%>" );
-    pc = ( pc > tag.size() ? pc - tag.size() : 0 );
+    pc = pc > tag.size() ? (diff - tag.size()) * percentHint / 100 : 0;
     return zypp::str::Str() << l << std::string( pc, '.' ) << tag << 
std::string( diff-pc-tag.size(), '=' ) << r;
   }
   else if ( diff < 0 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.23/zypp-tui/output/OutNormal.cc 
new/libzypp-17.31.25/zypp-tui/output/OutNormal.cc
--- old/libzypp-17.31.23/zypp-tui/output/OutNormal.cc   2023-07-19 
11:53:07.000000000 +0200
+++ new/libzypp-17.31.25/zypp-tui/output/OutNormal.cc   2023-11-13 
12:50:08.000000000 +0100
@@ -262,7 +262,7 @@
     outstr.rhs << '[' ;
 
   std::string outline( outstr.get( termwidth() ) );
-  cout << (ColorContext::HIGHLIGHT << outline) << PROGRESS_FLUSH;
+  cout << outline << PROGRESS_FLUSH;
   // no _oneup if CRUSHed // _oneup = (outline.length() > termwidth());
 
   _newline = false;
@@ -303,7 +303,7 @@
   outstr.rhs << ']';
 
   std::string outline( outstr.get( termwidth() ) );
-  cout << (ColorContext::HIGHLIGHT << outline) << PROGRESS_FLUSH;
+  cout << outline << PROGRESS_FLUSH;
   // no _oneup if CRUSHed // _oneup = (outline.length() > termwidth());
   _newline = false;
 }
@@ -317,36 +317,34 @@
     cout << ColorContext::MSG_STATUS;
 
   TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '.' );
-  ColorStream lhs { outstr.lhs.stream(), ColorContext::HIGHLIGHT };
-  ColorStream rhs { outstr.rhs.stream(), ColorContext::HIGHLIGHT };
   if ( _isatty )
   {
     if( _oneup )
       cout << ansi::tty::clearLN << ansi::tty::cursorUP;
     cout << ansi::tty::clearLN;
-    lhs << _("Retrieving:") << " ";
+    outstr.lhs << _("Retrieving:") << " ";
     if ( verbosity() == DEBUG )
-      lhs << uri;
+      outstr.lhs << uri;
     else
-      lhs << zypp::Pathname(uri.getPathName()).basename();
-    lhs << ' ';
-    rhs << '[';
+      outstr.lhs << zypp::Pathname(uri.getPathName()).basename();
+    outstr.lhs << ' ';
+    outstr.rhs << '[';
     if ( zypp::indeterminate( error ) )
       // Translator: download progress bar result: "........[not found]"
-      rhs << CHANGEString(_("not found") );
+      outstr.rhs << CHANGEString(_("not found") );
     else if ( error )
       // Translator: download progress bar result: "............[error]"
-      rhs << NEGATIVEString(_("error") );
+      outstr.rhs << NEGATIVEString(_("error") );
     else
       // Translator: download progress bar result: ".............[done]"
-      rhs << _("done");
+      outstr.rhs << _("done");
   }
   else
-    rhs << ( zypp::indeterminate( error ) ? _("not found") : ( error ? 
_("error") : _("done") ) );
+    outstr.rhs << ( zypp::indeterminate( error ) ? _("not found") : ( error ? 
_("error") : _("done") ) );
 
   if ( rate > 0 )
-    rhs << " (" << zypp::ByteCount(rate) << "/s)";
-  rhs << ']';
+    outstr.rhs << " (" << zypp::ByteCount(rate) << "/s)";
+  outstr.rhs << ']';
 
   std::string outline( outstr.get( termwidth() ) );
   cout << outline << endl << std::flush;

Reply via email to