@@ -132,6 +132,8 @@ void PackageStore::process(const path &p, Config &root)
132132 // add more necessary actions here
133133 for (auto &cc : *this )
134134 {
135+ if (cc.first == Package ())
136+ continue ;
135137 root.getDefaultProject ().checks += cc.second .config ->getDefaultProject ().checks ;
136138 }
137139
@@ -141,6 +143,8 @@ void PackageStore::process(const path &p, Config &root)
141143 // do not multithread this! causes livelocks
142144 for (auto &cc : *this )
143145 {
146+ if (cc.first == Package ())
147+ continue ;
144148 auto &d = cc.first ;
145149
146150 auto printer = Printer::create (Settings::get_local_settings ().printerType );
@@ -218,6 +222,8 @@ void PackageStore::check_deps_changed()
218222 std::unordered_map<Package, String> clean_pkgs;
219223 for (auto &cc : *this )
220224 {
225+ if (cc.first == Package ())
226+ continue ;
221227 // make sure we have ordered deps
222228 Hasher h;
223229 StringSet deps;
@@ -256,41 +262,21 @@ void PackageStore::check_deps_changed()
256262
257263PackageStore::iterator PackageStore::begin ()
258264{
259- auto i = packages.find (Package ());
260- if (i == packages.begin ())
261- return ++i;
262265 return packages.begin ();
263266}
264267
265268PackageStore::iterator PackageStore::end ()
266269{
267- auto i = packages.find (Package ());
268- if (i != packages.end ())
269- {
270- if (i == --packages.end ())
271- return i;
272- throw std::logic_error (" Oops! Empty package not at the end of packages" );
273- }
274270 return packages.end ();
275271}
276272
277273PackageStore::const_iterator PackageStore::begin () const
278274{
279- auto i = packages.find (Package ());
280- if (i == packages.begin ())
281- return ++i;
282275 return packages.begin ();
283276}
284277
285278PackageStore::const_iterator PackageStore::end () const
286279{
287- auto i = packages.find (Package ());
288- if (i != packages.end ())
289- {
290- if (i == --packages.end ())
291- return i;
292- throw std::logic_error (" Oops! Empty package not at the end of packages" );
293- }
294280 return packages.end ();
295281}
296282
@@ -318,6 +304,8 @@ void PackageStore::write_index() const
318304 auto &sdb = getServiceDatabase ();
319305 for (auto &cc : *this )
320306 {
307+ if (cc.first == Package ())
308+ continue ;
321309 sdb.addInstalledPackage (cc.first );
322310#ifdef _WIN32
323311 create_link (cc.first .getDirSrc (), directories.storage_dir_lnk / " src" / (cc.first .target_name + " .lnk" ));
0 commit comments