Import* Scripts

From ISP_RAS

Jump to: navigation, search

Contents

Description

Scripts for adding different entities and mappings in the LSB database.

Note: These scripts are not supported any more and they won't work with new versions of specdb schema. The new way of adding a large ammount of information to database is LibToDB tool.

Script Description
importcmd creates new record in Command table and new mappings in CmdInt and CmdLib tables. Command's name and path are taken from command line, other information (about interface and library) is taken from file. Such file should contain the following values (all values should be written in one line, colon-separated):
<path>:<cmd_crc>:<cmd_name>:<cmd_rpm>:<cmd_ver>:<cmd_release>:<int_name>:<int_ver>:<lib_name>:<lib_crc>:<lib_rpm>:<lib_ver>

In fact, only <interface_name>, <interface_name> and <library_name> are used. If there are no entries with such values in the appropriate tables (Interface, Version and Library correspondingly), script will stop working. Other values are not used at all. Note: The runtime library name should be provided as <library_name>.

importconstants adds new constants. Takes all constants from header files with 'Included' status (assumes that all header files are situated in /usr/include/). For each constant checks, if it is already defined in Constant table. If a record for this constant is found but values there differ from that found in header file, warning message will be displayed, but the record will not be updated. If there is no such record yet, the new constant will be inserted in Constant table. Cheadgroup will be set to id of header group with HGorder='0'. Note: ArchConst table is not updated by this script; arhcitecture name, that is passed to script as argument, has no usage.
importheader adds new headers. Creates new entry in Header table (with 'Excluded' status) and new entry in HeaderGroup (if no header groups exist for this header). Deletes all parameters from Interfaces in this header, deletes all Parameters of types from this header, deletes all TypeMembers for types in this header and deletes all Types defined in this header. Then all information from header is placed to appropriate tables (imports enums, typedefs, unions and structs to Type table and interfaces to Interface table). This script should be provided not with a header itself, but with a 'lsbdecled' version of a header.
importintlibgrpmap places new mapping information to LGInt table. Mappings are taken from file, where they should be hold like
<InterfaceName> <LibGroupName>

(tab-separated), one mapping per line. The file should be ended by 'end-of-line' symbol. If there is no record in Interface table with Iname=<InterfaceName>, then such record will be created. If there is no record in LibGroup table with LGname=<LibGroupName>, then script will sotp working with error message. If all ok for a given mapping, a new record in LGInt table will be created.

importintspecmap creates new mappings between Interface and Standard tables. Mappings are taken from file, where they should be hold like
<interfaceName> <standardName>

(tab-separated), one mapping per line. The file should be ended by 'end-of-line' symbol. For interfaces from mappings Istandard field is set to appropriate id from Standard table. If Istandard already contains non-zero value or there is no record in Interface table with Iname=<InterfaceName>, nothing will be updated and no warning/error messages will be displayed. If there is no record in Standard table with Sname=<StandardName>, nothing is updated and warning message will be displayed. In all cases script will not stop.

importlibgroupmap places new information to LibGroup table. Information is taken from file, one line in file per one record in table. Each line should look like
<LibName> <LibGroupName> <LGorder> <LGdescription>

(tab-separated), <LibName> is for LGlib field. All information from file will be inserted into database, no correctness checks are performed, except the existense of library <LibName>.

importlib add new library to specification database. Name, runname and arcitecture are taken as arguments from command line. For new libraries new record in LibGroup table is created (default libgroup for the whole library) and the new mapping in ArchLib table. This script should be provided with symbol file for library, that can be obtained using 'nm'. According to records in symbol file, creates new records in Interface table (if they don't exist yet) and new mappings in LGInt and VerInt tables. The status of new library is set to 'Excluded'.

Import* scripts are stored in LSB CVS, in /tools/scripts. In the Bazaar, they are located in 'scripts' directory.

Usage

importcmd -c <command> -r <fullpath> -f <file>
    <command>     Command name
    <fullpath>    Command full path
    <file>        Name of the file with information about the command

importconstants -a <arch>
    <arch>        Name of the architecture. Seems to have no usage, but required.

importheader -h <headername> -a <archname>
    <arch>        Name of the architecture
    <headername>  Name of the lsbdecled header, with 'lsb' extension (like 'header.h.lsb')

importlib -l <libname> -r <runname> -a <arch> [-s <symfile>]
    <libname>     Library name, will be inserted in Lname field
    <runname>     Library runname, will be inserted in Lrunname field
    <arch>        Name of the architecture
    <symfile>     Name of the symbol file for this library

importintlibgrpmap -f <filename>
    <filename>    File with mappings

importintspecmap -f <filename>
    <filename>    File with mappings

importlibgroupmap -f <filename>
    <filename>    File with records to be inserted in LibGroup table


Dependencies on DB

importcmd

Table Insert Select
CmdInt + -
CmdLib + -
Command + +
Interface - +
Library - +
Version - +

Note: CmdInt and CmdLib tables required by this script have been dropped.

importconstants

Table Insert Select
ArchConst - +
Architecture - +
Constant + +
Header - +
HeaderGroup - +


importheader

Table Insert Select
Header + +
HeaderGroup + +
Interface + +
Parameter + +
Type + +
TypeMember + -


importintlibgrpmap

Table Insert Select
Interface + +
LGInt + -
LibGroup - +
Library - +


importintspecmap

Table Insert Select
Interface + -
Standard - +


importlib

Table Insert Select
ArchInt + +
Architecture - +
Interface + +
LGInt + +
LibGroup + +
Library + +
VerInt + +
Version - +

Note: VerInt table required by this script has been dropped.

importlibgroupmap

Table Insert Select
LibGroup + -
Library - +
Personal tools