3 ## DOC: generate cran2deb status web pages
6 suppressPackageStartupMessages(library(cran2deb))
11 'verbose','v', 0, "logical",
12 'debug', 'd', 0, "logical",
13 'help', 'h', 0, "logical",
14 'root', 'r', 2, "character"
17 .Last <- function() { if (!is.null(opt$verbose)) {cat("Printing the traceback, just to be sure:\n"); print(traceback())} }
19 web.cran2deb.root<-"/var/www/cran2deb"
20 if (!is.null(opt$root)) {
21 web.cran2deb.root <- opt$root
24 if (!is.null(opt$debug)) {
26 cat(" * root: ",web.cran2deb.root,"\n",sep="")
33 if (!is.null(opt$verbose)) cat("building banned_packages.html\n")
34 banned_builds_path=paste(web.cran2deb.root,"banned_packages.html",sep="/")
36 if (!is.null(opt$verbose)) cat("building todays_packages.html\n")
37 todays_builds_path=paste(web.cran2deb.root,"todays_packages.html",sep="/")
39 if (!is.null(opt$verbose)) cat("building latest_packages.html\n")
40 latest_builds_path=paste(web.cran2deb.root,"latest_packages.html",sep="/")
42 if (!is.null(opt$verbose)) cat("building failed_packages.html\n")
43 failed_builds_path=paste(web.cran2deb.root,"failed_packages.html",sep="/")
45 links <- function(p) {
47 hwrite('Packages built today',link='todays_packages.html')
48 ,hwrite('Successful packages',link='latest_packages.html')
49 ,hwrite('Failed packages',link='failed_packages.html')
50 ,hwrite('Banned packages',link='banned_packages.html')
51 ),p,center=TRUE,border=0,style='padding: 6px 6px 6px 12px')
52 if (!is.null(opt$verbose)) cat("Wrote links for ",p,".\n",sep="")
55 page <- function(content,path,title) {
56 title <- paste('cran2deb:',title)
57 p <- openPage(path,title=title)
58 hwrite(title,p,heading=1)
59 hwrite('Install instructions',p,center=TRUE,link='/')
61 if (nrow(content)>0) {
62 hwrite(content,p,center=TRUE,border=1
63 ,table.style='border-collapse: collapse; padding: 0; margin: 0'
64 ,row.names=FALSE,row.bgcolor='#ffaaaa')
67 hwrite("None",p,center=TRUE)
72 page(db_blacklist_reasons(),banned_builds_path,'Banned packages')
73 page(db_todays_builds(),todays_builds_path,'Packages built today')
74 page(db_successful_builds(),latest_builds_path,'Latest successfully built packages')
75 page(db_failed_builds(),failed_builds_path,'Recent failed packages')