void check(JobInfoPtr info) { if(info->isSuccess()) cout << "SUCCESS: " << info->getMessage() << " prog=" << info->getCurrent() << "/" << info->getTotal() << endl; else cout << "FAILURE: " << info->getMessage() << endl; }
void inst(const std::string &where, bool doUpgrade) { cout << "\nINSTALLING to " << where << endl; JobInfoPtr inf = spr->installPack("test", "test", where, NULL, false, doUpgrade); if(inf) if(inf->isSuccess()) cout << "SUCCESS!\n"; else inf->failError(); else cout << "NO JOB EXECUTED\n"; printDir(where); }
void uninst(const std::string &where) { cout << "\nUNINSTALLING " << where << endl; JobInfoPtr inf = spr->uninstallPack("test", "test", where, false); if(inf) if(inf->isSuccess()) cout << "SUCCESS!\n"; else inf->failError(); else cout << "NO JOB EXECUTED\n"; shortStatus(*spr); if(bf::exists(where)) throw runtime_error("ERROR: dir still exists!\n"); }
void testStatus(Job &j) { JobInfoPtr info = j.getInfo(); if(info->isBusy()) cout << "Busy!"; else if(!info->hasStarted()) cout << "Not started yet!"; else if(info->isSuccess()) cout << "Success!"; else if(info->isError()) cout << "Failure: " << info->getMessage(); else if(info->isAbort()) cout << "Abort!"; cout << " - progress " << info->getCurrent() << "/" << info->getTotal() << endl; }