-
Notifications
You must be signed in to change notification settings - Fork 0
Orbos API
This wiki article will be split into multiple sections for different files used in orbos and how they relate to the overall API.
This article needs to be updated and does not encompass the entire API at this time.
Default settings are stored in orbos.conf.
orbos.conf loads lib-build.conf which stores all lib-build related settings. orbos.conf loads lib-text.conf which stores shortcut functions for lib-text.
This greatly lowers the clutter within orbos.conf to basic settings. Settings for lib-build and lib-text should be within thier own conf files.
Cleans up all functions and variables loaded when orbos.conf is used.
The lib-text api is never directly accessed. Instead it has functions that make use of it in lib-text.conf to configure how it is used.
The functions provided in lib-text.conf are msg and qmsg. These functions allow configuring the speed of the text output.
msg may produce new lines at the end of each word in certain circumstances. If this is the case use qmsg and msg in conjunction with each other.
qmsg was originally created for questions but has many other usages were you need finer grained control of return characters.
Both msg and qmsg can be passed strings, arrays and variables. More complex data strings you may need to put your data into an array before it will output correctly. This is likely to be the case if you are passing data with a combination of variables, Associative Array information, Array information and plain text.
I've added 6 shortcut functions within lib-text.conf for accessing lib-text depending on the output you need. These shortcuts are rmsg, msgr, rmsgr, qmsgr, rqmsg, rqmsgr and these just add options for return characters. The placement of the r is where the return will happen. I thought this would be a nice touch for being able to manipulate the output easily on one line and have it displayed how you want it.
Takes no arguments.
Unsets all the functions and variables used in lib-text.
Takes one argument. This argument must be the name of the package and/or sources.
Removes the source directory. This is usually run before extract so we have a clean version of the sources to build from.
Takes no arguments. Removes all directories within the sources location.
This function is probably going to be replaced with one that can check all packages in a source download location.
More accurate information will be written here when it is updated.
Takes no arguments.
This function expands a download URL for a source into its filename, package name, version number, extension and base URL for the sources.
The download URL is left untouched in this process.
Takes no arguments.
This function combines the name, version and extension into a new filename and combines that with the base URL for a new download URL. This is going to be useful for changing the version number and downloading a newer version of the sources.
Takes no arguments.
This will create a build directory. This is used when the program is built in a directory other than the sources.
The build directory will be -build. So if we are building binutils it would be binutils-build.
Takes no arguments.
Extracts the sources to the source directory and enters the source directory.
Takes one argument of a program name.
Extracts the source of the name given to it from the sources directory.
Takes multiple arguments. Each should be the name of a source to extract.
This is the replacement for extract_gcc_extras. It will extract any package of the name that you send to it and move the directory to a non-versioned directory.
Takes no arguments.
Strips the binary files of debugging and unneeded symbols.
Takes no arguments.
Strips the documentation files from the binary.
Takes no arguments.
Sets the pkg associative array information to be used within the rest of the system.
Takes multiple arguments. Arguments should be a valid orb or orb.spec file.
The function does incremental backups whatever file is passed to it. Meaning if there is already a backup file it will create a backup# file where backup# does not already exist.
eg. orb.backup orb.backup1 orb.backup2
The latest backup will always have the highest number unless the user deletes ones in the middle of the increment.
The limit to the number of backups would be the limitations of an integer in bash.
Takes no arguments.
Prints the package information for the currently loaded pkg array.
Takes one argument of a package name.
Loads the pkg information.
Takes no arguments.
Asks questions about global pkg info. The information gained is written to the orb.spec file.
This function also creates the location for the orb.spec and orb file. I would also like to have it incrementally backup the orb.spec and orb files if they already exist.
Takes no arguments.
This function works along the same lines as ask_pkginfo. It asks questions in regards to the build itself and writes the raw input of those questions to the orb.spec file.
Accepts one argument. This argument must be a valid orb.spec file.
It reads the orb.spec file into an orbspec array. The orbspec array is used by orbspecpkginfo and orbspecbuild to set everything within the orb.spec file as would be set by taking the input by both ask_pkginfo and ask_build.
This is meant to be a replacement for repeatedly inputting the same data. The existence of the orb.spec also allows us to fix typo's and such that we may have made when we initially created the package without going through the entire process again.
Takes no arguments.
Sets the same information as ask_pkginfo except it does it from the array created by readorbspec.
Takes no arguments.
Sets the same information as ask_build except it does it from the array created by readorbspec.
Takes no arguments.
Writes the header and global information to the orb file.
Takes no arguments.
Writes the build section of the orb file.
Takes an optional argument. This argument should be passed by the neworb function.
If an argument has been passed the function will assume neworb has read the orb spec file and will run orbspecpkginfo otherwise it will run ask_pkginfo.
Finally it writes the top section of the orb file.
Takes an optional argument. This argument should be passed by the neworb function.
If an argument has been passed the function will assume neworb has read the orb spec file and will run orbspecbuild otherwise it will run ask_build.
Finally it writes the build section of the orb file.
Takes an optional argument. This argument is the name of a program that already has an 'existing' orb.spec file. If this file does not exist it will ask the needed questions instead.
neworb is the function that does the logic to have all the functions needed to do the build work with synergy.
Pretty much you type neworb and if the library is loaded then the system knows how to create a build.
This will probably be extended out to another file that automatically loads the needed libraries and runs the function and then unloads the information at the end.
Takes one argument. This argument must be the name of the source/package. The file must exist for the function to work correctly.
This loads the orb file so we can gather information or perform a build.
Takes no arguments.
Stands for All Orb Information. It will print the pkg associative array of every loaded orb file.
Takes one argument.
Output the global pkg information available for a single orb file.
Takes no arguments.
Cleans up functions and variables so they are no longer loaded in bash.
Takes no arguments.
Cleans up functions and variables so they are no longer loaded in bash.