Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11595 - /trunk/libzypp/zypp/target/TargetImpl.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Nov 2008 15:25:15 -0000
  • Message-id: <20081106152515.990B3338D2@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Nov 6 16:25:15 2008
New Revision: 11595

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11595&view=rev
Log:
remove superfluous tests

Modified:
trunk/libzypp/zypp/target/TargetImpl.cc

Modified: trunk/libzypp/zypp/target/TargetImpl.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=11595&r1=11594&r2=11595&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/TargetImpl.cc (original)
+++ trunk/libzypp/zypp/target/TargetImpl.cc Thu Nov 6 16:25:15 2008
@@ -330,7 +330,7 @@
prog.close();
return id;
}
-
+
/**
* updates the content of \p filename
* if \p condition is true, setting the content
@@ -351,14 +351,14 @@
MIL << "updating '" << filename << "' content." << endl;

// if the file does not exist we need to generate the uuid file
-
+
std::ofstream filestr;
// make sure the path exists
filesystem::assert_dir( filename.dirname() );
filestr.open( filename.c_str() );

if ( filestr.good() )
- {
+ {
filestr << val;
filestr.close();
}
@@ -369,25 +369,25 @@
}
}
}
-
+
/** helper functor */
static bool fileMissing( const Pathname &pathname )
{
return ! PathInfo(pathname).isExist();
}
-
+
void TargetImpl::createAnonymousId() const
{
-
+
// create the anonymous unique id
// this value is used for statistics
Pathname idpath( home() / "AnonymousUniqueId");
-
+
updateFileContent( idpath,
boost::bind(fileMissing, idpath),
generateRandomId );
}
-
+
void TargetImpl::createLastBaseProductFlavorCache() const
{
// create the anonymous unique id
@@ -401,15 +401,15 @@
WAR << "No base product, can't create flavor cache" << endl;
return;
}
-
+
string flavor = p->flavor();
-
+
//updateFileContent( flavorpath,
// // only if flavor is not empty
// ( flavor.empty() ? functor::False() :
functor::True() ),
// flavor );
}
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : TargetImpl::~TargetImpl
@@ -1009,16 +1009,12 @@
ResPool pool(ResPool::instance());
for_( it, pool.byKindBegin<Product>(), pool.byKindEnd<Product>() )
{
- Product::constPtr p = asKind<Product>((*it).resolvable());
- if ( p && (*it).status().isInstalled() )
- {
- if ( p->isTargetDistribution() )
- return p;
- }
+ Product::constPtr p = (*it)->asKind<Product>();
+ if ( p->isTargetDistribution() )
+ return p;
}
-
return 0L;
- }
+ }

std::string TargetImpl::targetDistribution() const
{ return rpmdb2solvAttr( "register.target", _root ); }

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages