X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2FR%2Fdb.R;h=75c658cf1fcacac1c4d62e4ccfcf82812b04b26d;hb=054cd0c84099f25378ee5f96648f5f0f84148d30;hp=a1c47cb118bbf8b1f75118401977037979a99c21;hpb=b9a51c9ae80bee161ac076ffa48eda79b862ccbe;p=cran2deb.git diff --git a/trunk/R/db.R b/trunk/R/db.R index a1c47cb..75c658c 100644 --- a/trunk/R/db.R +++ b/trunk/R/db.R @@ -75,6 +75,7 @@ db_start <- function() { ,',broken_dependency INTEGER NOT NULL DEFAULT 0' ,',unsatisfied_dependency INTEGER NOT NULL DEFAULT 0' ,',breaks_cran2deb INTEGER NOT NULL DEFAULT 0' + ,',other INTEGER NOT NULL DEFAULT 0' ,',explanation TEXT NOT NULL ' ,')')) } @@ -419,3 +420,48 @@ db_blacklist_packages <- function() { db_stop(con) return(packages) } + +db_blacklist_reasons <- function () { + con <- db_start() + packages <- dbGetQuery(con,'SELECT package,explanation from blacklist_packages') + db_stop(con) + return(packages) +} + +db_todays_builds <- function() { + today <- db_quote(format(Sys.time(), db_date_format)) + con <- db_start() + builds <- dbGetQuery(con,paste('select id,success,system,package, + r_version as version,deb_epoch as epo, + deb_revision as rev, scm_revision as svnrev, + db_version as db,date_stamp,time_stamp + from builds where date_stamp = ',today)) + db_stop(con) + return(builds) +} + +db_successful_builds <- function() { + con <- db_start() + builds <- dbGetQuery(con,'select system,package,r_version,date_stamp,time_stamp + from builds natural join (select system,package,max(id) as id + from builds + where package not in + (select package from blacklist_packages) + group by package,system) + where success = 1') + db_stop(con) + return(builds) +} + +db_failed_builds <- function() { + con <- db_start() + builds <- dbGetQuery(con,'select system,package,r_version,date_stamp,time_stamp + from builds natural join (select system,package,max(id) as id + from builds + where package not in + (select package from blacklist_packages) + group by package,system) + where success = 0') + db_stop(con) + return(builds) +}