fixed media reattaching
authorJiri Srain <jsrain@suse.cz>
Fri, 3 Mar 2006 15:51:08 +0000 (15:51 +0000)
committerJiri Srain <jsrain@suse.cz>
Fri, 3 Mar 2006 15:51:08 +0000 (15:51 +0000)
zypp/Source.cc
zypp/Source.h
zypp/SourceManager.cc
zypp/SourceManager.h
zypp/source/MediaSet.cc
zypp/source/MediaSet.h
zypp/source/SourceImpl.cc
zypp/source/SourceImpl.h

index f3221f62c680414d825114cc79885f9d2f2d831e..a78ca22ec36582ec9bbf7709173e1117c4d4d911 100644 (file)
@@ -141,9 +141,8 @@ namespace zypp
   void Source_Ref::release()
   { _pimpl->release(); }
 
-  void Source_Ref::reattach(const Pathname &attach_point,
-                           bool temporary)
-  { _pimpl->reattach(attach_point, temporary); }
+  void Source_Ref::reattach(const Pathname &attach_point)
+  { _pimpl->reattach(attach_point); }
   
   media::MediaVerifierRef Source_Ref::verifier(unsigned media_nr)
   { return _pimpl->verifier(media_nr); }
index 615b60717f476dd8ba78beb5ba96043050c7e6ba..b869adf21a9bb6eeba025fd2ff151e38c74f412e 100644 (file)
@@ -144,8 +144,7 @@ namespace zypp
      *
      * \throws Exception
      */
-    void reattach(const Pathname &attach_point,
-                 bool temporary = false);
+    void reattach(const Pathname &attach_point);
 
     /**
      * Provide a media verifier suitable for the given media number
index 0d4615f87ef9a978eacea6efa598e704a7fd9aa7..56429f3d1452773118d046e628570b47a7609a6c 100644 (file)
@@ -110,13 +110,12 @@ namespace zypp
     }
   }
 
-  void SourceManager::reattachSources(const Pathname &attach_point,
-                                     bool temporary)
+  void SourceManager::reattachSources(const Pathname &attach_point)
   {
     for (SourceMap::iterator it = _sources.begin();
         it != _sources.end(); it++)
     {
-      it->second->reattach(attach_point, temporary);
+      it->second->reattach(attach_point);
     }
   }
 
index afb7afa65896f64ac2f107a1622c322e1d30be54..75811cfbde585c5006a02ddee7eae16f3dfec600 100644 (file)
@@ -172,8 +172,7 @@ namespace zypp
      *
      * \throws Exception
      */
-    void reattachSources(const Pathname &attach_point,
-                        bool temporary = false);
+    void reattachSources(const Pathname &attach_point);
 
     /**
      * Disable all registered sources
index f3b810cf236ab73ee67dcebbcde811e49bdc8dea..62c8be129a66d5cadabc9dde692d5b60edaab955 100644 (file)
@@ -39,17 +39,18 @@ namespace zypp
       medias[medianr] = media_id;
     }
 
-    void MediaSet::reattach(const Pathname &attach_point,
-                           bool temporary)
+    void MediaSet::reattach(const Pathname &attach_point)
     {
       media::MediaManager media_mgr;
+      media_mgr.setAttachPrefix(attach_point);
       for (MediaMap::iterator it = medias.begin(); it != medias.end(); it++)
       {
        Url url = media_mgr.url(it->second);
        std::string scheme = url.getScheme();
        if (scheme == "http" || scheme == "ftp" || scheme == "https" || scheme == "ftps")
        {
-         media_mgr.reattach(it->second, attach_point, temporary);
+         media_mgr.release(it->second);
+         media_mgr.attach(it->second);
        }
       }
     }
index 16fd510131b6a6bee9b024066f2894a9457fd965..650f6f18bbcdd1e985ff79fb8b5abe00613fd210 100644 (file)
@@ -52,8 +52,7 @@ namespace zypp
        *
        * \throws Exception
        */
-      void reattach(const Pathname &attach_point,
-                   bool temporary = false);
+      void reattach(const Pathname &attach_point);
       /** Reset the handles to the medias */
       void reset();
       /**
index 9e3ab42b47deead748f56f468b4030f061319eaa..02b78654d9503a30fb450123fa6ef10ff08d65e7 100644 (file)
@@ -235,11 +235,10 @@ namespace zypp
       media::MediaAccessId id = media_mgr.open( new_url );
       _media_set->redirect( media_nr, id );
     }
-    void SourceImpl::reattach(const Pathname &attach_point,
-                             bool temporary)
+    void SourceImpl::reattach(const Pathname &attach_point)
     {
       DBG << "reattach(" << attach_point << ")" << endl;
-      _media_set->reattach( attach_point, temporary );
+      _media_set->reattach( attach_point );
     }
 
     void SourceImpl::release()
index 7983d200ecd837ccca3c02bc6fd8af94614888fe..545a84a68e6b17eef9b680c61c1238643ddc6bc2 100644 (file)
@@ -165,8 +165,7 @@ namespace zypp
        *
        * \throws Exception
        */
-      void reattach(const Pathname &attach_point,
-                   bool temporary = false);
+      void reattach(const Pathname &attach_point);
       /**
        * Release all medias attached by the source
        */