backup while cleaning up
authorMichael Andres <ma@suse.de>
Thu, 20 Mar 2008 17:58:21 +0000 (17:58 +0000)
committerMichael Andres <ma@suse.de>
Thu, 20 Mar 2008 17:58:21 +0000 (17:58 +0000)
20 files changed:
zypp/CMakeLists.txt
zypp/NeedAType.h [deleted file]
zypp/Package.cc
zypp/Package.h
zypp/Pattern.cc
zypp/Pattern.h
zypp/Product.cc
zypp/Product.h
zypp/Repository.h
zypp/ResObject.cc
zypp/ResObject.h
zypp/Vendor.h [new file with mode: 0644]
zypp/VendorAttr.h
zypp/sat/SolvAttr.cc
zypp/sat/SolvAttr.h
zypp/sat/Solvable.cc
zypp/sat/Solvable.h
zypp/target/CommitPackageCacheReadAhead.cc
zypp/ui/PatternContentsImpl.cc
zypp/ui/UserWantedPackages.cc

index 1a05660..4396b1e 100644 (file)
@@ -121,7 +121,7 @@ SET( zypp_HEADERS
   MediaSetAccess.h
   Message.h
   NameKindProxy.h
-  NeedAType.h
+  Vendor.h
   NVRAD.h
   NVRA.h
   NVR.h
diff --git a/zypp/NeedAType.h b/zypp/NeedAType.h
deleted file mode 100644 (file)
index bbb6aee..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file zypp/NeedAType.h
- *
-*/
-#ifndef ZYPP_NEEDATYPE_H
-#define ZYPP_NEEDATYPE_H
-
-#include <iosfwd>
-#include <map>
-#include <list>
-#include <string>
-#include "zypp/Locale.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-  /** \defgroup NEEDATYPE Wishlist of types
-
-   Whenever you find something that might be worth being a
-   type, and not just an \c unsigned or \c string. Keep it here.
-
-   Start with a reasonable \c typedef or \c class draft, so you
-   can start using the type within the implementation. If you're
-   in need for interface methods, add them to the draft. Think about
-   the interface and expected behaviour, but implement \b here just
-   as much as you actually need.
-
-   Goal is to provide a real class for it, or to find out that a
-   typedef is sufficient, or the type is not needed anyway.
-
-   If you already implemented something which would fit into this
-   group, but don't want to move it here, put doxygens
-   \code \ingroup NEEDATYPE \endcode tag in it's comment. So it will
-   at least appear in the doc.
-
-   \note Don't put stuff here, that's (almost) ready to use. This is
-   not meant to be a convenience include. Goal is to have this file empty.
-  */
-  //@{
-
-
-  /** Single line of (human readable) text.
-  probably sufficient as typedef. we may use it to classify the
-  various strings and string lists within resolvable and other classes.
-  More a hint to the UI describing the purpose of the string. */
-  typedef std::string Label;
-
-  /** Single line of (human readable) text. See Label. A description would
-   Text, while a a packages file list would be list<string> */
-  typedef std::string Text;
-
-  /** Offer a License text and methods to remember confirmation. */
-  typedef std::string License;
-
-  /** An rpm package group value. Also provide access to a
-   * (singleton) tree like group hierarchy which contains
-   * all existing groups. No more need to fiddle with YStringTreeItem
-   * classes and forgetting to add parsed groups there for use in the UI.
-   * PackageGroup can be selforganizing.
-  */
-  typedef std::string PackageGroup;
-
-  /** Candidate for string unification? */
-  typedef std::list<std::string> PackageKeywords;
-
-  /** Vendor. Worth a typedef. Maybe a class unifying the strings. */
-  typedef std::string Vendor;
-
-  //@}
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_NEEDATYPE_H
index 2bd0966..0674ead 100644 (file)
@@ -55,15 +55,15 @@ namespace zypp
   { return lookupStrAttribute( sat::SolvAttr::distribution ); }
 
   /** */
-  Label Package::license() const
-  { return lookupStrAttribute( sat::SolvAttr::eula ); }
+  std::string Package::license() const
+  { return lookupStrAttribute( sat::SolvAttr::license ); }
 
   /** */
   std::string Package::packager() const
   { return lookupStrAttribute( sat::SolvAttr::packager ); }
 
   /** */
-  PackageGroup Package::group() const
+  std::string Package::group() const
   { return lookupStrAttribute( sat::SolvAttr::group ); }
 
 #warning DUMMY keywords
@@ -77,28 +77,8 @@ namespace zypp
   { return string(); }
 
   /** */
-  std::string Package::os() const
-  { return lookupStrAttribute( sat::SolvAttr::os ); }
-
-  /** */
-  Text Package::prein() const
-  { return lookupStrAttribute( sat::SolvAttr::prein); }
-
-  /** */
-  Text Package::postin() const
-  { return lookupStrAttribute( sat::SolvAttr::postin); }
-
-  /** */
-  Text Package::preun() const
-  { return lookupStrAttribute( sat::SolvAttr::preun); }
-
-  /** */
-  Text Package::postun() const
-  { return lookupStrAttribute( sat::SolvAttr::postun); }
-
-  /** */
   ByteCount Package::sourcesize() const
-  { return lookupNumAttribute( sat::SolvAttr::sourcesize); }
+  { return lookupNumAttribute( sat::SolvAttr::sourcesize ); }
 
   /** */
 #warning DUMMY authors
index 4e6b8e5..cb56846 100644 (file)
@@ -48,27 +48,17 @@ namespace zypp
     /** */
     std::string distribution() const;
     /** */
-    Label license() const;
+    std::string license() const;
     /** */
     std::string packager() const;
     /** */
-    PackageGroup group() const;
+    std::string group() const;
     /** */
     Keywords keywords() const;
     /** Don't ship it as class Url, because it might be
      * in fact anything but a legal Url. */
     std::string url() const;
-    /** */
-    std::string os() const;
-    /** */
-    Text prein() const;
-    /** */
-    Text postin() const;
-    /** */
-    Text preun() const;
-    /** */
-    Text postun() const;
-    /** */
+    /** Size of corresponding the source package. */
     ByteCount sourcesize() const;
     /** */
     std::list<std::string> authors() const;
@@ -86,17 +76,30 @@ namespace zypp
     Edition sourcePkgEdition() const;
 
     /**
-     * Checksum the source says this package should have
-     * \deprecated Use location().checksum()
+     * Checksum the source says this package should have.
+     * \see \ref location
      */
-    ZYPP_DEPRECATED CheckSum checksum() const
+    CheckSum checksum() const
     { return location().checksum(); }
 
-    /**
-     * \short Location of the resolvable in the repository
+    /** Location of the resolvable in the repository.
+     * \ref OnMediaLocation conatins all information required to
+     * retrieve the packge (url, checksum, etc.).
      */
     OnMediaLocation location() const;
 
+
+    /** \deprecated no metadata always empty */
+    ZYPP_DEPRECATED std::string os() const { return std::string(); }
+    /** \deprecated no metadata always empty */
+    ZYPP_DEPRECATED std::string prein() const { return std::string(); }
+    /** \deprecated no metadata always empty */
+    ZYPP_DEPRECATED std::string postin() const { return std::string(); }
+    /** \deprecated no metadata always empty */
+    ZYPP_DEPRECATED std::string preun() const { return std::string(); }
+    /** \deprecated no metadata always empty */
+    ZYPP_DEPRECATED std::string postun() const { return std::string(); }
+
   protected:
     friend Ptr make<Self>( const sat::Solvable & solvable_r );
     /** Ctor */
index e6d3dd2..680f9e9 100644 (file)
@@ -48,8 +48,8 @@ namespace zypp
   bool Pattern::userVisible() const
   { return lookupBoolAttribute( sat::SolvAttr::isvisible ); }
   /** */
-  std::string Pattern::category() const
-  { return lookupStrAttribute( sat::SolvAttr::category ); }
+  std::string Pattern::category( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::category, lang_r ); }
   /** */
   Pathname Pattern::icon() const
   { return lookupStrAttribute( sat::SolvAttr::icon ); }
