]> git.donarmstrong.com Git - cran2deb.git/commitdiff
add blacklist. build packages already in debian.
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 2 Mar 2009 21:37:52 +0000 (21:37 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 2 Mar 2009 21:37:52 +0000 (21:37 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@195 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

trunk/R/build.R
trunk/R/db.R

index 5fd572d92cb32e7c0a0bc987c9870f02c1a8f0c8..157c888738ffb2ada70c6de4a2f54505c74d3456 100644 (file)
@@ -20,6 +20,10 @@ build <- function(name,extra_deps,force=F) {
             return(NULL)
         }
 
+        if (name %in% db_blacklist_packages()) {
+            fail('package',name,'is blacklisted. consult database for reason.')
+        }
+
         pkg <- prepare_new_debian(prepare_pkg(dir,name),extra_deps)
         if (pkg$debversion != version) {
             fail('expected Debian version',version,'not equal to actual version',pkg$debversion)
@@ -80,12 +84,6 @@ needs_build <- function(name,version) {
         return(F)
     }
 
-    # XXX: what about building newer versions of Debian packages?
-    if (debname %in% debian_pkgs) {
-        notice(srcname,' exists in Debian (perhaps a different version)')
-        return(F)
-    }
-
     if (build$r_version != version_upstream(version)) {
         notice('rebuilding',name,': new upstream version',build$r_version,'(old) vs',version_upstream(version),'(new)')
     }
index 4c9434e85276740080d435087c48dd8953781b97..c9688c13ec503ceeaa112d707d8349f2570abf47 100644 (file)
@@ -66,6 +66,12 @@ db_start <- function() {
                   ,',UNIQUE(package,system,r_version,deb_epoch,deb_revision,db_version)'
                   ,')'))
     }
+    if (!dbExistsTable(con,'blacklist_packages')) {
+        dbGetQuery(con,paste('CREATE TABLE blacklist_packages ('
+                     ,'package TEXT PRIMARY KEY NOT NULL '
+                  ,'reason TEXT NOT NULL '
+                  ,')'))
+    }
     return(con)
 }
 
@@ -377,3 +383,9 @@ db_outdated_packages <- function() {
     return(packages)
 }
 
+db_blacklist_packages <- function() {
+    con <- db_start()
+    packages <- dbGetQuery(con,'SELECT packages from blacklist_packages')$package
+    db_stop(con)
+    return(packages)
+}