From: blundellc Date: Sat, 13 Sep 2008 13:13:26 +0000 (+0000) Subject: cran2deb: more license matching for when a package does not follow the R guidelines X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=eb2f7c78918d1c095956d727c1abd7f2311fd22d;p=cran2deb.git cran2deb: more license matching for when a package does not follow the R guidelines git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@22 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/pkg/trunk/cran2deb b/pkg/trunk/cran2deb index 6104ddb..6b499d7 100755 --- a/pkg/trunk/cran2deb +++ b/pkg/trunk/cran2deb @@ -116,7 +116,8 @@ prepare.pkg <- function(dir, pkgname,repo='cran',repoURL='http://cran.uk.r-proje return(pkg) } -debian_ok_licenses=c('GPL','LGPL','AGPL','ARTISTIC','UNLIMITED','BSD') +debian_ok_licenses=c('GPL','LGPL','AGPL','ARTISTIC','UNLIMITED' + ,'BSD','MIT','APACHE') is_acceptable_license <- function(license) { # compress spaces into a single space @@ -129,10 +130,14 @@ is_acceptable_license <- function(license) { if (license %in% debian_ok_licenses) { return(T) } + # redundant + license = gsub('LICEN[SC]E','',license) + license = gsub('(GNU )?(GPL|GENERAL PUBLIC)','GPL',license) + license = gsub('HTTP://WWW.GNU.ORG/[A-Z/.-]*','',license) # remove all punctuation license = gsub('[[:punct:]]+','',license) # remove everything that looks like a version specification - license = gsub('(VERSION|V)? *[0-9.]+ *(OR *(LATER|NEWER))?','' + license = gsub('(VERSION|V)? *[0-9.]+ *(OR *(LATER|NEWER|GREATER|ABOVE))?','' ,license) # remove any extra space license = chomp(gsub('[[:space:]]+',' ',license))