2 .. include:: ../../rst_prolog.rst
9 The **prepare** command brings the sources of an application in the *sources
10 application directory*, in order to compile them with the compile command.
12 The sources can be prepared from VCS software (*cvs, svn, git*), an archive or a directory.
14 .. warning:: When sat prepares a product, it first removes the
15 existing directory, except if the development mode is activated.
16 When you are working on a product, you need to declare in
17 the application configuration this product in **dev** mode.
22 VCS bases (git, svn, cvs)
23 -------------------------
25 The *prepare* command does not manage authentication on the cvs server.
26 For example, to prepare modules from a cvs server, you first need to login once.
28 To avoid typing a password for each product,
29 you may use a ssh key with passphrase, or store your password
30 (in .cvspass or .gitconfig files).
31 If you have security concerns, it is also possible to use
32 a bash agent and type your password only once.
39 By default *prepare* uses *export* mode: it creates an image
40 of the sources, corresponding to the tag or branch specified,
41 without any link to the VCS base.
42 To perform a *checkout* (svn, cvs) or a *git clone* (git),
43 you need to declare the product in dev mode in your application configuration:
44 edit the application configuration file (pyconf) and modify the product declaration:
48 sat config <application> -e
49 # and edit the product section:
50 # <product> : {tag : "my_tag", dev : "yes", debug : "yes"}
52 The first time you will execute the *sat prepare* command,
53 your module will be downloaded in *checkout* mode
54 (inside the SOURCES directory of the application.
55 Then, you can develop in this repository, and finally push
56 them in the base when they are ready.
57 If you type during the development process by mistake
58 a *sat prepare* command, the sources in dev mode will
59 not be altered/removed (Unless you use -f option)
64 * Prepare the sources of a complete application in SOURCES directory (all products): ::
66 sat prepare <application>
68 * Prepare only some modules: ::
70 sat prepare <application> --products <product1>,<product2> ...
72 * Use --force to force to prepare the products in development mode
73 (this will remove the sources and do a new clone/checkout): ::
75 sat prepare <application> --force
77 * Use --force_patch to force to apply patch to the products
78 in development mode (otherwise they are not applied): ::
80 sat prepare <application> --force_patch
82 * Prepare only products that are not present in SOURCES.
83 This completion mode is used to complete the preparation when it was interrupted,
84 or when the product list was increased: ::
86 sat prepare <application> --complete
89 Some useful configuration pathes
90 =================================
92 Command *sat prepare* uses the *pyconf file configuration* of each product to know how to get the sources.
94 .. note:: to verify configuration of a product, and get name of this *pyconf files configuration*
98 sat config <application> --info <product>
101 * **get_method**: the method to use to prepare the module, possible values are cvs, git, archive, dir.
102 * **git_info** : (used if get_method = git) information to prepare sources from git.
103 * **svn_info** : (used if get_method = svn) information to prepare sources from cvs.
104 * **cvs_info** : (used if get_method = cvs) information to prepare sources from cvs.
105 * **archive_info** : (used if get_method = archive) the path to the archive.
106 * **dir_info** : (used if get_method = dir) the directory with the sources.