Rev 49876 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/writePACKAGES.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2009 R Core Development Team% Distributed under GPL 2 or later\name{write_PACKAGES}\alias{write_PACKAGES}\title{Generate PACKAGES files}\description{Generate \file{PACKAGES} and \file{PACKAGES.gz} files for arepository of source or Mac/Windows binary packages.}\usage{write_PACKAGES(dir = ".", fields = NULL,type = c("source", "mac.binary", "win.binary"),verbose = FALSE, unpacked = FALSE, subdirs = FALSE,latestOnly = TRUE, addFiles = FALSE)}\arguments{\item{dir}{Character vector describing the location of the repository(directory including source or binary packages) to generate the\file{PACKAGES} and \file{PACKAGES.gz} files from and write them to.}\item{fields}{a character vector giving the fields to be used in the\file{PACKAGES} and \file{PACKAGES.gz} files in addition to thedefault ones, or \code{NULL} (default). The default corresponds tothe fields needed by \code{\link{available.packages}}:\code{"Package"}, \code{"Version"}, \code{"Priority"},\code{"Bundle"}, \code{"Contains"},\code{"Depends"}, \code{"Imports"}, \code{"LinkingTo"},\code{"Suggests"}, \code{"Enhances"}, \code{"OS_type"},and \code{"License"} and those fields will always be included, plusthe file name in field \code{"File"} if \code{addFile = TRUE}and the path to the subdirectory in field \code{"Path"} if subdirectoriesare used.}\item{type}{Type of packages: currently source \file{.tar.gz} archives, and Macor Windows binary (\file{.tgz} or \file{.zip}, respectively)packages are supported. Defaults to \code{"win.binary"} on Windowsand to \code{"source"} otherwise.}\item{verbose}{logical. Should packages be listed as they areprocessed?}\item{unpacked}{a logical indicating whether the package contents areavailable in unpacked form or not (default).}\item{subdirs}{either logical (to indicate if subdirectories should beincluded, recursively) or a character vector of name of subdirectoriesto include.}\item{latestOnly}{logical: if multiple versions of a package areavailable should only the latest version be included?}\item{addFiles}{logical: should the filenames be included as field\samp{File} in the \file{PACKAGES} file.}}\details{Including non-latest versions of packages is only useful if they haveless constraining version requirements, so for example\code{latestOnly = FALSE} could be used for a source repository when\samp{foo_1.0} depends on \samp{R >= 2.10.0} but \samp{foo_0.9} isavailable which depends on \samp{R >= 2.7.0}.Support for repositories with subdirectories and hence for\code{subdirs != FALSE} was added in \R 2.7.0: this depends onrecording a \code{"Path"} field in the \file{PACKAGES} file.Support for more general file names (e.g. other types of compression)\emph{via} a \code{"File"} field in the \file{PACKAGES} file was addedin \R 2.10.0 and can be used by \code{\link{download.packages}}. Ifthe file names are not of the standard form, use\code{addFiles = TRUE}.\code{type = "win.binary"} uses \code{\link{unz}} connections to readall \file{DESCRIPTION} files contained in the (zipped) binary packagesfor Windows in the given directory \code{dir}, and builds files\file{PACKAGES} and \file{PACKAGES.gz} files from this information.}\value{Invisibly returns the number of packages described in the resulting\file{PACKAGES} and \file{PACKAGES.gz} files. If \code{0}, no packages werefound and no files were written.}\note{Processing \file{.tar.gz} archives to extract the \file{DESCRIPTION}files is quite slow.This function can be useful on other OSes to prepare a repository tobe accessed by Windows machines, so \code{type = "win.binary"} shouldwork on all OSes.}\author{Uwe Ligges and R-core.}\seealso{See \code{\link{read.dcf}} and \code{\link{write.dcf}} for reading\file{DESCRIPTION} files and writing the \file{PACKAGES} and\file{PACKAGES.gz} files.}\examples{\dontrun{write_PACKAGES("c:/myFolder/myRepository") # on Windowswrite_PACKAGES("/pub/RWin/bin/windows/contrib/2.9",type="win.binary") # on Linux}}\keyword{file}\keyword{utilities}