write_PACKAGES             package:tools             R Documentation

_G_e_n_e_r_a_t_i_n_g _a _P_A_C_K_A_G_E_S _f_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Generating a 'PACKAGES' file for a repository of source or Windows
     binary packages.

_U_s_a_g_e:

     write_PACKAGES(dir, fields,
                    type = c("source", "mac.binary", "win.binary"),
                    verbose = 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' file from and write it to. 

  fields: Optional, the fields to be used in the 'PACKAGES' file. The
          default are those needed by 'available.packages': "Package",
          "Bundle", "Priority", "Version", "Depends", "Suggests",
          "Imports" and "Contains". 

    type: Type of packages: currently source '.tar.gz' archives and
          Windows binary '.zip' packages are supported.  Defaults to
          '"win.binary"' on Windows and to '"source"' otherwise. 

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

_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 a 'PACKAGES' file
     from these information.

_V_a_l_u_e:

     Invisibly returns the number of packages described in the
     resulting 'PACKAGES' file.  If 0, no packages were found and no
     'PACKAGES' file has been 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 = "winBinary"' 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' file.

_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)