@@ -57,13 +57,13 @@ namespace zypp
   Pathname Pattern::script() const
   { return lookupStrAttribute( sat::SolvAttr::script ); }
 
-  Label Pattern::order() const
-  { return Label(); }
+  std::string Pattern::order() const
+  { return lookupStrAttribute( sat::SolvAttr::order ); }
 
-  std::set<std::string> Pattern::install_packages( const Locale & lang ) const
-  {
 #warning implement PATTERN::INSTALL_PACKAGES
 #if 0
+  std::set<std::string> Pattern::install_packages( const Locale & lang ) const
+  {
 -    static void copycaps( std::set<std::string> & out, const CapSet & in)
 -    {
 -      for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) {
@@ -87,9 +87,9 @@ namespace zypp
 -    }
 -
 -
-#endif
   return std::set<std::string>();
   }
+#endif
 
 #warning implement PATTERN::INSTALL_PACKAGES
  const Capabilities & Pattern::includes() const
index 9f68c32..29277c8 100644 (file)
@@ -41,16 +41,13 @@ namespace zypp
     /** */
     bool userVisible() const;
     /** */
-    std::string category() const;
+    std::string category( const Locale & lang_r = Locale() ) const;
     /** */
     Pathname icon() const;
     /** */
     Pathname script() const;
     /** */
-    Label order() const;
-
-    /** \deprecated AFAIK unused old Selection interface method. */
-    std::set<std::string> install_packages( const Locale & lang = Locale("") ) const ZYPP_DEPRECATED;
+    std::string order() const;
 
     /** Ui hint. */
     const Capabilities & includes() const;
index 95ef147..3fdb728 100644 (file)
@@ -40,39 +40,42 @@ namespace zypp
   //   Package interface forwarded to implementation
   //
   ///////////////////////////////////////////////////////////////////
-
+#warning DUMMY type
   std::string Product::type() const
   { return std::string(); }
 
-  Label Product::vendor() const
-  { return Label(); }
-
+#warning DUMMY releaseNotesUrl
   Url Product::releaseNotesUrl() const
   { return Url(); }
 
+#warning DUMMY updateUrls
   std::list<Url> Product::updateUrls() const
   { return std::list<Url>(); }
 
+#warning DUMMY extraUrls
   std::list<Url> Product::extraUrls() const
   { return std::list<Url>(); }
 
+#warning DUMMY optionalUrls
   std::list<Url> Product::optionalUrls() const
   { return std::list<Url>(); }
 
+#warning DUMMY flags
   std::list<std::string> Product::flags() const
   { return std::list<std::string>(); }
 
-  /** */
-  Label Product::shortName() const
-  { return Label(); }
+#warning DUMMY shortName
+  std::string Product::shortName() const
+  { return std::string(); }
 
-  /** */
-  Label Product::longName() const
-  { return summary(); }
+  std::string Product::longName( const Locale & lang_r ) const
+  { return summary( lang_r ); }
 
+#warning DUMMY distributionName
   std::string Product::distributionName() const
   { return std::string(); }
 
+#warning DUMMY distributionEdition
   Edition Product::distributionEdition() const
   { return Edition(); }
 
index 9e7b016..58c5e78 100644 (file)
@@ -41,9 +41,6 @@ namespace zypp
     /** Get the product type (base, add-on) */
     std::string type() const;
 
-    /** Get the vendor of the product */
-    Label vendor() const;
-
     /** The URL to download the release notes for this product */
     Url releaseNotesUrl() const;
 
@@ -69,11 +66,11 @@ namespace zypp
     /** The product flags */
     std::list<std::string> flags() const;
 
-    /** */
-    Label shortName() const;
+    /** Untranslated short name like <tt>SLES 10</tt>*/
+    std::string shortName() const;
 
-    /** */
-    Label longName() const;
+    /** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt>*/
+    std::string longName( const Locale & lang_r = Locale() ) const;
 
     /** Vendor specific distribution id. */
     std::string distributionName() const;
index c54f794..8f51864 100644 (file)
@@ -29,20 +29,21 @@ namespace zypp
     //
     /** */
     class Repository : protected sat::detail::PoolMember,
-                 private base::SafeBool<Repository>
+                       private base::SafeBool<Repository>
     {
     public:
         typedef filter_iterator<detail::ByRepository, sat::detail::SolvableIterator> SolvableIterator;
         typedef sat::detail::size_type size_type;
+        typedef sat::detail::RepoIdType IdType;
 
     public:
         /** Default ctor creates \ref noRepository.*/
         Repository()
-           : _id( sat::detail::noRepoId ) {}
+        : _id( sat::detail::noRepoId ) {}
 
         /** \ref PoolImpl ctor. */
-        explicit Repository( sat::detail::RepoIdType id_r )
-           : _id( id_r ) {}
+        explicit Repository( IdType id_r )
+        : _id( id_r ) {}
 
     public:
         /** Represents no \ref Repository. */
@@ -106,9 +107,9 @@ namespace zypp
         void addSolv( const Pathname & file_r );
 
         /** Add \c count_r new empty \ref Solvable to this \ref Repository. */
-        sat::detail::SolvableIdType addSolvables( unsigned count_r );
+        sat::Solvable::IdType addSolvables( unsigned count_r );
         /** \overload Add only one new \ref Solvable. */
-        sat::detail::SolvableIdType addSolvable()
+        sat::Solvable::IdType addSolvable()
            { return addSolvables( 1 ); }
         //@}
 
@@ -116,12 +117,12 @@ namespace zypp
         /** Expert backdoor. */
         ::_Repo * get() const;
         /** Expert backdoor. */
-        sat::detail::RepoIdType id() const { return _id; }
+        IdType id() const { return _id; }
     private:
         friend base::SafeBool<Repository>::operator bool_type() const;
         bool boolTest() const { return get(); }
     private:
-        sat::detail::RepoIdType _id;
+        IdType _id;
     };
     ///////////////////////////////////////////////////////////////////
 
@@ -138,7 +139,7 @@ namespace zypp
 
     /** \relates Repository */
     inline bool operator<( const Repository & lhs, const Repository & rhs )
-    { return lhs.get() < rhs.get(); }      
+    { return lhs.get() < rhs.get(); }
 
     ///////////////////////////////////////////////////////////////////
     //
index 953f533..c268d66 100644 (file)
@@ -59,23 +59,23 @@ namespace zypp
   //
   ///////////////////////////////////////////////////////////////////
 
-  Text ResObject::summary() const
-  { return lookupStrAttribute( sat::SolvAttr::summary ); }
+  std::string ResObject::summary( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::summary, lang_r ); }
 
