[zypp-devel] New: ZYpp::getTarget and Target::assertRootPrefix
JFYI: New methods class ZYpp: /** Same as \ref target but returns NULL if target is not * initialized, instead of throwing. */ Target_Ptr zypp::getTarget() const; class Target: /** Return the path prefixed by the target root, unless * it already is prefixed. */ Pathname Target::assertRootPrefix( const Pathname & path_r ) const { return Pathname::assertprefix( root(), path_r ); } So if you have a Pathname mypath; and want to prefix it with the targets root, in case the target is already initialized: Target_Ptr target( getZYpp()->getTarget() ); if ( target ) mypath = target->assertRootPrefix( mypath ); -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (1)
-
Michael Andres