]> git.donarmstrong.com Git - cran2deb.git/commitdiff
license: change syntax: accept licenses not packages. add view command for licenses.
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:20:56 +0000 (13:20 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:20:56 +0000 (13:20 +0000)
also includes some wild license rules from the current bulk build.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@79 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/trunk/data/populate_licenses
pkg/trunk/exec/license

index 70e941c10bd3c6f3f5dda91f770ed5da04d36686..8a941fcf47d5776fb6e64a1e0157871834f158e9 100644 (file)
@@ -1,19 +1,68 @@
-add GPL
+accept AGPL
+accept APACHE
+accept ARTISTIC
+accept BSD
+accept CeCILL
+accept CPL
+accept GPL
+accept GPLQA
+accept GPL+QHULL
+accept LGPL
+accept MIT
+accept MPL
+accept TCLTK2
+accept UNLIMITED
+accept X11
+reject distrib-noncomm
+reject GPL+ACM
+reject MCLUST
+reject UNCLEAR
+hash APACHE /usr/share/common-licenses/Apache-2.0
+hash ARTISTIC /usr/share/common-licenses/Artistic
+hash BSD /usr/share/common-licenses/BSD
 hash GPL /usr/share/common-licenses/GPL-2
 hash GPL /usr/share/common-licenses/GPL-3
-add LGPL
 hash LGPL /usr/share/common-licenses/LGPL-2
 hash LGPL /usr/share/common-licenses/LGPL-2.1
 hash LGPL /usr/share/common-licenses/LGPL-3
-add BSD
-hash BSD /usr/share/common-licenses/BSD
-add ARTISTIC
-hash ARTISTIC /usr/share/common-licenses/Artistic
-add APACHE
-hash APACHE /usr/share/common-licenses/Apache-2.0
-add AGPL
-add MIT
-add X11
-add MPL
-add UNLIMITED reject
+pkg BSD minpack.lm
+pkg CeCILL LLAhclust
+pkg CPL lmom
+pkg distrib-noncomm Bhat
+pkg distrib-noncomm conf.design
+pkg distrib-noncomm gpclib
+pkg distrib-noncomm mlbench
+pkg distrib-noncomm poplab
+pkg distrib-noncomm PredictiveRegression
+pkg distrib-noncomm PTAk
+pkg distrib-noncomm siggenes
+pkg GPL+ACM akima
+pkg GPL+ACM tripack
+pkg GPL ergm
+pkg GPL gmodels
+pkg GPL ICE
+pkg GPL network
+pkg GPL pastecs
+pkg GPL pbatR
+pkg GPL PKtools
+pkg GPL+QHULL geometry
+pkg GPL reldist
+pkg GPL RXshrink
+pkg GPL snpMatrix
+pkg GPL splancs
+pkg GPL uroot
+pkg LGPL R.huge
+pkg MCLUST mclust
+pkg TCLTK2 tcltk2
+pkg UNCLEAR adapt
+pkg UNCLEAR cat
+pkg UNCLEAR cosmo
+pkg UNCLEAR mix
+pkg UNCLEAR mlmm
+pkg UNCLEAR norm
+pkg UNCLEAR pan
+pkg UNCLEAR titecrm
+pkg UNCLEAR tlnise
+pkg UNLIMITED boolean
+pkg GPLQA regtest
 ls
index 526387987246f8526c7d6c66ef980e9e1a79e9ff..e67ad3da478a14a5964ff1c9dddfdad99c8813e6 100755 (executable)
@@ -5,10 +5,11 @@ suppressPackageStartupMessages(library(digest))
 
 exec_cmd <- function(argc, argv) {
     usage <- function()
-        message(paste('usage: add <license> [reject]'
+        message(paste('usage: accept <license>'
+                     ,'       reject <license>'
                      ,'       hash <license> (<path>|<hash>)'
-                     ,'       accept <pkg> <license name>'
-                     ,'       reject <pkg> <license name>'
+                     ,'       pkg <license> <pkg>'
+                     ,'       view <pkg>'
                      ,'       ls'
                      ,'       quit'
                      ,sep='\n'))
@@ -18,12 +19,12 @@ exec_cmd <- function(argc, argv) {
     }
     cmd = argv[1]
 
-    if (cmd == 'add') {
-        if (argc != 2 && (argc != 3 || argv[3] != 'reject')) {
+    if (cmd == 'accept' || cmd == 'reject') {
+        if (argc != 2) {
             usage()
             return()
         }
-        action = (argc != 3)
+        action = (cmd == 'accept')
         db_add_license_override(argv[2],action)
     } else if (cmd == 'hash') {
         if (argc != 3) {
@@ -46,22 +47,23 @@ exec_cmd <- function(argc, argv) {
             return()
         }
         db_add_license_hash(license,license_sha1)
-    } else if (cmd == 'reject' || cmd == 'accept') {
+    } else if (cmd == 'pkg') {
         if (argc != 3) {
             usage()
             return()
         }
-        pkg_name <- argv[2]
-        license <- argv[3]
+        license <- argv[2]
+        pkg_name <- argv[3]
         current_action <- db_license_override_name(license)
-        action = (cmd == 'accept')
         if (is.na(current_action)) {
-            message(paste('N: license',license,'is not known; adding it'))
-            db_add_license_override(license,action)
-        } else if (action != current_action) {
-            message(paste('E: differing actions propose for license',license))
+            message(paste('N: license',license,'is not known; add it'))
             return()
         }
+        action = 'accept'
+        if (!current_action) {
+            action = 'reject'
+        }
+        message(paste('in future, will',action,'the package',pkg_name,'under license',license))
         tmp <- setup()
         success <- try((function() {
             pkg <- prepare_pkg(tmp,pkg_name)
@@ -78,6 +80,28 @@ exec_cmd <- function(argc, argv) {
         if (inherits(success,'try-error')) {
             stop(call.=F)
         }
+    } else if (cmd == 'view') {
+        if (argc != 2) {
+            usage()
+            return()
+        }
+        pkg_name <- argv[2]
+        tmp <- setup()
+        success <- try((function() {
+            pkg <- prepare_pkg(tmp,pkg_name)
+            if (!('License' %in% names(pkg$description[1,]))) {
+                message(paste('E: package',pkg$name,'has no License: field in DESCRIPTION'))
+                return()
+            }
+            first_license = (strsplit(chomp(pkg$description[1,'License'])
+                                     ,'[[:space:]]*\\|[[:space:]]*')[[1]])[1]
+            first_license = get_license(pkg,first_license)
+            cat(strwrap(first_license),file='|less')
+        })())
+        cleanup(tmp)
+        if (inherits(success,'try-error')) {
+            stop(call.=F)
+        }
     } else if (cmd == 'ls') {
         for (x in db_license_overrides()) print(x)
     } else if (cmd == 'help') {