-  Text ResObject::description() const
-  { return lookupStrAttribute( sat::SolvAttr::description ); }
+  std::string ResObject::description( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::description, lang_r ); }
 
-  Text ResObject::insnotify() const
-  { return lookupStrAttribute( sat::SolvAttr::insnotify ); }
+  std::string ResObject::insnotify( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::insnotify, lang_r ); }
 
-  Text ResObject::delnotify() const
-  { return lookupStrAttribute( sat::SolvAttr::delnotify ); }
+  std::string ResObject::delnotify( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::delnotify, lang_r ); }
 
-  License ResObject::licenseToConfirm() const
-  { return lookupStrAttribute( sat::SolvAttr::eula ); }
+  std::string ResObject::licenseToConfirm( const Locale & lang_r ) const
+  { return lookupStrAttribute( sat::SolvAttr::eula, lang_r ); }
 
-  ByteCount ResObject::size() const
-  { return ByteCount( lookupNumAttribute( sat::SolvAttr::size ), ByteCount::K ); }
+  ByteCount ResObject::installsize() const
+  { return ByteCount( lookupNumAttribute( sat::SolvAttr::installsize ), ByteCount::K ); }
 
   ByteCount ResObject::downloadSize() const
   { return ByteCount( lookupNumAttribute( sat::SolvAttr::downloadsize ), ByteCount::K ); }
