write_PACKAGES             package:tools             R Documentation

_G_e_n_e_r_a_t_e _P_A_C_K_A_G_E_S _f_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Generate 'PACKAGES' and 'PACKAGES.gz' files for a repository of
     source or Mac/Windows binary packages.

_U_s_a_g_e:

     write_PACKAGES(dir = ".", fields = NULL,
                    type = c("source", "mac.binary", "win.binary"),
                    verbose = FALSE, unpacked = FALSE, subdirs = FALSE)

_A_r_g_u_m_e_n_t_s:

     dir: Character vector describing the location of the repository
          (directory including source or binary packages) to generate
          the 'PACKAGES' and 'PACKAGES.gz' files from and write them
          to. 

  fields: a character vector giving the fields to be used in the
          'PACKAGES' and 'PACKAGES.gz' files in addition to the default
          ones, or 'NULL' (default).  The default corresponds to the
          fields needed by 'available.packages': '"Package"',
          '"Bundle"', '"Priority"', '"Version"', '"Depends"',
          '"Suggests"', '"Imports"' and '"Contains"'. 

    type: Type of packages: currently source '.tar.gz' archives, and
          Mac or Windows binary ('.tgz' or '.zip', respectively)
          packages are supported.  Defaults to '"win.binary"' on
          Windows and to '"source"' otherwise. 

 verbose: logical.  Should packages be listed as they are processed?

unpacked: a logical indicating whether the package contents are
          available in unpacked form or not (default).

 subdirs: either logical (to indicate if subdirectories should be
          included) or a character vector of subdirectories to include.

_D_e_t_a_i_l_s:

     'type = "win.binary"' uses 'unz' connections to read all
     'DESCRIPTION' files contained in the (zipped) binary packages for
     Windows in the given directory 'dir', and builds 'PACKAGES' and
     'PACKAGES.gz' files from this information.

_V_a_l_u_e:

     Invisibly returns the number of packages described in the
     resulting 'PACKAGES' and 'PACKAGES.gz' files.  If 0, no packages
     were found and no files were written.

_N_o_t_e:

     Processing '.tar.gz' archives to extract the 'DESCRIPTION' files
     is quite slow.

     This function can be useful on other OSes to prepare a repository
     to be accessed by Windows machines, so 'type = "win.binary"'
     should work on all OSes.

_A_u_t_h_o_r(_s):

     Uwe Ligges and R-core.

_S_e_e _A_l_s_o:

     See 'read.dcf' and 'write.dcf' for reading 'DESCRIPTION' files and
     writing the 'PACKAGES' and 'PACKAGES.gz' files.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     write_PACKAGES("c:/myFolder/myRepository")  # on Windows
     write_PACKAGES("/pub/RWin/bin/windows/contrib/2.1",
                    type="win.binary")  # on Linux
     ## End(Not run)

