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 * Prepare only some modules with a given property: ::
74 # prepare only SALOME modules, not prerequisites
75 ./sat prepare <application> --properties is_SALOME_module:yes
77 * Use --force to force to prepare the products in development mode
78 (this will remove the sources and do a new clone/checkout): ::
80 sat prepare <application> --force
82 * Use --force_patch to force to apply patch to the products
83 in development mode (otherwise they are not applied): ::
85 sat prepare <application> --force_patch
87 * Prepare only products that are not present in SOURCES.
88 This completion mode is used to complete the preparation when it was interrupted,
89 or when the product list was increased: ::
91 sat prepare <application> --complete
93 * Use GitHub repositories.
94 To prepare SALOME sources which are available on GitHub, run::
96 sat -o 'APPLICATION.properties.git_server="github"' prepare <application>
99 Some useful configuration paths
100 =================================
102 Command *sat prepare* uses the *pyconf file configuration* of each product to know how to get the sources.
104 .. note:: to verify configuration of a product, and get name of this *pyconf files configuration*
106 .. code-block :: bash
108 sat config <application> --info <product>
111 * **get_method**: the method to use to prepare the module, possible values are cvs, git, archive, dir.
112 * **git_info** : (used if get_method = git) information to prepare sources from git.
113 * **svn_info** : (used if get_method = svn) information to prepare sources from svn.
114 * **cvs_info** : (used if get_method = cvs) information to prepare sources from cvs.
115 * **archive_info** : (used if get_method = archive) the path to the archive.
116 * **dir_info** : (used if get_method = dir) the directory with the sources.