@@ -87,13 +87,11 @@ namespace zypp
   bool ResObject::installOnly() const
   { return false; }
 
-#warning DUMMY
   Date ResObject::buildtime() const
-  { return Date(); }
+  { return Date( lookupNumAttribute( sat::SolvAttr::buildtime ) ); }
 
-#warning DUMMY installtime
   Date ResObject::installtime() const
-  { return Date(); }
+  { return Date( lookupNumAttribute( sat::SolvAttr::installtime ) ); }
 
 #warning DUMMY diskusage
   const DiskUsage & ResObject::diskusage() const
index b3cde4f..844cbae 100644 (file)
 #include "zypp/base/Deprecated.h"
 
 #include "zypp/Resolvable.h"
-#include "zypp/NeedAType.h"
 #include "zypp/Date.h"
+#include "zypp/Locale.h"
+#include "zypp/Vendor.h"
 #include "zypp/ByteCount.h"
 #include "zypp/DiskUsage.h"
-#include "zypp/TranslatedText.h"
 #include "zypp/OnMediaLocation.h"
 #include "zypp/Repository.h"
 
+#include "zypp/TranslatedText.h"
+
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
@@ -67,12 +69,12 @@ namespace zypp
      * \short Short text describing the resolvable.
      * This attribute is usually displayed in columns.
      */
