Script Index


/var/lib/sorcery/modules/libsorcery

This should really be home to things related to the sorcery script itself, not a repository for other functions. (Andrew 5/29/04)

Synopsis

Set of functions used by the internal sorcery scripts


function update_sorcery_scripts()

Parameters:

Description

Updates the sorcery scripts to their latest version for specified branch.


function set_nice()

Parameters:

Description

Menu query to user asking to set the nice value which sorcery should use to run proccesses at.


function set_umask()

Parameters:

Description

Menu query to user asking to set the umask value which sorcery should use to run proccesses with.


function report()

Parameters:

Description

Displays and/or mails the contents of the file given as the first argument.


function guess_filename()

Parameters:

Description

Given a filename, will return the actual filename if a similar filename with a different extension exists.


function file_exists()

Parameters:

Description

check if the file exists, or one with a similar compression exists


function save_libraries()

Parameters:

Description

Saves the current libraries associated with the spell, from /lib and /usr/lib into $SOURCE_DIRECTORY/old.libraries/ Also runs ldconfig with the saved libraries.


function save_binaries()

Parameters:

Description

Saves the current libraries associated with the spell, from /lib and /usr/lib into $SOURCE_DIRECTORY/old.libraries/ Also runs ldconfig with the saved libraries.


function release_saved_libraries()

Parameters:

Description

Runs default ldconfig to stop using the saved libraries


function spell_recover()

Parameters:

Description

Recovers from a CTRL-C while casting a spell


function find_section()

Parameters:

Stdout

section

Description

Returns the section a spell is in.


function directories()

Parameters:

Stdin

list of files/dirs/..

Stdout

list of dirs

Description

=item directories Reads a list from standard input, and prints out each entry that is a directory (and not a symbolic link to a directory).


function files()

Parameters:

Stdin

list of files/dirs/..

Stdout

list of files

Description

Reads a list from standard input, and prints out each entry that is a file (and not a symbolic link to a file).


Parameters:

Stdin

list of files/dirs/..

Stdout

list of symlinks

Description

Reads a list from standard input, and prints out each entry that is a symbolic linke


function filter()

Parameters:

Stdin

list of files/dirs/..

Stdout

filtered list

Description

First argument is a file that contains (basic) grep regular expressions. They are joined with |'s and given to grep -v. Which will filter standard input to remove entries that match. Used to filter out excluded or protected files from install logs.


function filter_in()

Parameters:

Stdin

list of files/dirs/..

Stdout

filtered list

Description

First argument is a file that contains (basic) grep regular expressions. They are joined with |'s and given to grep Which will filter standard input and remove entries that do not match. Used to filter in config files from install logs.


function dirnames()

Parameters:

Stdin

list of files

Stdout

list of directories

Description

THIS FUNCTION IS DEPRECIATED, use get_dirnames instead! (remove in 1.16) Given a list of files from standard input, returns the directory of each file.


function optimize()

Parameters:

Description

Sets some environment variables (such as C) based on the option passed. Options may be on or more of: i386, i486, i586, pentium, pentium-mmx, i686, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp, athlon-mp, powerpc, speedy, tiny, risky, strip


function grimoire_history()

Parameters:

Stdout

history

Description

Display the history of the grimoire given for review


function sorcery_history()

Parameters:

Stdout

history

Description

Display the history of sorcery for review


function get_new_changes()

Parameters:

Description

Get the new changes from passed changelog argument


function timeout_pager()

Parameters:

Description

Pager with timeouts, cannot be used from a pipe. Invokes a subshell in case there are other background jobs running


function fix_installed_spells()

Parameters:

Description

Attempt to fix any spells that may be broken.


function log_list()

Parameters:

Stdout

log files list

Description

Returns a list of the log files for each spell.


function clean_logs()

Parameters:

Description

Removes stale logs.


function activity_log()

Parameters:

Description

Updates the activity log.


function run_details()

Parameters:

Description

Executes the spell's DETAILS file.


function unset_details()

Parameters:

Description

unsets variables set by DETAILS.
vars: SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT SOURCE* Needs to be merged with the libcodex function since they are both needed to fully unset a DETAILS (afk 4/21/04)


function boost()

Parameters:

Description

Runs C and C on the current spell. THIS FUNCTION IS DEPRECIATED AND SHOULD NOT BE CALLED FOR ANY REASON


function verify_source()

Parameters:

Description

Given a list of source files, returns true if each file exists.


function sources()

Parameters:

Stdout

filelist

Description

Returns a list of each source file used by a spell. Most have only one, but xfree86 for example splits the sources into three separate source files.


function source_urls()

Parameters:

Stdout

filelist

Description

Returns a list of each source file used by a spell. Most have only one, but xfree86 for example splits the sources into three separate source files.


function generate_keep_list()

Parameters:

Stdout

filelist

Description

Returns a list of files that should not be pruned.


function prune()

Parameters:

Description

Removes unnecessary files from the source cache and install cache.


function invoke_build_dir()

Parameters:

Description

Sets DISTCC=[on|off] depending on the value of DISTCC_HOSTS. Adds /var/lib/sorcery/build to the C if necessary.


function verify_sources()

Parameters:

Stdout

filelist

Description

Returns false if one or more source files for the current spell are missing.


function set_compression_type()

Parameters:

Description

Will set the prefered compression type based on user filled option in dialog menu (either gzip/bzip).


function filename_indicates_compression()

Parameters:

Returns:

Description

Returns true if the name of the file indicates that it should be a compressed file. In other words, this function returns true if the extension is .gz, .tgz, .bz2, .zip, .rpm, .Z, .xz, .7z or .lzma.


function override_grimoires()

Parameters:

Description

Check that we have all the passed grimoires and use them to override the default selection (all)


function set_pager()

Parameters:

Globals

PAGER

Description

Sets the most appropriate params for PAGER