41 typedef intrusive_ptr<librpmDb>
Ptr;
42 typedef intrusive_ptr<const librpmDb>
constPtr;
122 static std::string
expand(
const std::string & macro_r );
129 return std::string(
"'(" ) + root_r.
asString() +
")" + sub_r.
asString() +
"'";
189 static unsigned dbRelease(
bool force_r =
false );
262 virtual void unref_to(
unsigned refCount_r )
const;
285 shared_ptr<RpmException>
error()
const;
303 unsigned size()
const;
315 virtual std::ostream &
dumpOn( std::ostream & str )
const;
452 return _dbDir.
isDir();
476 return _dbV3ToV4.
isFile();
527 shared_ptr<RpmException> dbError()
const;
538 unsigned dbHdrNum()
const;
569 bool findByFile(
const std::string & file_r );
574 bool findByProvides(
const std::string & tag_r );
579 bool findByRequiredBy(
const std::string & tag_r );
584 bool findByConflicts(
const std::string & tag_r );
596 bool findByName(
const std::string & name_r );
607 bool findPackage(
const std::string & name_r );
613 bool findPackage(
const std::string & name_r,
const Edition & ed_r );
void * dont_call_it() const
Dont call it ;) It's for development and testing only.
PathInfo _dbV4
rpmV4 database (_dbDir/Packages)
const Pathname & dbPath() const
Directory that contains the rpmdb.
static const Pathname & defaultRoot()
static bool _dbBlocked
Whether access is blocked (no _defaultDb will be available).
PathInfo _dbV3ToV4
rpmV3 database backup created on conversion to rpmV4 (_dbDir/packages.rpm3)
static unsigned blockAccess()
Blocks further access to rpmdb.
static std::ostream & dumpState(std::ostream &str)
Dump debug info.
const Pathname & path() const
Return current Pathname.
static std::string expand(const std::string ¯o_r)
const PathInfo & dbV3ToV4() const
rpmV3 database backup created on conversion to rpmV4 (_dbDir/packages.rpm3)
Pathname _dbPath
Directory that contains the rpmdb.
Collect info about what kind of rpmdb seems to be present by looking at paths and filenames...
static void dbAccess()
Access the database at the current default location.
String related utilities and Regular expression matching.
bool hasDbV3() const
Whether dbV3 file exists.
librpmDb(const Pathname &root_r, const Pathname &dbPath_r, bool readonly_r)
Private constructor! librpmDb objects are to be created via static interface only.
static librpmDb * newLibrpmDb(Pathname root_r, Pathname dbPath_r, bool readonly_r)
For internal use.
Edition represents [epoch:]version[-release]
bool usableArgs() const
Whether constructor arguments were llegal and dbDir either is a directory or may be created (path doe...
const Pathname & root() const
Root directory for all operations.
virtual void unref_to(unsigned refCount_r) const
Trigger from Rep, after refCount was decreased.
Subclass to retrieve database content.
static librpmDb::constPtr _defaultDb
Current rpmdb handle.
bool hasDbV3ToV4() const
Whether dbV3ToV4 file exists.
intrusive_ptr< librpmDb > Ptr
virtual ~librpmDb()
Destructor.
bool empty() const
Test for an empty path.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
const std::string & asString() const
String representation.
static Pathname _defaultRoot
Current root directory for all operations.
bool isExist() const
Return whether valid stat info exists.
static const Pathname & defaultDbPath()
PathInfo _dbDir
database directory (unset on illegal constructor arguments)
static unsigned dbRelease(bool force_r=false)
If there are no outstanding references to the database (e.g.
shared_ptr< RpmException > error() const
Return any database error.
Base class for reference counted objects.
const Pathname & root() const
ReferenceCounted & operator=(const ReferenceCounted &)
Assignment.
Manage access to librpm database.
const RpmHeader::constPtr & operator->() const
Forwards to the current RpmHeader::constPtr.
bool illegalArgs() const
Whether constructor arguments were illegal.
static void unblockAccess()
Allow access to rpmdb e.g.
bool hasDbDir() const
Whether dbDir directory exists.
static Pathname _defaultDbPath
Current directory (below root) that contains the rpmdb.
const PathInfo & dbV3() const
rpmV3 database (_dbDir/packages.rpm)
bool hasDbV4() const
Whether dbV4 file exists.
librpmDb internal database handle
const PathInfo & dbV4() const
rpmV4 database (_dbDir/Packages)
static bool globalInit()
Initialize lib librpm (read configfiles etc.).
Wrapper class for ::stat/::lstat.
virtual std::ostream & dumpOn(std::ostream &str) const
Dump debug info.
const Pathname & dbPath() const
intrusive_ptr< const librpmDb > constPtr
Easy-to use interface to the ZYPP dependency resolver.
Pathname _root
Root directory for all operations.
PathInfo _dbV3
rpmV3 database (_dbDir/packages.rpm)
static std::string stringPath(const Pathname &root_r, const Pathname &sub_r)
TraitsType::constPtrType constPtr
friend std::ostream & operator<<(std::ostream &str, const ReferenceCounted &obj)
Stream output via dumpOn.
const PathInfo & dbDir() const
database directory (unset on illegal constructor arguments)