-    Text summary() const;
+    std::string summary( const Locale & lang_r = Locale() ) const;
 
     /**
      * \short Long text describing the resolvable.
      */
-    Text description() const;
+    std::string description( const Locale & lang_r = Locale() ) const;
 
     /**
      * \short Installation Notification
@@ -80,7 +82,7 @@ namespace zypp
      * This text can be used to tell the user some notes
      * When he selects the resovable for installation.
      */
-    Text insnotify() const;
+    std::string insnotify( const Locale & lang_r = Locale() ) const;
 
     /**
      * \short De-Installation Notification
@@ -88,7 +90,7 @@ namespace zypp
      * This text can be used to tell the user some notes
      * When he selects the resovable for deinstall.
      */
-    Text delnotify() const;
+    std::string delnotify( const Locale & lang_r = Locale() ) const;
 
     /**
      * \short License or agreement to accept
@@ -96,7 +98,7 @@ namespace zypp
      * Agreement, warning or license the user should
      * accept before installing the resolvable.
      */
-    Text licenseToConfirm() const;
+    std::string licenseToConfirm( const Locale & lang_r = Locale() ) const;
 
     /**
      * \short Vendor
@@ -107,7 +109,10 @@ namespace zypp
     { return Resolvable::vendor().asString(); }
 
     /** Installed size. */
-    ByteCount size() const;
+    ByteCount installsize() const;
+    /** \deprecated Use installsize which is more precise. */
+    ZYPP_DEPRECATED ByteCount size() const
+    { return installsize(); }
 
     /** Size of the rpm package. */
     ByteCount downloadSize() const;
diff --git a/zypp/Vendor.h b/zypp/Vendor.h
new file mode 100644 (file)
index 0000000..73368be
--- /dev/null
@@ -0,0 +1,29 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file      zypp/Vendor.h
+ *
+*/
+#ifndef ZYPP_VENDOR_H
+#define ZYPP_VENDOR_H
+
+#include <string>
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  typedef std::string Vendor;
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
+#include "VendorAttr.h"
+
+#endif // ZYPP_VENDOR_H
index d9cd380..477f217 100644 (file)
@@ -16,8 +16,8 @@
 #include <string>
 
 #include "zypp/base/NonCopyable.h"
-#include "zypp/NeedAType.h"
 #include "zypp/PathInfo.h"
+#include "zypp/Vendor.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp {
@@ -37,7 +37,7 @@ class VendorAttr : private base::NonCopyable
     /**
      * Adding new equivalent vendors described in a file
      **/
