Provide Package::url() if available in solv file. (bnc #402434)
authorMichael Andres <ma@suse.de>
Wed, 9 Jul 2008 10:20:25 +0000 (10:20 +0000)
committerMichael Andres <ma@suse.de>
Wed, 9 Jul 2008 10:20:25 +0000 (10:20 +0000)
devel/devel.ma/NewPool.cc
package/libzypp.changes
zypp/Package.cc
zypp/sat/SolvAttr.cc
zypp/sat/SolvAttr.h

index 6e69a75..632fef6 100644 (file)
@@ -559,29 +559,6 @@ try {
   ///////////////////////////////////////////////////////////////////
   ///////////////////////////////////////////////////////////////////
 
-  SEC << zypp::getZYpp()->diskUsage() << endl;
-
-  for_( it, pool.begin(), pool.end() )
-  {
-    //MIL << *it << endl;
-    //DBG << (*it)->diskusage() << endl;
-  }
-
-  PoolItem pu ( getPi<Package>("amarok") );
-  PoolItem pi ( getPi<Package>("amarok",Edition("1.4.7-37")) );
-
-  pi.status().setTransact( true, ResStatus::USER );
-  SEC << zypp::getZYpp()->diskUsage() << endl;
-
-  pu.status().setTransact( true, ResStatus::USER );
-  SEC << zypp::getZYpp()->diskUsage() << endl;
-
-
-  ///////////////////////////////////////////////////////////////////
-  INT << "===[END]============================================" << endl << endl;
-  zypp::base::LogControl::instance().logNothing();
-  return 0;
-
   if ( 0 )
   {
     PoolItem pi ( getPi<Package>("amarok") );
@@ -596,7 +573,7 @@ try {
     }
   }
 
-  SEC << zypp::getZYpp()->diskUsage() << endl;
+  //SEC << zypp::getZYpp()->diskUsage() << endl;
 
   //vdumpPoolStats( USR << "Pool:"<< endl, pool.begin(), pool.end() ) << endl;
   //waitForInput();
index 78fb883..02fdf30 100644 (file)
@@ -1,8 +1,14 @@
 -------------------------------------------------------------------
+Wed Jul  9 12:13:58 CEST 2008 - ma@suse.de
+
+- Provide Package::url() if available in solv file. (bnc #402434)
+- revision 10523
+
+-------------------------------------------------------------------
 Mon Jul  7 13:39:09 CEST 2008 - schubi@suse.de
 
-- Do not update an already updated package Bug 400422 
-- Revision 10504
+- Do not update an already updated package (bnc #400422)
+- revision 10504
 
 -------------------------------------------------------------------
 Fri Jul  4 17:19:24 CEST 2008 - ma@suse.de
index 51e7bf9..f29717b 100644 (file)
@@ -51,7 +51,7 @@ namespace zypp
   Changelog Package::changelog() const
   {
       Target_Ptr target;
-      try 
+      try
       {
           target = getZYpp()->target();
       }
@@ -60,8 +60,8 @@ namespace zypp
            ERR << "Target not initialized. Changelog is not available." << std::endl;
            return Changelog();
       }
-      
-          
+
+
       if ( repository().isSystemRepo() )
       {
           target::rpm::RpmHeader::constPtr header;
@@ -72,36 +72,27 @@ namespace zypp
       return Changelog();
   }
 
-  /** */
   std::string Package::buildhost() const
   { return lookupStrAttribute( sat::SolvAttr::buildhost ); }
 
-  /** */
   std::string Package::distribution() const
   { return lookupStrAttribute( sat::SolvAttr::distribution ); }
 
-  /** */
   std::string Package::license() const
   { return lookupStrAttribute( sat::SolvAttr::license ); }
 
-  /** */
   std::string Package::packager() const
   { return lookupStrAttribute( sat::SolvAttr::packager ); }
 
-  /** */
   std::string Package::group() const
   { return lookupStrAttribute( sat::SolvAttr::group ); }
 
   Package::Keywords Package::keywords() const
   { return Keywords( sat::SolvAttr::keywords, satSolvable() ); }
 
-  /** Don't ship it as class Url, because it might be
-   * in fact anything but a legal Url. */
-#warning DUMMY url
   std::string Package::url() const
-  { return string(); }
+  { return lookupStrAttribute( sat::SolvAttr::url ); }
 
-  /** */
   ByteCount Package::sourcesize() const
   { return lookupNumAttribute( sat::SolvAttr::sourcesize ); }
 
@@ -113,8 +104,8 @@ namespace zypp
   }
 
   std::list<std::string> Package::filenames() const
-  { 
-    std::list<std::string> files; 
+  {
+    std::list<std::string> files;
     sat::LookupAttr q( sat::SolvAttr::filelist, *this );
     for_( it, q.begin(), q.end() )
     {
@@ -129,20 +120,20 @@ namespace zypp
   OnMediaLocation Package::location() const
   { return lookupLocation(); }
 
- std::string Package::sourcePkgName() const
- {
 std::string Package::sourcePkgName() const
 {
    // no id means same as package
-   sat::detail::IdType id( lookupIdAttribute( sat::SolvAttr::sourcename ) );
-   id = lookupIdAttribute(sat::SolvAttr::sourcearch);
-   return id ? IdString( id ).asString() : name();
- }
+    sat::detail::IdType id( lookupIdAttribute( sat::SolvAttr::sourcename ) );
+    id = lookupIdAttribute(sat::SolvAttr::sourcearch);
+    return id ? IdString( id ).asString() : name();
 }
 
- Edition Package::sourcePkgEdition() const
- {
 Edition Package::sourcePkgEdition() const
 {
    // no id means same as package
-   sat::detail::IdType id( lookupIdAttribute( sat::SolvAttr::sourceevr ) );
-   return id ? Edition( id ) : edition();
- }
+    sat::detail::IdType id( lookupIdAttribute( sat::SolvAttr::sourceevr ) );
+    return id ? Edition( id ) : edition();
 }
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index b010003..7188d57 100644 (file)
@@ -68,6 +68,7 @@ namespace sat
   const SolvAttr SolvAttr::sourcename   ( SOLVABLE_SOURCENAME );
   const SolvAttr SolvAttr::sourceevr    ( SOLVABLE_SOURCEEVR );
   const SolvAttr SolvAttr::headerend    ( SOLVABLE_HEADEREND );
+  const SolvAttr SolvAttr::url          ( SOLVABLE_URL );
 
   // patch
   const SolvAttr SolvAttr::patchcategory            ( SOLVABLE_PATCHCATEGORY );
index 7025bf0..2b3f94e 100644 (file)
@@ -42,9 +42,9 @@ namespace sat
       static const SolvAttr noAttr;
 
       /** \name special solvable attributes which are part of the ::Solvable struct
-       * 
+       *
        * \todo can these be used in LookupAttr currently?
-       * \todo add dependencies here? Or move all this stuff elsewhere? 
+       * \todo add dependencies here? Or move all this stuff elsewhere?
        */
       //@{
       static const SolvAttr name;
@@ -87,6 +87,7 @@ namespace sat
       static const SolvAttr sourcename;
       static const SolvAttr sourceevr;
       static const SolvAttr headerend;
+      static const SolvAttr url;
       //@}
 
        /** \name patch */