]> git.donarmstrong.com Git - cran2deb.git/commitdiff
cran2deb: more license matching for when a package does not follow the R guidelines
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:13:26 +0000 (13:13 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:13:26 +0000 (13:13 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@22 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/trunk/cran2deb

index 6104ddb04518254666af882c4086ef863f8c7cda..6b499d7a5465828e1a6eb0b299b618b7be9f0bdc 100755 (executable)
@@ -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))