Script Index
Handles storage of state information, incluing depends and package
files. Also handles looking information up about what is installed
and what depends on what.
Copyright
Copyright (C) 2002 The Source Mage Team
Parameters:
- $1: Depends status file
- $2: Name of the "parent" spell
- $3: Name of the spell the parent spell depends on
- $4: "on" or "off" depending on whether the user installed the dependency
- $5: Type of dependency (required or optional)
- $6: option to pass to C<configure> if the dependency is installed
- $7: option to pass to C<configure> if the dependency is not installed
Example
add_depends kdelibs alsa-driver on optional --with-alsa --without-alsa
Description
Adds a dependency to the a depends database file. Returns 1 if the
3rd or 4th fields are not valid.
Parameters:
- $1: depends file
- $2: spell
- $3: depends
- $4: on/off
- $5: optional/required
- $6: on arg
- $7: off arg
Returns:
- 0 if entry was found
- 1 if entry was not found
- 2 on error
Stdout
the matching line(s)
Description
In case you want to search in all the fields of the $1
Arguments can be regexp
Prints out the matching line(s)
Parameters:
- $1: depends file
- $2: spell
- $3: depends
- $4: on/off (optional)
- $5: optional/required (optional)
- $6: on arg (optional)
- $7: off arg (optional)
Stdout
the matching line(s)
Description
Search depends status, dont do anything escaping.
Arguments can be regexp
Prints out the matching line(s)
Parameters:
- $1: depends file
- $2: spell
- $3: depends (optional)
Stdout
matching lines
Description
In case you want to search by spell or dependency in $1
Arguments can be regexp
Prints out the matching line(s)
Parameters:
- $1: depends file
- $2: spell
- $3: dependency spell
Stdout
list of options
Description
Returns a list of options for ./configure from $1
Primarily aimed at generating $OPTS contents
Prints out one line of output
Parameters:
- $1: depends file
- $2: spell
- $3: depends
- $4: on/off
- $5: optional/required
- $6: on arg
- $7: off arg
Description
Arguments can be regexp, and all but the spell are optional
Parameters:
- $1: depends file
- $2: spell
- $3: dependency
Description
Toggle optional and suggested dependencies on/off
Parameters:
- $1: depends file
- $2: spell
- $3: new provider
- $4: feature
- $5: on/off
Description
Changes the $spell's provider of $feature to a $new one. Can also
toggle it to be enabled or disabled.
Parameters:
- $1: spell
- $2: variable name to put the filename name in (pass by reference)
Description
Sets up the uncommitted depends file. If the name isn't
found in the hash table create it. If the file already exists
move it to the abandoned depends directory and start with a new one.
The uncommitted_hash hash table should be hash_export'ed to
make it through the call to make.
Parameters:
- $1: spell
- $2: variable name to put the filename in
Description
Get the uncommitted sub-depends file. Uses get_uncommitted_depends_file.
This file is intended for use by the sub-dependee.
Parameters:
- $1: spell
- $2: variable name to put the filename in
Description
Get the uncommitted sub-depends file. Uses get_uncommitted_depends_file
This file is intended for use by the requester.
Parameters:
- $1: sub-depends file
- $2: requester file
- $3: sub-dependee
- $4: sub-depends
Description
Add a sub-dependency.
Parameters:
- $1: sub-depends file
- $2: requester file (optional)
- $3: sub-dependee (optional)
- $4: sub-depends (optional)
Description
Search in sub-depends file.
Parameters:
- $1: sub-depends file
- $2: requester
- $3: sub-dependee
- $4: sub-depends
Description
Remove a sub-depends.
Parameters:
- $1: depends file
- $2: spell
- $3: depends/PROVIDER
- $4: on/off
Description
add default depends entry, if $3 is a spell $4 must be on/off
if $3 is a PROVIDER $4 must be a spell
Parameters:
- $1: depends file
- $2: spell
- $3: depends/PROVIDER
- $4: on/off/spell
Description
Arguments can be regexp, $2, $3 and $4 are optional
Caller must lock the file
Parameters:
- $1: depends file
- $2: spell
- $3: depends/PROVIDER
- $4: on/off/spell
Description
Arguments can be regexp, $2 $3 and $4 are optional
Parameters:
- $1: depends file
- $2: spell
- $3: PROVIDER
- $4: on/off
Description
Arguments can be regexp, $3 and $4 are optional
Parameters:
- $1: cache file
- $2: spell name
Description
Removes the spell info from the passed file ($VERSION_STATUS)
Parameters:
- $1: cache file
- $2: spell name
- $3: version
- $4: patchlevel
- $5: security patch
- $6: updated
Description
Given a spell and the factors that affect queuing, this function
adds the info to the passed file (usually $VERSION_STATUS)
Parameters:
- $1: spell OR action
- $2: (if spell) action
- $3: (if spell) version
Description
Adds an entry to the SPELL_STATUS file
Arguments may either be SPELL, ACTION, VERSIONS, or just
ACTION if there exists SPELL and VERSIONS variables already
set.
Parameters:
Description
Given a spell, status (installed, held, etc), and version, add_spell
adds the spell to the /var/state/sorcery/packages file
Parameters:
- $1: spell status file
- $2: spell
- $3: version (optional)
Stdout
matching lines
Description
Arguments can be regexp
Prints out the matching line(s)
Parameters:
- $1: spell ( [A-Za-z0-9_-] )
- $2: version (optional and may not contain spaces or colons; '.' and '*' have special meaning)
- $3: variable to set
Returns:
- 1 only for critical problems ( missing SPELL_STATUS file )
- 0 for all other cases ( even when spell is not found )
Stdout
last matching line ( only one even if there are more )
Description
Searches the SPELL_STATUS file for a spell and optionally
a version.
Prints out the matching spell's status
Parameters:
Returns:
- 0 if the given spell's status is "installed"
Type
API
Parameters:
Returns:
- 0 if the given spell's status is "held"
Parameters:
Returns:
- 0 if the given spell's status is "installed" or "held"
Type
API
Parameters:
Returns:
- 0 if any provider of $1 is installed
Type
API
Parameters:
- $1: Spell name
- $2: Provider name
- $3: If empty get the uncommited spell info, if anything else get info from the committed ($DEPENDS_STATUS) database. If the uncommited db doesnt exist (maybe we're not casting) use DEPENDS_STATUS
Returns:
- 0 if a provider could be found 1 if not
- 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
Type
API
stdout
the provider name(s)
Parameters:
- $1: Spell name
- $2: Target spell name
- $3: If empty get the uncommited spell info, if anything else get info from the committed ($DEPENDS_STATUS) database. If the uncommited db doesnt exist (maybe we're not casting) use DEPENDS_STATUS
Returns:
- 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
Type
API
stdout
the provider name(s)
Parameters:
Returns:
- 0 if the given spell's status is "exiled"
Parameters:
- $1: spell to remove status of
Description
Removes all specified offending entries in SPELL_STATUS
Parameters:
Description
Removes the given spell from the /var/state/sorcery/packages file.
if C is set, the spell is changed to "exiled" in the file.
Parameters:
Stdout
All spell stati
Description
Just here to round out the SPELL_STATUS functions so that
SPELL_STATUS doesn't have to mentioned in libsorcery
Parameters:
Description
sets <spells>'s status to held
Parameters:
Description
sets <spells>'s status to exiled
Parameters:
Description
resets 's 'exiled' status
Parameters:
Description
sets 's status to installed
Parameters:
- $1: status (installed, held, exiled or ok[for the first two])
Stdout
spells
Description
returns all spells that are in that status
Parameters:
- $1: variable
- $2: value
- $3: command (optional)
Description
Modifies (or adds) an entry in the local/config.
If "command" is the third argument, a space will separate the
variable and value rather than the equals sign.
Parameters:
- $1: Filename
- $2: variable
- $3: value
- $4: command (optional)
Description
Modifies (or adds) an entry in the local/config.
If "command" is the third argument, a space will separate the
variable and value rather than the equals sign.
Parameters:
- $1: Filename
- $2: variable
- $3: command (optional)
Description
Removes an entry in the local/config.
If "command" is the third argument, a space will separate the
variable and value rather than the equals sign.