Package class provides path to its RPM/patchRPM/deltaRPM
authorJiri Srain <jsrain@suse.cz>
Tue, 24 Jan 2006 12:00:11 +0000 (12:00 +0000)
committerJiri Srain <jsrain@suse.cz>
Tue, 24 Jan 2006 12:00:11 +0000 (12:00 +0000)
zypp/Package.cc
zypp/Package.h
zypp/Source.cc
zypp/Source.h
zypp/detail/PackageImplIf.cc
zypp/detail/PackageImplIf.h
zypp/source/SourceImpl.cc
zypp/source/SourceImpl.h
zypp/source/yum/YUMPackageImpl.cc
zypp/source/yum/YUMPackageImpl.h

index c62fd51..cf2642d 100644 (file)
@@ -121,6 +121,17 @@ namespace zypp
   License Package::licenseToConfirm() const
   { return pimpl().licenseToConfirm(); }
 
+  /** */
+  Pathname Package::plainRpm() const
+  { return pimpl().location(); }
+
+  /** */
+  std::list<PatchRpm> Package::patchRpms() const
+  { return pimpl().patchRpms(); }
+
+  /** */
+  std::list<DeltaRpm> Package::deltaRpms() const
+  { return pimpl().deltaRpms(); }
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index c007c0e..34eb641 100644 (file)
@@ -76,7 +76,15 @@ namespace zypp
     Text filenames() const;
     /** */
     License licenseToConfirm() const;
+    /** */
+    Pathname plainRpm() const;
+    /** */
+    std::list<PatchRpm> patchRpms() const;
+    /** */
+    std::list<DeltaRpm> deltaRpms() const;
+
     // data here:
 
   protected:
     Package( const NVRAD & nvrad_r );
index 943b408..4239548 100644 (file)
@@ -53,6 +53,11 @@ namespace zypp
   std::ostream & Source::dumpOn( std::ostream & str ) const
   { return _pimpl->dumpOn( str ); }
 
+  const Pathname Source::provideFile(const Pathname & file, const unsigned media_nr)
+  { return _pimpl->provideFile(file, media_nr); }
+
+
+
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
index 76ee5cc..7e93e38 100644 (file)
@@ -17,6 +17,7 @@
 #include "zypp/base/PtrTypes.h"
 
 #include "zypp/ResStore.h"
+#include "zypp/Pathname.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -62,6 +63,10 @@ namespace zypp
   private:
     /** Pointer to implementation */
     RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
+
+  public:
+    /** Provide a file to local filesystem */
+    const Pathname provideFile(const Pathname & file, const unsigned media_nr = 1);
   };
   ///////////////////////////////////////////////////////////////////
 
@@ -69,6 +74,7 @@ namespace zypp
   inline std::ostream & operator<<( std::ostream & str, const Source & obj )
   { return obj.dumpOn( str ); }
 
+
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
index 0f386ac..61664d6 100644 (file)
@@ -53,6 +53,9 @@ namespace zypp
       Changelog PackageImplIf::changelog() const
       { return Changelog(); }
 
+      Pathname PackageImplIf::location() const
+      { return Pathname(); }
+
       std::string PackageImplIf::url() const
       { return std::string(); }
 
@@ -86,6 +89,13 @@ namespace zypp
       License PackageImplIf::licenseToConfirm() const
       { return License(); }
 
+      std::list<DeltaRpm> PackageImplIf::deltaRpms() const
+      { return std::list<DeltaRpm>(); }
+
+      std::list<PatchRpm> PackageImplIf::patchRpms() const
+      { return std::list<PatchRpm>(); }
+
+
     /////////////////////////////////////////////////////////////////
   } // namespace detail
   ///////////////////////////////////////////////////////////////////
index 1fbe101..f9e481c 100644 (file)
@@ -18,6 +18,8 @@
 #include "zypp/Edition.h"
 #include "zypp/Arch.h"
 #include "zypp/Changelog.h"
+#include "zypp/PatchRpm.h"
+#include "zypp/DeltaRpm.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -79,6 +81,8 @@ namespace zypp
       virtual PackageGroup group() const PURE_VIRTUAL;
       /** */
       virtual Changelog changelog() const PURE_VIRTUAL;
+      /** */
+      virtual Pathname location() const PURE_VIRTUAL;
       /** Don't ship it as class Url, because it might be
        * in fact anything but a legal Url. */
       virtual std::string url() const PURE_VIRTUAL;
@@ -100,6 +104,11 @@ namespace zypp
       virtual Text authors() const PURE_VIRTUAL;
       /** */
       virtual Text filenames() const PURE_VIRTUAL;
+      /** */
+      virtual std::list<DeltaRpm> deltaRpms() const PURE_VIRTUAL;
+      /** */
+      virtual std::list<PatchRpm> patchRpms() const PURE_VIRTUAL;
+
       //@}
 
       /** \name Additional Package Attributes.
index 220906a..3b9457d 100644 (file)
@@ -44,7 +44,7 @@ namespace zypp
     SourceImpl::~SourceImpl()
     {}
 
-    const Pathname SourceImpl::provideFile(const Pathname & file_r)
+    const Pathname SourceImpl::provideFile(const Pathname & file_r, const unsigned media_nr)
     {
       _media->provideFile (file_r);
       return _media->localPath (file_r);
index f4e43fd..0a7479a 100644 (file)
@@ -61,7 +61,7 @@ namespace zypp
       { return _store; }
 
       /** Provide a file to local filesystem */
-      const Pathname provideFile(const Pathname & file);
+      const Pathname provideFile(const Pathname & file, const unsigned media_nr = 1);
 
       /** Overload to realize stream output. */
       virtual std::ostream & dumpOn( std::ostream & str ) const
index b0229bc..dd6c2fc 100644 (file)
@@ -255,6 +255,10 @@ namespace zypp
       Changelog YUMPackageImpl::changelog() const
       { return _changelog; }
 
+      /** */
+      Pathname YUMPackageImpl::location() const
+      { return _location; }
+
       /** Don't ship it as class Url, because it might be
        * in fact anything but a legal Url. */
       std::string YUMPackageImpl::url() const
index 02a4c6d..b5d1eec 100644 (file)
@@ -76,6 +76,8 @@ namespace zypp
        virtual PackageGroup group() const;
        /** */
        virtual Changelog changelog() const;
+        /** */
+        virtual Pathname location() const;
        /** Don't ship it as class Url, because it might be
         * in fact anything but a legal Url. */
        virtual std::string url() const;
@@ -172,8 +174,6 @@ namespace zypp
         /** */
         virtual std::list<std::string> suggests() const;
         /** */
-        virtual std::string location() const;
-        /** */
         virtual unsigned int medianr() const;
         /** */
         virtual std::string md5sum() const;
@@ -210,7 +210,7 @@ namespace zypp
        unsigned _mediaid;
        CheckSum _checksum;
        Text _filenames;
-       std::string _location;
+       Pathname _location;
        std::list<DeltaRpm> _delta_rpms;
        std::list<PatchRpm> _patch_rpms;