#
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")
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();
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- 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;
-------------------------------------------------------------------
+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)
#include <zypp/ZYpp.h>
#include <zypp/zypp_detail/ZYppReadOnlyHack.h>
+#include <zypp/parser/ProductConfReader.h>
#include <zypp/ZYppFactory.h>
#include <zypp/RepoManager.h>
#include <zypp/base/Logger.h>
{
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();
};
+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
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 ) )
{
// 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 );
else
zypp::invokeOnEach( Z->pool().begin(), Z->pool().end(), // all kinds
zypp::functor::functorRef<bool,PoolItem> (printitem) );
-
+
}
-else
-{
+ else
+ {
PrintItem printitem( repository );
if (installed_only)
zypp::invokeOnEach( Z->pool().byKindBegin( kind ), Z->pool().byKindEnd( kind ), // filter kind
else
zypp::invokeOnEach( Z->pool().byKindBegin( kind ), Z->pool().byKindEnd( kind ), // filter kind
zypp::functor::functorRef<bool,PoolItem> (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;
}
string repository;
bool only_installed = false;
int offset = 1;
-
+
if ( (argc>1) && ( (string(argv[offset]) == "--registrable")
|| ( string(argv[offset]) == "-r" ) ) )
{
if ( argc > 1 )
{
filter = argv[offset];
- --argc; ++offset;
-
+ --argc; ++offset;
+
if ( argc > 1 )
{
repository = argv[offset];
##
+## 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
##
## 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
## 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
{
cfg_packages_path = Pathname(value);
}
+ else if ( entry == "configdir" )
+ {
+ cfg_config_path = Pathname(value);
+ }
else if ( entry == "reposdir" )
{
cfg_known_repos_path = Pathname(value);
{
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 );
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;
? (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("!@$");
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;
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;
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;