Author: mlandres
Date: Fri May 9 21:39:35 2008
New Revision: 10029
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10029&view=rev
Log:
- Add zypp.conf option configdir (/etc/zypp) and arrange
all config files and directories to follow {configdir}
per default.
- Fix zypp-query-pool to print satisfied products and additional
products defined in {configdir}/products.d for registration.
(bnc #385868)
Modified:
trunk/libzypp/VERSION.cmake
trunk/libzypp/devel/devel.ma/NewPool.cc
trunk/libzypp/package/libzypp.changes
trunk/libzypp/tools/registration/zypp-query-pool.cc
trunk/libzypp/zypp.conf
trunk/libzypp/zypp/ZConfig.cc
trunk/libzypp/zypp/ZConfig.h
Modified: trunk/libzypp/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/VERSION.cmake (original)
+++ trunk/libzypp/VERSION.cmake Fri May 9 21:39:35 2008
@@ -45,6 +45,6 @@
#
SET(LIBZYPP_MAJOR "4")
-SET(LIBZYPP_MINOR "20")
-SET(LIBZYPP_COMPATMINOR "18")
-SET(LIBZYPP_PATCH "1")
+SET(LIBZYPP_MINOR "21")
+SET(LIBZYPP_COMPATMINOR "21")
+SET(LIBZYPP_PATCH "0")
Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Fri May 9 21:39:35 2008
@@ -478,9 +478,7 @@
INT << "===[START]==========================================" << endl;
ZConfig::instance();
- //parser::ProductConfReader r( &PCDC, "test.prod" );
- parser::ProductConfReader::scanDir( &PCDC, "." );
-
+ parser::ProductConfReader::scanDir( &PCDC, ZConfig::instance().productsPath() );
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
zypp::base::LogControl::instance().logNothing();
@@ -573,10 +571,6 @@
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- MIL << sat::LookupAttr( sat::SolvAttr("foo") ) << endl;
- MIL << sat::LookupAttr( sat::SolvAttr("foo") ).begin() << endl;
- MIL << sat::LookupAttr( sat::SolvAttr("foo") ).begin().idStr() << endl;
- MIL << sat::LookupAttr( sat::SolvAttr("foo") ).begin().idStr().id() << endl;
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Fri May 9 21:39:35 2008
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri May 9 21:28:42 CEST 2008 - ma@suse.de
+
+- Add zypp.conf option configdir (/etc/zypp) and arrange
+ all config files and directories to follow {configdir}
+ per default.
+- Fix zypp-query-pool to print satisfied products and additional
+ products defined in {configdir}/products.d for registration.
+ (bnc #385868)
+- version 4.21.0
+- revision 10029
+
+-------------------------------------------------------------------
Fri May 9 15:30:40 CEST 2008 - jreidinger@suse.cz
- implement remove duplicate entries in lock file (bnc#385967)
Modified: trunk/libzypp/tools/registration/zypp-query-pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tools/registration/zypp-query-pool.cc?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/tools/registration/zypp-query-pool.cc (original)
+++ trunk/libzypp/tools/registration/zypp-query-pool.cc Fri May 9 21:39:35 2008
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
#include
#include
@@ -26,7 +27,7 @@
{
bool operator()( const PoolItem & p ) const
{
- if ( isKind<Package>(p.resolvable()) )
+ if ( isKind<Package>(p.resolvable()) )
return p.status().isInstalled();
else
return p.status().isSatisfied();
@@ -76,6 +77,16 @@
};
+bool printAdditionalProducts( const zypp::parser::ProductConfData & d )
+{
+ cout << str::form( "i|product|%s|%s|%s|%s|%s\n",
+ d.name().c_str(),
+ d.edition().c_str(),
+ d.arch().c_str(),
+ d.distName().c_str(),
+ d.distEdition().c_str() );
+ return true;
+}
static void
@@ -109,10 +120,10 @@
for ( RepoInfoList::iterator it = repos.begin(); it != repos.end(); ++it )
{
RepoInfo & repo( *it );
-
+
if ( ! repo.enabled() )
continue;
-
+
MIL << "Loading " << repo << endl;
if ( ! repoManager.isCached( repo ) )
{
@@ -133,14 +144,15 @@
// add resolvables from the system
MIL << "Loading target..." << endl;
Z->target()->load();
-
+
MIL << "Loaded target." << endl;
-
+
MIL << "Pool has " << Z->pool().size() << " entries" << endl;
-
+
// solve to get the status satisfied available
+ getZYpp()->resolver()->setOnlyRequires( true );
getZYpp()->resolver()->resolvePool();
-
+
if ( filter == FILTER_ALL)
{
PrintItem printitem( repository );
@@ -151,10 +163,10 @@
else
zypp::invokeOnEach( Z->pool().begin(), Z->pool().end(), // all kinds
zypp::functor::functorRef (printitem) );
-
+
}
-else
-{
+ else
+ {
PrintItem printitem( repository );
if (installed_only)
zypp::invokeOnEach( Z->pool().byKindBegin( kind ), Z->pool().byKindEnd( kind ), // filter kind
@@ -163,7 +175,18 @@
else
zypp::invokeOnEach( Z->pool().byKindBegin( kind ), Z->pool().byKindEnd( kind ), // filter kind
zypp::functor::functorRef (printitem) );
-}
+ }
+
+ if ( installed_only
+ && repository.empty()
+ && ( filter == FILTER_ALL || filter == "products" ) )
+ {
+ // write out additional products from /etc/zypp/products.d
+ // if -r is active and no repo filter is defined.
+ zypp::parser::ProductConfReader::scanDir( &printAdditionalProducts,
+ ZConfig::instance().productsPath() );
+ }
+
return;
}
@@ -177,7 +200,7 @@
string repository;
bool only_installed = false;
int offset = 1;
-
+
if ( (argc>1) && ( (string(argv[offset]) == "--registrable")
|| ( string(argv[offset]) == "-r" ) ) )
{
@@ -188,8 +211,8 @@
if ( argc > 1 )
{
filter = argv[offset];
- --argc; ++offset;
-
+ --argc; ++offset;
+
if ( argc > 1 )
{
repository = argv[offset];
Modified: trunk/libzypp/zypp.conf
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp.conf?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/zypp.conf (original)
+++ trunk/libzypp/zypp.conf Fri May 9 21:39:35 2008
@@ -59,10 +59,18 @@
##
+## Path where the configuration files are kept.
+##
+## Valid values: A directory
+## Default value: /etc/zypp
+##
+# configdir = /etc/zypp
+
+##
## Path where the known repositories .repo files are kept
##
## Valid values: A directory
-## Default value: /etc/zypp/repos.d
+## Default value: {configdir}/repos.d
##
## Changing this invalidates all known repositories
##
@@ -136,10 +144,23 @@
## Defining directory for equivalent vendors
##
## Valid values: A directory
-## Default value: /etc/zypp/vendors.d
+## Default value: {configdir}/vendors.d
##
# vendordir = /etc/zypp/vendors.d
+
+##
+## Path where additional product information, .prod files are kept
+##
+## Valid values: A directory
+## Default value: {configdir}/products.d
+##
+## Changing this is not recommended, as the directory might
+## be populated by packages dropping files to /etc/zypp/products.d.
+##
+# productsdir = /etc/zypp/products.d
+
+
##
## Whether required packages are installed ONLY
## So recommended packages, language packages and packages which depend
@@ -155,7 +176,7 @@
## In this file is saved also UI locks.
##
## valid value: path to file or place where file can be created
-## default value: /etc/zypp/locks
+## default value: {configdir}/locks
##
# locksfile.path = /etc/zypp/locks
Modified: trunk/libzypp/zypp/ZConfig.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.cc?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/zypp/ZConfig.cc (original)
+++ trunk/libzypp/zypp/ZConfig.cc Fri May 9 21:39:35 2008
@@ -214,6 +214,10 @@
{
cfg_packages_path = Pathname(value);
}
+ else if ( entry == "configdir" )
+ {
+ cfg_config_path = Pathname(value);
+ }
else if ( entry == "reposdir" )
{
cfg_known_repos_path = Pathname(value);
@@ -238,6 +242,10 @@
{
cfg_vendor_path = Pathname(value);
}
+ else if ( entry == "productsdir" )
+ {
+ cfg_products_path = Pathname(value);
+ }
else if ( entry == "solver.onlyRequires" )
{
solver_onlyRequires = str::strToBool( value, solver_onlyRequires );
@@ -286,13 +294,17 @@
Arch cfg_arch;
Locale cfg_textLocale;
+ Pathname cfg_cache_path;
Pathname cfg_metadata_path;
Pathname cfg_solvfiles_path;
Pathname cfg_packages_path;
- Pathname cfg_cache_path;
+
+ Pathname cfg_config_path;
Pathname cfg_known_repos_path;
Pathname cfg_vendor_path;
+ Pathname cfg_products_path;
Pathname locks_file;
+
Pathname update_scripts_path;
bool repo_add_probe;
@@ -418,13 +430,39 @@
? (repoCachePath()/"packages") : _pimpl->cfg_packages_path );
}
+ ///////////////////////////////////////////////////////////////////
+
+ Pathname ZConfig::configPath() const
+ {
+ return ( _pimpl->cfg_config_path.empty()
+ ? Pathname("/etc/zypp") : _pimpl->cfg_config_path );
+ }
Pathname ZConfig::knownReposPath() const
{
return ( _pimpl->cfg_known_repos_path.empty()
- ? Pathname("/etc/zypp/repos.d") : _pimpl->cfg_known_repos_path );
+ ? (configPath()/"repos.d") : _pimpl->cfg_known_repos_path );
+ }
+ Pathname ZConfig::vendorPath() const
+ {
+ return ( _pimpl->cfg_vendor_path.empty()
+ ? (configPath()/"vendors.d") : _pimpl->cfg_vendor_path );
}
+ Pathname ZConfig::productsPath() const
+ {
+ return ( _pimpl->cfg_products_path.empty()
+ ? (configPath()/"products.d") : _pimpl->cfg_products_path );
+ }
+
+ Pathname ZConfig::locksFile() const
+ {
+ return ( _pimpl->locks_file.empty()
+ ? (configPath()/"locks") : _pimpl->locks_file );
+ }
+
+ ///////////////////////////////////////////////////////////////////
+
const std::string & ZConfig::cacheDBSplitJoinSeparator() const
{
static std::string s("!@$");
@@ -447,21 +485,10 @@
bool ZConfig::download_use_deltarpm() const
{ return _pimpl->download_use_deltarpm; }
- Pathname ZConfig::vendorPath() const
- {
- return ( _pimpl->cfg_vendor_path.empty()
- ? Pathname("/etc/zypp/vendors.d") : _pimpl->cfg_vendor_path );
- }
bool ZConfig::solver_onlyRequires() const
{ return _pimpl->solver_onlyRequires; }
- Pathname ZConfig::locksFile() const
- {
- return ( _pimpl->locks_file.empty()
- ? Pathname("/etc/zypp/locks") : _pimpl->locks_file );
- }
-
bool ZConfig::apply_locks_file() const
{
return _pimpl->apply_locks_file;
Modified: trunk/libzypp/zypp/ZConfig.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.h?rev=10029&r1=10028&r2=10029&view=diff
==============================================================================
--- trunk/libzypp/zypp/ZConfig.h (original)
+++ trunk/libzypp/zypp/ZConfig.h Fri May 9 21:39:35 2008
@@ -84,28 +84,38 @@
public:
/**
- * Path where the caches are kept.
+ * Path where the caches are kept (/var/cache/zypp)
+ * \ingroup g_ZC_REPOCACHE
*/
Pathname repoCachePath() const;
/**
- * Path where the repo metadata is downloaded and kept.
- */
+ * Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
+ * \ingroup g_ZC_REPOCACHE
+ */
Pathname repoMetadataPath() const;
/**
- * Path where the repo solv files are created and kept.
- */
+ * Path where the repo solv files are created and kept (repoCachePath()/solv).
+ * \ingroup g_ZC_REPOCACHE
+ */
Pathname repoSolvfilesPath() const;
/**
- * Path where the repo packages are downloaded and kept.
- */
+ * Path where the repo packages are downloaded and kept (repoCachePath()/packages).
+ * \ingroup g_ZC_REPOCACHE
+ */
Pathname repoPackagesPath() const;
/**
- * Path where the known repositories
- * .repo files are kept
+ * Path where the configfiles are kept (/etc/zypp).
+ * \ingroup g_ZC_CONFIGFILES
+ */
+ Pathname configPath() const;
+
+ /**
+ * Path where the known repositories .repo files are kept (configPath()/repos.d).
+ * \ingroup g_ZC_CONFIGFILES
*/
Pathname knownReposPath() const;
@@ -138,22 +148,30 @@
bool download_use_deltarpm() const;
/**
- * Directory for equivalent vendor definitions
+ * Directory for equivalent vendor definitions (configPath()/vendors.d)
+ * \ingroup g_ZC_CONFIGFILES
*/
Pathname vendorPath() const;
/**
+ * Directory for additional product information (configPath()/products.d)
+ * \ingroup g_ZC_CONFIGFILES
+ */
+ Pathname productsPath() const;
+
+ /**
* Solver regards required packages,patterns,... only
*/
bool solver_onlyRequires() const;
/**
- * Path where zypp can find or create lock file
+ * Path where zypp can find or create lock file (configPath()/locks)
+ * \ingroup g_ZC_CONFIGFILES
*/
- Pathname locksFile() const;
+ Pathname locksFile() const;
/**
- * Whetever locks file should be readed and applied after start
+ * Whether locks file should be read and applied after start
*/
bool apply_locks_file() const;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org