This documentation describes the Prokee module interface.
Functions:
bmsetup_run_script
int bmsetup_run_script(const char *baseman_project_path,const char *package_path,const char *run_token)
bmsetup_run_script2
int bmsetup_run_script2(const char *baseman_project_path,const char *package_path,const char *run_token,const char *username,const char *userpass)
bmsetup_download
int bmsetup_download(const char *baseman_project_path,const char *package_path,bool update)
bmsetup_download2
int bmsetup_download2(const char *baseman_project_path,const char *package_path,bool update,const char *username,const char *userpass)
bmsetup_get_all_paths
char **bmsetup_get_all_paths(const char *baseman_project_path,char **base_path,char **project_path,char **version_path)
bmsetup_install
int bmsetup_install(const char *baseman_project_path,const char *package_path,bool dotar)
bmsetup_publish
int bmsetup_publish(const char *baseman_project_path,const char *publish_path,bool dotar)
Static Methods:
main
int bmsetup::main(int argc,char **argv)
Motivation
The module bmsetup provides extended functionality for baseman to download, install and publish prokee modules.
Functions
bmsetup_run_script
Runs a script.
The function runs the following command:
bmsetup_run_token.sh package_path unique_package_name
(Where
unique_package_name is constructed from the
baseman_project_path.)
Signature:
int bmsetup_run_script(const char *baseman_project_path,const char *package_path,const char *run_token)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| const char * | run_token | [IN] | Specifies the script to be executed. The function executes the file bmsetup_run_token.sh.
The script files should be placed at /usr/local/bin/ or any other directory on the path. Or at the path specified by BMSETUP_INSTALLATION_PATH.
|
Return value:Returns 0.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_run_script2
Runs a script.
The function runs the following command:
bmsetup_run_token.sh package_path unique_package_name b64_username b64_userpass
(Where
unique_package_name is constructed from the
baseman_project_path.)
Signature:
int bmsetup_run_script2(const char *baseman_project_path,const char *package_path,const char *run_token,const char *username,const char *userpass)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| const char * | run_token | [IN] | Specifies the script to be executed. The function executes the file bmsetup_run_token.sh.
The script files should be placed at /usr/local/bin/ or any other directory on the path. Or at the path specified by BMSETUP_INSTALLATION_PATH.
|
| const char * | username | [IN] | Username. |
| const char * | userpass | [IN] | Password. |
Return value:Returns 0.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_download
Downloads a software package.
The function executes the download script
bmsetup_download.sh.
Signature:
int bmsetup_download(const char *baseman_project_path,const char *package_path,bool update)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| bool | update | | Specifies, wheter a already downloaded package should be deleted and re-downloaded. |
Return value:Returns 0 if successful and a value other than 0 if not.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_download2
Downloads a software package.
The function executes the download script
bmsetup_download2.sh.
Signature:
int bmsetup_download2(const char *baseman_project_path,const char *package_path,bool update,const char *username,const char *userpass)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| bool | update | | Specifies, wheter a already downloaded package should be deleted and re-downloaded. |
| const char * | username | [IN] | Username. |
| const char * | userpass | [IN] | Password. |
Return value:Returns 0 if successful and a value other than 0 if not.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_exporter
Runs
cfg-export for the current directory and all subdirectories.
Signature:
int bmsetup_exporter()
Return value:Returns 0.
bmsetup_importer
Runs
cfg-import for the current directory and all subdirectories.
Signature:
int bmsetup_importer()
Return value:Returns 0.
bmsetup_exporter2
Runs
cfg-export for the project given by
baseman_project_path.
Signature:
int bmsetup_exporter2(const char *baseman_project_path)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
Return value:Returns 0.
bmsetup_importer2
Runs
cfg-import for the project given by
baseman_project_path.
Signature:
int bmsetup_importer2(const char *baseman_project_path)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
Return value:Returns 0.
bmsetup_import_info
Reads settings from the file given by
infopath and updates the related
.csv files.
Signature:
int bmsetup_import_info(const char *infopath)
Parameters:
| const char * | infopath | [IN] | The path to the .info file. |
Return value:Returns 0 if successful and a value other than 0 if not.
bmsetup_export_projects
Reads the records from the projects.csv file given by
csvpath and creates the
.info files.
Signature:
int bmsetup_export_projects(const char *csvpath)
Parameters:
| const char * | csvpath | [IN] | The path to a projects.csv file. |
Return value:Returns 0.
bmsetup_export_versions
Reads the records from the versions.csv file given by
csvpath and creates the
.info files.
Signature:
int bmsetup_export_versions(const char *csvpath)
Parameters:
| const char * | csvpath | [IN] | The path to a versions.csv file. |
Return value:Returns 0.
bmsetup_get_all_paths
Determines the file system paths to base, project and version of the baseman project given by
baseman_project_path.
- The function determines the path to the base (base_path). If the base does not exist, than *base_path, *project_path and *version_path are set to
NULL and the function returns.
- To construct the project path (project_path), the function searches for the project and subsequently for all sub-projects within
project.csv files. The construction of the path ends as soon as a name within baseman_project_path does not match with an existing project (at a given location). In this case the name is considered to be the name of a version. If the first project name does not exist, project_path is set to the empty string.
- The path to the version is constructed the same way as the path to the project (by searching versions within
versions.csv files). If any version or sub-version cannot be found within baseman, the function sets *version_path to NULL. If no version is given in baseman_project_path, *version_path is set to the empty string.
Signature:
char **bmsetup_get_all_paths(const char *baseman_project_path,char **base_path,char **project_path,char **version_path)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| char ** | base_path | [OUT] | Receives a pointer to the null-terminated file system path to the baseman base. (If the function fails, *base_path may be set to NULL.) |
| char ** | project_path | [OUT] | Receives a pointer to the null-terminated file system path to the baseman project. (If the function fails, *project_path may be set to NULL.) |
| char ** | version_path | [OUT] | Receives a pointer to the null-terminated file system path to the baseman version. (If the function fails, *version_path may be set to NULL.) |
Return value:Returns the
baseman_project_path exploded by "/".
Remarks:
The application has to free the memory blocks
*base_path,
*project_path and
*version_path.

