- void Set(bool fetch, pkgAcquire::ItemDesc &desc) {
- desc.Owner->ID = 0;
- [database_ setFetch:fetch forURI:desc.Owner->DescURI().c_str()];
+ void Set(bool fetch, const std::string &uri) {
+ if (fetch) {
+ if (!fetches_.insert(uri).second)
+ return;
+ } else {
+ if (fetches_.erase(uri) == 0)
+ return;
+ }
+
+ //printf("Set(%s, %s)\n", fetch ? "true" : "false", uri.c_str());
+ [database_ setFetch:fetch forURI:uri.c_str()];
+ }
+
+ _finline void Set(bool fetch, pkgAcquire::Item *item) {
+ /*unsigned long ID(fetch ? 1 : 0);
+ if (item->ID == ID)
+ return;
+ item->ID = ID;*/
+ Set(fetch, item->DescURI());
+ }
+
+ void Log(const char *tag, pkgAcquire::Item *item) {
+ //printf("%s(%s) S:%u Q:%u\n", tag, item->DescURI().c_str(), item->Status, item->QueueCounter);