-    bool addVendorFile( const Pathname & filename) const;    
+    bool addVendorFile( const Pathname & filename) const;
 
     /** Return whether two vendor strings shold be treated as the same vendor.
      * Usually the solver is allowed to automatically select a package of an
index 143fa80..ea9c2bd 100644 (file)
@@ -9,10 +9,14 @@
 /** \file      zypp/SolvAttr.cc
  *
 */
+extern "C"
+{
+#include <satsolver/knownid.h>
+}
+
 #include <iostream>
 
 #include "zypp/base/String.h"
-
 #include "zypp/sat/SolvAttr.h"
 
 using std::endl;
@@ -25,44 +29,54 @@ namespace sat
 
   const SolvAttr SolvAttr::noAttr;
 
-#warning use predefined Ids from libsatsolver.
-  const SolvAttr SolvAttr::summary      ( "solvable:summary" );
-  const SolvAttr SolvAttr::description  ( "solvable:description" );
-  const SolvAttr SolvAttr::insnotify    ( "solvable:messageins" );
-  const SolvAttr SolvAttr::delnotify    ( "solvable:messagedel" );
-  const SolvAttr SolvAttr::vendor       ( "solvable:vendor" );
-  const SolvAttr SolvAttr::license      ( "solvable:license" );
-  const SolvAttr SolvAttr::size         ( "solvable:installsize" );
-  const SolvAttr SolvAttr::downloadsize ( "solvable:downloadsize" );
+#warning STILL ATTRIBUTES HERE WHICH ARE NOT PROVIDED BY SOLV FILES
+// At least the ones that do nat have a satsolver/knownid.
+
+  const SolvAttr SolvAttr::summary      ( SOLVABLE_SUMMARY );       // translated
+  const SolvAttr SolvAttr::description  ( SOLVABLE_DESCRIPTION );   // translated
+  const SolvAttr SolvAttr::insnotify    ( SOLVABLE_MESSAGEINS );    // translated
+  const SolvAttr SolvAttr::delnotify    ( SOLVABLE_MESSAGEDEL );    // translated
+  const SolvAttr SolvAttr::eula                ( SOLVABLE_EULA );          // translated
+  const SolvAttr SolvAttr::installtime  ( SOLVABLE_INSTALLTIME );
+  const SolvAttr SolvAttr::buildtime    ( SOLVABLE_BUILDTIME );
+  const SolvAttr SolvAttr::installsize  ( SOLVABLE_INSTALLSIZE );
+  const SolvAttr SolvAttr::downloadsize ( SOLVABLE_DOWNLOADSIZE );
+  const SolvAttr SolvAttr::diskusage    ( SOLVABLE_DISKUSAGE );
 
   //package
-  const SolvAttr SolvAttr::medianr     ( "solvable:medianr" );
-  const SolvAttr SolvAttr::mediafile   ( "solvable:mediafile" );
-  const SolvAttr SolvAttr::mediadir    ( "solvable:mediadir" );
-  const SolvAttr SolvAttr::eula                ( "solvable:eula" );
+  const SolvAttr SolvAttr::medianr     ( SOLVABLE_MEDIANR );
+  const SolvAttr SolvAttr::mediafile   ( SOLVABLE_MEDIAFILE );
+  const SolvAttr SolvAttr::mediadir    ( SOLVABLE_MEDIADIR );
   const SolvAttr SolvAttr::changelog    ( "changelog" );
   const SolvAttr SolvAttr::buildhost    ( "buildhost" );
   const SolvAttr SolvAttr::distribution ( "distribution" );
+  const SolvAttr SolvAttr::license      ( SOLVABLE_LICENSE );
   const SolvAttr SolvAttr::packager     ( "packager" );
-  const SolvAttr SolvAttr::group        ( "solvable:group" );
-  const SolvAttr SolvAttr::keywords     ( "solvable:keywords" );
-  const SolvAttr SolvAttr::os           ( "os" );
-  const SolvAttr SolvAttr::prein        ( "prein" );
-  const SolvAttr SolvAttr::postin       ( "postin" );
-  const SolvAttr SolvAttr::preun        ( "preun" );
-  const SolvAttr SolvAttr::postun       ( "postun" );
+  const SolvAttr SolvAttr::group        ( SOLVABLE_GROUP );
+  const SolvAttr SolvAttr::keywords     ( SOLVABLE_KEYWORDS );
   const SolvAttr SolvAttr::sourcesize   ( "sourcesize" );