The application also has to free memory blocks associated to the return value. Use strman::explode_free() to free this memory blocks.
bmsetup_construct_package_path
Constructs the path to the package.
1) Occurrences of "/" within
baseman_project_path are replaced by "--" to construct the
package_filename.
2) The path to the package is constructed as follows:
package_path +
package_filename +
append.
Signature:
char *bmsetup_construct_package_path(const char *baseman_project_path,const char *package_path,const char *append)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| const char * | append | [IN] | A null-terminated string that will be appended to the constructed path. This can be used to append appropriate file extensions. |
Return value:Returns the path to the package.
Remarks:
The application has to free the returned memory block.
bmsetup_install
Installs a software package.
Signature:
int bmsetup_install(const char *baseman_project_path,const char *package_path,bool dotar)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | package_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| bool | dotar | | If dotar is set to true, the function executes the unpack script bmsetup_unpack.sh. |
Return value:Returns 0.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_publish
Creates a shareable software package.
Signature:
int bmsetup_publish(const char *baseman_project_path,const char *publish_path,bool dotar)
Parameters:
| const char * | baseman_project_path | [IN] | A valid path to a module within baseman. This path may differ from the path within the file system. |
| const char * | publish_path | [IN] | The path to the directory, where downloaded software packages are stored. |
| bool | dotar | | If dotar is set to true, the function executes the pack script bmsetup_pack.sh. |
Return value:Returns 0.
Remarks:
Mind that there are no security checks, on the content of the parameters.
A program must not allow any other (potentially malicious) software or user,
to execute this function or alter the strings provided as parameters.
bmsetup_get_base_path
Determines the path to the base
base_name.
Signature:
char *bmsetup_get_base_path(const char *base_name)
Parameters:
| const char * | base_name | [IN] | The null-terminated name of an existing base within baseman. |
Return value:Returns the path to the base or
NULL, if the base does not exist.
Remarks:
The application has to free the returned memory block.
Static Methods
main
Runs
bmsetup as if it would be called from the command-line.
See
Commandline-Interface.
Signature:
int bmsetup::main(int argc,char **argv)
Parameters:
| int | argc | | The number of command-line parameters. |
| char ** | argv | [IN] | The command-line parameters. |
Return value:Exit status.
bmsetup always returns EXIT_SUCCESS(0).