Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libzypp for openSUSE:Factory checked 
in at 2022-11-09 12:56:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libzypp (Old)
 and      /work/SRC/openSUSE:Factory/.libzypp.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libzypp"

Wed Nov  9 12:56:36 2022 rev:466 rq:1034568 version:17.31.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes  2022-10-18 
12:44:50.269701598 +0200
+++ /work/SRC/openSUSE:Factory/.libzypp.new.1597/libzypp.changes        
2022-11-09 12:56:49.192139699 +0100
@@ -1,0 +2,8 @@
+Mon Nov  7 13:09:46 CET 2022 - m...@suse.de
+
+- Create '.no_auto_prune' in the package cache dir to prevent auto
+  cleanup of orphaned repositories (bsc#1204956)
+- properly reset range requests (bsc#1204548)
+- version 17.31.5 (22)
+
+-------------------------------------------------------------------

Old:
----
  libzypp-17.31.4.tar.bz2

New:
----
  libzypp-17.31.5.tar.bz2

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

Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.DGLZaG/_old  2022-11-09 12:56:49.812143194 +0100
+++ /var/tmp/diff_new_pack.DGLZaG/_new  2022-11-09 12:56:49.816143218 +0100
@@ -43,7 +43,7 @@
 %bcond_with enable_preview_single_rpmtrans_as_default_for_zypper
 
 Name:           libzypp
-Version:        17.31.4
+Version:        17.31.5
 Release:        0
 License:        GPL-2.0-or-later
 URL:            https://github.com/openSUSE/libzypp

++++++ libzypp-17.31.4.tar.bz2 -> libzypp-17.31.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/VERSION.cmake 
new/libzypp-17.31.5/VERSION.cmake
--- old/libzypp-17.31.4/VERSION.cmake   2022-10-17 13:57:32.000000000 +0200
+++ new/libzypp-17.31.5/VERSION.cmake   2022-11-07 13:14:43.000000000 +0100
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "22")
 SET(LIBZYPP_MINOR "31")
-SET(LIBZYPP_PATCH "4")
+SET(LIBZYPP_PATCH "5")
 #
-# LAST RELEASED: 17.31.4 (22)
+# LAST RELEASED: 17.31.5 (22)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/package/libzypp.changes 
new/libzypp-17.31.5/package/libzypp.changes
--- old/libzypp-17.31.4/package/libzypp.changes 2022-10-17 13:57:32.000000000 
+0200
+++ new/libzypp-17.31.5/package/libzypp.changes 2022-11-07 13:14:43.000000000 
+0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Mon Nov  7 13:09:46 CET 2022 - m...@suse.de
+
+- Create '.no_auto_prune' in the package cache dir to prevent auto
+  cleanup of orphaned repositories (bsc#1204956)
+- properly reset range requests (bsc#1204548)
+- version 17.31.5 (22)
+
+-------------------------------------------------------------------
 Mon Oct 17 12:53:40 CEST 2022 - m...@suse.de
 
 - Do not clean up MediaSetAccess before using the geoip file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/po/fr.po new/libzypp-17.31.5/po/fr.po
--- old/libzypp-17.31.4/po/fr.po        2022-07-07 14:19:44.000000000 +0200
+++ new/libzypp-17.31.5/po/fr.po        2022-11-01 02:22:22.000000000 +0100
@@ -20,8 +20,8 @@
 "Project-Id-Version: zypp.fr\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-03-14 15:21+0100\n"
-"PO-Revision-Date: 2022-04-02 20:12+0000\n"
-"Last-Translator: Lucie Charrier <c.ch...@free.fr>\n"
+"PO-Revision-Date: 2022-11-01 01:13+0000\n"
+"Last-Translator: Antoine Belvire <antoine.belv...@opensuse.org>\n"
 "Language-Team: French <https://l10n.opensuse.org/projects/libzypp/master/fr/>"
 "\n"
 "Language: fr\n"
@@ -4644,7 +4644,7 @@
 
 #: zypp/target/rpm/RpmDb.cc:1273
 msgid "Package payload is not signed!"
-msgstr ""
+msgstr "Le contenu du paquet n'est pas sign????!"
 
 # TLABEL sw_single_2002_01_04_0147__11
 #. Translator: %s = name of an rpm package. A list of diffs follows
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/zypp/RepoManager.cc 
new/libzypp-17.31.5/zypp/RepoManager.cc
--- old/libzypp-17.31.4/zypp/RepoManager.cc     2022-10-17 11:02:34.000000000 
+0200
+++ new/libzypp-17.31.5/zypp/RepoManager.cc     2022-11-04 12:52:36.000000000 
+0100
@@ -455,6 +455,10 @@
     };
     
////////////////////////////////////////////////////////////////////////////
 
+    /** bsc#1204956: Tweak to prevent auto pruning package caches. */
+    inline bool autoPruneInDir( const Pathname & path_r )
+    { return not PathInfo(path_r/".no_auto_prune").isExist(); }
+
   } // namespace
   ///////////////////////////////////////////////////////////////////
 
@@ -606,7 +610,7 @@
 
     void cleanMetadata( const RepoInfo & info, OPT_PROGRESS );
 
-    void cleanPackages( const RepoInfo & info, OPT_PROGRESS );
+    void cleanPackages( const RepoInfo & info, OPT_PROGRESS, bool isAutoClean 
= false );
 
     void buildCache( const RepoInfo & info, CacheBuildPolicy policy, 
OPT_PROGRESS );
 
@@ -905,9 +909,11 @@
       cleanupNonRepoMetadtaFolders( _options.repoSolvCachePath,
                                     Pathname::assertprefix( _options.rootDir, 
ZConfig::instance().builtinRepoSolvfilesPath() ),
                                     repoEscAliases );
-      cleanupNonRepoMetadtaFolders( _options.repoPackagesCachePath,
-                                    Pathname::assertprefix( _options.rootDir, 
ZConfig::instance().builtinRepoPackagesPath() ),
-                                    repoEscAliases );
+      // bsc#1204956: Tweak to prevent auto pruning package caches
+      if ( autoPruneInDir( _options.repoPackagesCachePath ) )
+        cleanupNonRepoMetadtaFolders( _options.repoPackagesCachePath,
+                                      Pathname::assertprefix( 
_options.rootDir, ZConfig::instance().builtinRepoPackagesPath() ),
+                                      repoEscAliases );
     }
     MIL << "end construct known repos" << endl;
   }