-  const SolvAttr SolvAttr::authors      ( "solvable:authors" );
+  const SolvAttr SolvAttr::authors      ( SOLVABLE_AUTHORS );
   const SolvAttr SolvAttr::filenames    ( "filenames" );
   const SolvAttr SolvAttr::srcpkgname   ( "srcpkgname" );
   const SolvAttr SolvAttr::srcpkgedition( "srcpkgedition" );
+  const SolvAttr SolvAttr::filelist     ( SOLVABLE_FILELIST );
+  const SolvAttr SolvAttr::sourcearch   ( SOLVABLE_SOURCEARCH );
+  const SolvAttr SolvAttr::sourcename   ( SOLVABLE_SOURCENAME );
+  const SolvAttr SolvAttr::sourceevr    ( SOLVABLE_SOURCEEVR );
+  const SolvAttr SolvAttr::headerend    ( SOLVABLE_HEADEREND );
+
+  // patch
+  const SolvAttr SolvAttr::patchcategory( SOLVABLE_PATCHCATEGORY );
 
   //pattern
-  const SolvAttr SolvAttr::isvisible    ( "solvable:isvisible" );
-  const SolvAttr SolvAttr::icon         ( "icon" );
+  const SolvAttr SolvAttr::isvisible    ( SOLVABLE_ISVISIBLE );
+  const SolvAttr SolvAttr::icon         ( SOLVABLE_ICON );
+  const SolvAttr SolvAttr::order        ( SOLVABLE_ORDER );
   const SolvAttr SolvAttr::isdefault    ( "isdefault" );
-  const SolvAttr SolvAttr::category     ( "solvable:category" ); // FIXME translate
+  const SolvAttr SolvAttr::category     ( SOLVABLE_CATEGORY );    // translated
   const SolvAttr SolvAttr::script       ( "script" );
+  const SolvAttr SolvAttr::includes     ( SOLVABLE_INCLUDES );
+  const SolvAttr SolvAttr::extends      ( SOLVABLE_EXTENDS );
 
 } // namespace sat
   /////////////////////////////////////////////////////////////////
index 94d171b..252a7c3 100644 (file)
@@ -43,39 +43,47 @@ namespace sat
       static const SolvAttr description;
       static const SolvAttr insnotify;
       static const SolvAttr delnotify;
-      static const SolvAttr vendor;
-      static const SolvAttr license;
-      static const SolvAttr size;
+      static const SolvAttr eula;
+      static const SolvAttr installtime;
+      static const SolvAttr buildtime;
+      static const SolvAttr installsize;
       static const SolvAttr downloadsize;
+      static const SolvAttr diskusage;
 
       //package
       static const SolvAttr mediadir;
       static const SolvAttr medianr;
       static const SolvAttr mediafile;
-      static const SolvAttr eula;
       static const SolvAttr changelog;
       static const SolvAttr buildhost;
       static const SolvAttr distribution;
+      static const SolvAttr license;
       static const SolvAttr packager;
       static const SolvAttr group;
       static const SolvAttr keywords;
-      static const SolvAttr os;
-      static const SolvAttr prein;
-      static const SolvAttr postin;
-      static const SolvAttr preun;
-      static const SolvAttr postun;
       static const SolvAttr sourcesize;
       static const SolvAttr authors;
       static const SolvAttr filenames;
       static const SolvAttr srcpkgname;
       static const SolvAttr srcpkgedition;
+      static const SolvAttr filelist;
+      static const SolvAttr sourcearch;
+      static const SolvAttr sourcename;
+      static const SolvAttr sourceevr;
+      static const SolvAttr headerend;
+
+      // patch
+      static const SolvAttr patchcategory;
 
       // patern
       static const SolvAttr isvisible;
       static const SolvAttr icon;
