]> git.donarmstrong.com Git - cran2deb.git/blobdiff - trunk/R/getrpkg.R
1cran<rev> instead of <rev>cran1
[cran2deb.git] / trunk / R / getrpkg.R
index 5273a1fc601124da080b5dfe00c6061d06e905c5..b5e990f0bcc856275672fb44e41bff53b8b4456a 100644 (file)
@@ -16,7 +16,7 @@ download_pkg <- function(dir, pkgname) {
 
     # record some basic information
     pkg <- pairlist()
-    pkg$date_stamp = format(Sys.time(),'%a, %d %b %Y %H:%M:%S %z')
+    pkg$date_stamp = Sys.time()
     pkg$name = pkgname
     pkg$repoURL = available[pkgname,'Repository']
     pkg$repo = repourl_as_debian(pkg$repoURL)
@@ -39,6 +39,7 @@ download_pkg <- function(dir, pkgname) {
         pkg$archive <- file.path(dir, basename(debfn))
         file.copy(debfn,pkg$archive)
         pkg$path = file.path(dir, paste(pkg$srcname ,pkg$version ,sep='-'))
+        notice('using an existing debianized source tarball:',debfn)
     } else {
         # see if we have a local mirror in /srv/R
         use_local = FALSE
@@ -82,6 +83,7 @@ download_pkg <- function(dir, pkgname) {
 
 repack_pkg <- function(pkg) {
     # re-pack into a Debian-named archive with a Debian-named directory.
+    notice('repacking into debian source archive.')
     debpath = file.path(dirname(pkg$archive)
                    ,paste(pkg$srcname
                          ,pkg$version
@@ -100,6 +102,10 @@ repack_pkg <- function(pkg) {
                 ,'-type f -a '
                 ,   '! \\( -name configure -o -name cleanup \\)'
                 ,'-exec chmod -x {} \\;')
+    if (file.exists(file.path(basename(pkg$path),'debian'))) {
+        warn('debian/ directory found in tarball! removing...')
+        unlink(file.path(basename(pkg$path),'debian'),recursive=TRUE)
+    }
     # tar it all back up
     log_system('tar -czf',shQuote(debarchive),shQuote(basename(pkg$path)))
     setwd(wd)