fix specfile
authorMichael Andres <ma@suse.de>
Wed, 22 Oct 2008 13:45:19 +0000 (13:45 +0000)
committerMichael Andres <ma@suse.de>
Wed, 22 Oct 2008 13:45:19 +0000 (13:45 +0000)
devel/devel.ma/NewPool.cc
libzypp.spec.cmake
tests/sat/CMakeLists.txt
tests/zypp/PoolQuery_test.cc

index 613cd9d..dc033bc 100644 (file)
@@ -157,7 +157,7 @@ std::ostream & testDump( std::ostream & str, const PoolItem & pi )
     l = Locale( "dsdf" );
     str << str::form("%-25s: ",l.code().c_str()) << p->summary(l) << endl;
     OUTS( summary );
-    OUTS( installsize );
+    OUTS( installSize );
     OUTS( downloadSize );
     OUTS( sourcePkgName );
     OUTS( sourcePkgEdition );
@@ -600,7 +600,7 @@ try {
   ///////////////////////////////////////////////////////////////////
   ///////////////////////////////////////////////////////////////////
 
-  if ( 1 )
+  if ( 0 )
   {
     PoolItem pi ( getPi<Patch>("xorg-x11-Xvnc") );
     MIL << pi << endl;
@@ -611,6 +611,23 @@ try {
     }
   }
 
+  SEC << endl;
+  for_( it, pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd() )
+  {
+    USR << *it << endl;
+    it->info().hasLicense();
+  }
+
+  SEC << endl;
+  RepoManager repoManager( makeRepoManager( sysRoot ) );
+  RepoInfoList repos = repoManager.knownRepositories();
+  for_( it, repos.begin(), repos.end() )
+  {
+    USR << *it << endl;
+    it->hasLicense();
+    WAR << it->getLicense( Locale("de_De") ) << endl;
+  }
+
 #if 0
   getZYpp()->resolver()->addRequire( Capability("amarok") );
   solve();
index aa21d4a..60882a2 100644 (file)
@@ -23,6 +23,7 @@ Source1:        @PACKAGE@-rpmlintrc
 Prefix:         /usr
 Provides:       yast2-packagemanager
 Obsoletes:      yast2-packagemanager
+Recommends:     logrotate
 BuildRequires:  cmake
 BuildRequires:  libsatsolver-devel >= 0.12.0 openssl-devel
 BuildRequires:  boost-devel curl-devel dejagnu doxygen gcc-c++ gettext-devel graphviz hal-devel libxml2-devel
@@ -50,8 +51,7 @@ Requires:       gpg2
 %else
 Requires:       gnupg
 %endif
-
-Requires:       satsolver-tools == %( echo `rpm -q --queryformat '%{VERSION}' satsolver-tools`)
+%requires_eq    satsolver-tools
 
 %description
 Package, Patch, Pattern, and Product Management
@@ -72,7 +72,6 @@ Requires:       libzypp == @VERSION@
 Requires:       libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
 Requires:       bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
 Requires:       cmake libsatsolver-devel >= 0.10.14
-Recommends:     logrotate
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          System/Packages
 Provides:       yast2-packagemanager-devel
@@ -210,6 +209,7 @@ rm -rf "$RPM_BUILD_ROOT"
 %dir               /etc/zypp/repos.d
 %config(noreplace) /etc/zypp/zypp.conf
 %config(noreplace) /etc/zypp/systemCheck
+%config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
 %dir               %{_var}/lib/zypp
 %dir               %{_var}/log/zypp
 %dir               %{_var}/cache/zypp
@@ -225,7 +225,6 @@ rm -rf "$RPM_BUILD_ROOT"
 %{prefix}/bin/package-manager-su
 %{_libdir}/libzypp*so.*
 %doc %_mandir/man5/locks.5.*
-%{_sysconfdir}/logrotate.d/zypp-history.lr
 
 %files devel
 %defattr(-,root,root)
index 61dcfb6..52a1760 100644 (file)
@@ -2,6 +2,6 @@
 # to find the KeyRingTest receiver
 INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/tests/zypp )
 
-ADD_TESTS(Solvable SolvParsing WhatProvides)
+ADD_TESTS(Solvable SolvParsing WhatProvides LookupAttr)
 
 
index e410b39..ac321e7 100644 (file)
@@ -1,21 +1,25 @@
-#include <stdio.h>
-#include <iostream>
-#include <iterator>
-#include <boost/test/auto_unit_test.hpp>
-#include <list>
-
-//#include "zypp/ZYppFactory.h"
+#include "TestSetup.h"
 #include "zypp/PoolQuery.h"
 #include "zypp/PoolQueryUtil.tcc"