+      static const SolvAttr order;
       static const SolvAttr isdefault;
       static const SolvAttr category;
       static const SolvAttr script;
+      static const SolvAttr includes;
+      static const SolvAttr extends;
 
       //@}
 
index 7c66e88..0624a89 100644 (file)
@@ -77,9 +77,15 @@ namespace zypp
     {
       NO_SOLVABLE_RETURN( std::string() );
       const char *s = ::repo_lookup_str( _solvable, attr.idStr().id() );
-      return s ? s : std::string();
+      return  s ? s : std::string();
     }
 
+    std::string Solvable::lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const
+    {
+#warning FIX RETRIEVIENG TRANSLATIONS
+      return lookupStrAttribute( attr );
+   }
+
     unsigned Solvable::lookupNumAttribute( const SolvAttr & attr ) const
     {
       NO_SOLVABLE_RETURN( 0 );
index fbd54bd..dba261b 100644 (file)
@@ -56,12 +56,15 @@ namespace zypp
                      private base::SafeBool<Solvable>
     {
       public:
+        typedef sat::detail::SolvableIdType IdType;
+
+      public:
         /** Default ctor creates \ref nosolvable.*/
         Solvable()
         : _id( detail::noSolvableId ) {}
 
         /** \ref PoolImpl ctor. */
-        explicit Solvable( detail::SolvableIdType id_r )
+        explicit Solvable( IdType id_r )
         : _id( id_r ) {}
 
       public:
@@ -84,6 +87,15 @@ namespace zypp
          * or an empty string if it does not exists.
          */
         std::string lookupStrAttribute( const SolvAttr & attr ) const;
+        /** \overload Trying to look up a translated string attribute.
+         *
+         * Passing an empty \ref Locale will return the string for the
+         * current default locale (\see \ref ZConfig::defaultTextLocale).
+         *
+         * Returns the translation for \c lang_r considering all fallback
+         * locales. Returns an empty string if no translation is available.
+        */
+        std::string lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const;
 
         /**
          * returns the numeric attribute value for \ref attr
@@ -172,12 +184,12 @@ namespace zypp
         /** Expert backdoor. */
         ::_Solvable * get() const;
         /** Expert backdoor. */
-        detail::SolvableIdType id() const { return _id; }
+        IdType id() const { return _id; }
       private:
         friend base::SafeBool<Solvable>::operator bool_type() const;
         bool boolTest() const { return get(); }
       private:
-        detail::SolvableIdType _id;
+        IdType _id;
     };
     ///////////////////////////////////////////////////////////////////
 
index d52ee8b..ba6bc06 100644 (file)
@@ -160,7 +160,7 @@ namespace zypp
           ManagedFile fromSource( sourceProvidePackage( it->first ) );
 
           // copy it to the cachedir
-          std::string destName( str::form( "S%lu_%u_%s",
+          std::string destName( str::form( "S%p_%u_%s",
                                            it->first->repository().id(),
                                            it->first->mediaNr(),
                                            fromSource.value().basename().c_str() ) );
index 0e1239b..dd3bb9b 100644 (file)
@@ -40,7 +40,9 @@ namespace zypp
 
         void operator()( const Pattern::constPtr & pattern )
         {
-          std::set<std::string> s( pattern->install_packages() );
+#warning NEEDS FIX
+//          std::set<std::string> s( pattern->install_packages() );
+          std::set<std::string> s;
           _result->insert( s.begin(), s.end() );
         }
 
index 9edf819..33d92f1 100644 (file)
@@ -129,7 +129,8 @@ namespace zypp
                    DBG << (*it)->theObj()->kind().asString()
                        << " will be transacted: \"" << pkgSet->name() << "\"" << endl;
 
-                   set<string> setPkgs = pkgSet->install_packages();
+#warning NEEDS FIX
+                   set<string> setPkgs;// = pkgSet->install_packages();
                    pkgNames.insert( setPkgs.begin(), setPkgs.end() );
                }
            }