- Let 'zypper clean' keep the raw metadata cache of CD/DVD based
authorMichael Andres <ma@suse.de>
Tue, 24 Feb 2009 15:36:08 +0000 (16:36 +0100)
committerMichael Andres <ma@suse.de>
Tue, 24 Feb 2009 15:37:53 +0000 (16:37 +0100)
  repositories. We'd need the CD/DVD again to recreate the data.
  If this is actually desired, explicitly remove an recreate the
  CD/DVD based repository. (bnc #476429).

src/repos.cc

index aa9dabb..cdbc412 100644 (file)
@@ -1157,10 +1157,20 @@ void clean_repos(Zypper & zypper)
        }
         if( clean_raw_metadata )
         {
-            zypper.out().info(boost::str(format(
-                _("Cleaning raw metadata cache for '%s'.")) % repo.alias ()),
-                Out::HIGH);
-            manager.cleanMetadata(repo);
+            std::string scheme( repo.url().getScheme() );
+            if ( ! ( scheme == "cd" || scheme == "dvd" ) )
+            {
+                zypper.out().info(boost::str(format(
+                    _("Cleaning raw metadata cache for '%s'.")) % repo.alias ()),
+                    Out::HIGH);
+                manager.cleanMetadata(repo);
+            }
+            else
+            {
+                zypper.out().info(boost::str(format(
+                    _("Keeping raw metadata cache for %s '%s'.")) %scheme %repo.alias ()),
+                    Out::HIGH);
+            }
         }
         if( clean_packages )
        {