@@ -1282,12 +1288,15 @@
   }
 
 
-  void RepoManager::Impl::cleanPackages( const RepoInfo & info, const 
ProgressData::ReceiverFnc & progressfnc )
+  void RepoManager::Impl::cleanPackages( const RepoInfo & info, const 
ProgressData::ReceiverFnc & progressfnc, bool isAutoClean_r )
   {
     ProgressData progress(100);
     progress.sendTo(progressfnc);
 
-    filesystem::recursive_rmdir(packagescache_path_for_repoinfo(_options, 
info));
+    // bsc#1204956: Tweak to prevent auto pruning package caches
+    const Pathname & rpc { packagescache_path_for_repoinfo(_options, info) };
+    if ( not isAutoClean_r || autoPruneInDir( rpc.dirname() ) )
+      filesystem::recursive_rmdir( rpc );
     progress.toMax();
   }
 
@@ -1861,7 +1870,7 @@
           cleanCache( todelete, cSubprogrcv);
         // now delete metadata (#301037)
         cleanMetadata( todelete, mSubprogrcv );
-        cleanPackages( todelete, pSubprogrcv );
+        cleanPackages( todelete, pSubprogrcv, true/*isAutoClean*/ );
         reposManip().erase(todelete);
         MIL << todelete.alias() << " successfully deleted." << endl;
         HistoryLog(_options.rootDir).removeRepository(todelete);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/zypp/media/MediaCurl.cc 
new/libzypp-17.31.5/zypp/media/MediaCurl.cc
--- old/libzypp-17.31.4/zypp/media/MediaCurl.cc 2022-10-14 15:34:44.000000000 
+0200
+++ new/libzypp-17.31.5/zypp/media/MediaCurl.cc 2022-10-24 16:41:26.000000000 
+0200
@@ -972,94 +972,58 @@
     ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
   }
 
-  // instead of returning no data with NOBODY, we return
+  // If no head requests allowed (?head_requests=no):
+  // Instead of returning no data with NOBODY, we return
   // little data, that works with broken servers, and
   // works for ftp as well, because retrieving only headers
   // ftp will return always OK code ?
   // See http://curl.haxx.se/docs/knownbugs.html #58
