Package *pkg=Package::create(*this, n);
packages.insert(PackageMap::value_type(n, pkg));
- new_pkgs.push_back(pkg);
+ if(pkg)
+ new_pkgs.push_back(pkg);
return pkg;
}
std::list<std::string> missing;
for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
- {
- const list<PackageRef> &requires=i->second->get_requires();
- for(list<PackageRef>::const_iterator j=requires.begin(); j!=requires.end(); ++j)
- if(!j->get_package())
- missing.push_back(j->get_name());
- }
+ if(!i->second)
+ missing.push_back(i->first);
if(!missing.empty())
{
missing.sort();
- missing.unique();
cerr<<"The following packages were not found on the system:\n";
for(list<string>::iterator i=missing.begin(); i!=missing.end(); ++i)
cerr<<" "<<*i<<'\n';