void eapMetaSync(char *host, char *userId, char *password) /* eapMetaSync - Send JSON over to metadatabase at Stanford describing software, versions, * steps, analysis runs, and the file relationships produced by these runs.. */ { gHost = host; gUserId = userId; gPassword = password; struct sqlConnection *conn = eapConnectReadWrite(); syncSoftware(conn); syncSoftwareVersion(conn); syncStep(conn); sqlDisconnect(&conn); }
void eapAddStep(char *pattern) /* eapAddStep - Add a step to eapStep and related tables. This is just a small shortcut for doing * it in SQL. You can only add steps defined in C code.. */ { struct sqlConnection *conn = eapConnectReadWrite(); int i; for (i=0; i<ArraySize(steps); ++i) { struct stepInit *init = &steps[i]; if (wildMatch(pattern, init->name)) { if (clList) puts(init->name); else initStep(conn, init); } } }
void eapUpdateSoftware(char *software, char *notes) /* eapUpdateSoftware - Get a new version of software.. */ { char query[512]; struct sqlConnection *conn = eapConnectReadWrite(); char *version = clVersion; if (version == NULL) { sqlSafef(query, sizeof(query), "select version from eapSwVersion where software='%s' order by id desc", software); version = sqlQuickString(conn, query); if (version == NULL) errAbort("Can't find existing version of %s, please use version option on command line", software); } char *md5 = clMd5; char md5Hex[33]; if (md5 == NULL) { eapMd5ForCommand(software, md5Hex); md5 = md5Hex; } sqlSafef(query, sizeof(query), "select count(*) from eapSwVersion where software='%s'" " and version='%s' and md5='%s'", software, version, md5); int existing = sqlQuickNum(conn, query); if (existing > 0) errAbort("Warn %d existing %s %s %s in eapSwVersion", existing, software, version, md5); sqlSafef(query, sizeof(query), "insert eapSwVersion (software, version, md5, redoPriority, notes) " " values ('%s', '%s', '%s', %d, '%s')" , software, version, md5, redoPriority, notes); sqlUpdate(conn, query); }