-  if (  (_url.getScheme() == "http" ||  _url.getScheme() == "https") &&
-        _settings.headRequestsAllowed() )
-    ret = curl_easy_setopt( _curl, CURLOPT_NOBODY, 1L );
-  else
-    ret = curl_easy_setopt( _curl, CURLOPT_RANGE, "0-1" );
+  /// RAII Handler for temp. setting a head/range request
+  struct TempSetHeadRequest
+  {
+    TempSetHeadRequest( CURL * curl_r, bool doHttpHeadRequest_r )
+    : _curl { curl_r }
+    , _doHttpHeadRequest { doHttpHeadRequest_r }
+    {
+      if ( _doHttpHeadRequest ) {
+        curl_easy_setopt( _curl, CURLOPT_NOBODY, 1L );
+      } else {
+        curl_easy_setopt( _curl, CURLOPT_RANGE, "0-1" );
+      }
+    }
+    ~TempSetHeadRequest() {
+      if ( _doHttpHeadRequest ) {
+        curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
+        /* yes, this is why we never got to get NOBODY working before,
+         because setting it changes this option too, and we also*
+         need to reset it
+         See: http://curl.haxx.se/mail/archive-2005-07/0073.html
+         */
+        curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
+      } else {
+        curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
+      }
+    }
+  private:
+    CURL * _curl;
+    bool   _doHttpHeadRequest;
+  } _guard( _curl, (_url.getScheme() == "http" || _url.getScheme() == "https") 
&& _settings.headRequestsAllowed() );
 
-  if ( ret != 0 ) {
-    curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
-    curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
-    /* yes, this is why we never got to get NOBODY working before,
-       because setting it changes this option too, and we also
-       need to reset it
-       See: http://curl.haxx.se/mail/archive-2005-07/0073.html
-    */
-    curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
-    ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-  }
 
   AutoFILE file { ::fopen( "/dev/null", "w" ) };
   if ( !file ) {
       ERR << "fopen failed for /dev/null" << endl;
-      curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
-      curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
-      /* yes, this is why we never got to get NOBODY working before,
-       because setting it changes this option too, and we also
-       need to reset it
-       See: http://curl.haxx.se/mail/archive-2005-07/0073.html
-      */
-      curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
-      if ( ret != 0 ) {
-          ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-      }
       ZYPP_THROW(MediaWriteException("/dev/null"));
   }
 
   ret = curl_easy_setopt( _curl, CURLOPT_WRITEDATA, (*file) );
   if ( ret != 0 ) {
-      std::string err( _curlError);
-      curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
-      curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
-      /* yes, this is why we never got to get NOBODY working before,
-       because setting it changes this option too, and we also
-       need to reset it
-       See: http://curl.haxx.se/mail/archive-2005-07/0073.html
-      */
-      curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
-      if ( ret != 0 ) {
-          ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-      }
-      ZYPP_THROW(MediaCurlSetOptException(url, err));
+    ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
   }
 
   CURLcode ok = curl_easy_perform( _curl );
   MIL << "perform code: " << ok << " [ " << curl_easy_strerror(ok) << " ]" << 
endl;
 
-  // reset curl settings
-  if (  _url.getScheme() == "http" ||  _url.getScheme() == "https" )
-  {
-    curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
-    if ( ret != 0 ) {
-      ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-    }
-
-    /* yes, this is why we never got to get NOBODY working before,
-       because setting it changes this option too, and we also
-       need to reset it
-       See: http://curl.haxx.se/mail/archive-2005-07/0073.html
-    */
-    curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L);
-    if ( ret != 0 ) {
-      ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-    }
-
-  }
-  else
-  {
-    // for FTP we set different options
-    curl_easy_setopt( _curl, CURLOPT_RANGE, NULL);
-    if ( ret != 0 ) {
-      ZYPP_THROW(MediaCurlSetOptException(url, _curlError));
-    }
-  }
-
   // as we are not having user interaction, the user can't cancel
   // the file existence checking, a callback or timeout return code
   // will be always a timeout.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.31.4/zypp/media/MediaMultiCurl.cc 
new/libzypp-17.31.5/zypp/media/MediaMultiCurl.cc
--- old/libzypp-17.31.4/zypp/media/MediaMultiCurl.cc    2022-10-14 
15:34:44.000000000 +0200
+++ new/libzypp-17.31.5/zypp/media/MediaMultiCurl.cc    2022-11-08 
11:32:25.000000000 +0100
@@ -1502,6 +1502,9 @@
           file = fopen((*destNew).c_str(), "w+e");
           if (!file)
             ZYPP_THROW(MediaWriteException(destNew));
+
+          // use the default progressCallback
+          curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, 
&MediaCurl::progressCallback);
           MediaCurl::doGetFileCopyFile(srcFile, dest, file, report, options | 
OPTION_NO_REPORT_START);
         }
     }

Reply via email to