-#include "TestSetup.h"
 
 #define BOOST_TEST_MODULE PoolQuery
 
-using std::cout;
-using std::endl;
-using std::string;
-using namespace zypp;
-using namespace boost::unit_test;
+/////////////////////////////////////////////////////////////////////////////
+static TestSetup test( "/tmp/x", Arch_x86_64 );
+
+BOOST_AUTO_TEST_CASE(pool_query_init)
+{
+  //test.loadTarget(); // initialize and load target
+  //test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1", "@System" );
+  test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1", "opensuse" );
+  test.loadRepo( TESTS_SRC_DIR "/data/OBS_zypp_svn-11.1", "zyppsvn" );
+  test.loadRepo( TESTS_SRC_DIR "/data/OBS:VirtualBox-11.1", "@system" );
+
+  dumpRange( USR, test.pool().knownRepositoriesBegin(),
+                  test.pool().knownRepositoriesEnd() );
+  USR << "pool: " << test.pool() << endl;
+}
+/////////////////////////////////////////////////////////////////////////////
 
 struct PrintAndCount
 {
@@ -25,7 +29,6 @@ struct PrintAndCount
   {
     zypp::PoolItem pi( zypp::ResPool::instance().find( solvable ) );
     cout << pi.resolvable() << endl;
-    // name: yast2-sound 2.16.2-9 i586
     ++_count;
     return true;
   }
@@ -33,35 +36,6 @@ struct PrintAndCount
   unsigned _count;
 };
 
-/*
-static void init_pool()
-{
-  Pathname dir(TESTS_SRC_DIR);
-  dir += "/zypp/data/PoolQuery";
-
-  ZYpp::Ptr z = getZYpp();
-  ZConfig::instance().setSystemArchitecture(Arch("i586"));
-
-  RepoInfo i1; i1.setAlias("factory");
-  sat::Pool::instance().addRepoSolv(dir / "factory.solv", i1);
-  RepoInfo i2; i2.setAlias("factory-nonoss");
-  sat::Pool::instance().addRepoSolv(dir / "factory-nonoss.solv", i2);
-  RepoInfo i3; i3.setAlias("zypp_svn");
-  sat::Pool::instance().addRepoSolv(dir / "zypp_svn.solv", i3);
-  RepoInfo i4; i4.setAlias("@System");
-  sat::Pool::instance().addRepoSolv(dir / "@System.solv", i4);
-}
-*/
-
-BOOST_AUTO_TEST_CASE(pool_query_init)
-{
-  TestSetup test( Arch_x86_64 );
-  //test.loadTarget(); // initialize and load target
-  test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1", "opensuse" );
-  test.loadRepo( TESTS_SRC_DIR "/data/OBS_zypp_svn-11.1", "zyppsvn" );
-  test.loadRepo( TESTS_SRC_DIR "/data/OBS:VirtualBox-11.1", "vbox" );
-}
-
 #if 0
 BOOST_AUTO_TEST_CASE(pool_query_experiment)
 {
@@ -112,7 +86,7 @@ BOOST_AUTO_TEST_CASE(pool_query_001)
   PoolQuery q;
   q.addString("zypper");
 
-  BOOST_CHECK(std::for_each(q.begin(), q.end(), PrintAndCount())._count == 10);
+  BOOST_CHECK(std::for_each(q.begin(), q.end(), PrintAndCount())._count == 11);
 }
 
 // default query + one attribute + one string
@@ -282,7 +256,7 @@ BOOST_AUTO_TEST_CASE(pool_query_100)
      and sometimes only in description (e.g. bc, lftp). We don't have
      any package with 'revers' only in package name, but let's ignore this.
      I didn't find a string with the same characteristics giving fewer matches
-     :-/ */  
+     :-/ */
   q.addString("revers");
   q.addAttribute(sat::SolvAttr::name);
   q.addAttribute(sat::SolvAttr::summary);
@@ -474,7 +448,7 @@ BOOST_AUTO_TEST_CASE(pool_query_500)
   q.setMatchGlob();
   // creates: ^(.*zy.p|yast.*package.*|.*bzypp)$
   BOOST_CHECK(std::for_each(q.begin(), q.end(), PrintAndCount())._count == 11);
-  
+
   cout << "****500.3****"  << endl;
   PoolQuery q1;
   q1.addString("^libsm[a-z]*[0-9]$");
@@ -547,7 +521,7 @@ BOOST_AUTO_TEST_CASE(pool_query_X)
   q.setEdition(Edition("0.12.5"), Rel::GT);
 
   BOOST_CHECK(std::for_each(q.begin(), q.end(), PrintAndCount())._count == 4);
-  
+
   cout << "****600.2****"  << endl;
   q.setEdition(Edition("0.12.5"), Rel::LT);