'SELECT debian_name FROM sysreq_override WHERE'
,db.quote(sysreq_text),'GLOB r_pattern'))
db.stop(con)
+ if (length(results) == 0) {
+ return(NA)
+ }
return(results$debian_name)
}
,db.quote(name),'= name'))
db.stop(con)
if (length(results) == 0) {
- return(FALSE)
+ return(NA)
}
return(as.logical(results$accept))
}
,db.quote(file_sha1),'= license_files.file_sha1'))
db.stop(con)
# TODO: change accept from 0,1 into FALSE,TRUE
- # TODO: NULL -> FALSE
+ # TODO: NULL -> NA
return(results)
}
# don't care about versions of licenses
license = chomp(sub('\\( ?[<=>!]+ ?[0-9.-]+ ?\\)',''
,sub('-[0-9.-]+','',license)))
- if (db.license.override.name(license)) {
- return(T)
+ action = db.license.override.name(license)
+ if (!is.na(action)) {
+ return(action)
}
# uninteresting urls
license = gsub('http://www.gnu.org/[[:alnum:]/._-]*','',license)
license = gsub('(mozilla )?(mpl|mozilla public)','mpl',license)
# remove any extra space introduced
license = chomp(gsub('[[:space:]]+',' ',license))
- if (db.license.override.name(license)) {
- message(paste('W: Accepted wild license as',license,'. FIX THE PACKAGE!'))
- return(T)
+ action = db.license.override.name(license)
+ if (!is.na(action)) {
+ message(paste('W: Accepting/rejecting wild license as',license,'. FIX THE PACKAGE!'))
+ return(action)
}
# remove everything that looks like a version specification
license = gsub('(ver?sion|v)? *[0-9.-]+ *(or *(higher|later|newer|greater|above))?',''
,license)
# remove any extra space introduced
license = chomp(gsub('[[:space:]]+',' ',license))
- if (db.license.override.name(license)) {
- message(paste('W: Accepted wild license as',license,'. FIX THE PACKAGE!'))
- return(T)
+ action = db.license.override.name(license)
+ if (!is.na(action)) {
+ message(paste('W: Accepting/rejecting wild license as',license,'. FIX THE PACKAGE!'))
+ return(action)
}
# TODO: file {LICENSE,LICENCE} (+ maybe COPYING?)
- message(paste('E: Wild license',license,'did not match'))
+ message(paste('E: Wild license',license,'did not match; rejecting'))
return(F)
}