{
getZYpp()->initializeTarget( sysRoot );
getZYpp()->target()->load();
+ SEC << getZYpp()->target()->release() << endl;
}
}
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- if ( !pool.empty() )
- {
- PoolItem pi ( getPi<Package>( "aspell" ) );
- MIL << pi << endl;
- if ( pi )
- {
- pi.status().setTransact( true, ResStatus::USER );
- solve();
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_begin<resfilter::ByTransact>(pool),
- make_filter_end<resfilter::ByTransact>(pool) ) << endl;
- install();
- }
-
- }
-
- ///////////////////////////////////////////////////////////////////
- INT << "===[END]============================================" << endl << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
if ( 0 ) {
- Measure x( "PROCXY" );
+ Measure x( "PROXY" );
pool.proxy();
}
-------------------------------------------------------------------
+Mon Apr 21 15:38:10 CEST 2008 - ma@suse.de
+
+- Added Target::release(), returning the targets distribution
+ release string.
+- revision 9761
+
+-------------------------------------------------------------------
Sat Apr 19 01:08:04 CEST 2008 - ma@suse.de
- per default abort if package installation fails. (bnc #381203)
Date Target::timestamp() const
{ return _pimpl->timestamp(); }
+ std::string Target::release() const
+ { return _pimpl->release(); }
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
/** return the last modification date of the target */
Date timestamp() const;
+ /** The targets distribution release string.
+ * \code
+ * openSUSE 10.3 (i586)
+ * \endcode
+ */
+ std::string release() const;
+
public:
/** Ctor. If \c doRebuild_r is \c true, an already existing
* database is rebuilt (rpm --rebuilddb ).
*
*/
#include <iostream>
+#include <fstream>
#include <sstream>
#include <string>
#include <list>
#include "zypp/base/Exception.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/Gettext.h"
+#include "zypp/base/IOStream.h"
#include "zypp/base/UserRequestException.h"
#include "zypp/ZConfig.h"
return _rpm.timestamp();
}
+ std::string TargetImpl::release() const
+ {
+ std::ifstream suseRelease( (_root / "/etc/SuSE-release").c_str() );
+ for( iostr::EachLine in( suseRelease ); in; in.next() )
+ {
+ std::string line( str::trim( *in ) );
+ if ( ! line.empty() )
+ return line;
+ }
+
+ return _("Unknown Distribution");
+ }
+
void TargetImpl::installSrcPackage( const SrcPackage_constPtr & srcPackage_r )
{
// provide on local disk
/** return the last modification date of the target */
Date timestamp() const;
+ /** The targets distribution release string.
+ * \code
+ * openSUSE 10.3 (i586)
+ * \endcode
+ */
+ std::string release() const;
+
protected:
/** Path to the target */
Pathname _root;