Package handling

Package list

class bootstrapvz.base.pkg.packagelist.PackageList(manifest_vars, source_lists)[source]

Represents a list of packages

class Local(path)[source]

A local package

class Remote(name, target)[source]

A remote package with an optional target

add(name, target=None)[source]

Adds a package to the install list

Parameters:
  • name (str) – The name of the package to install, may contain manifest vars references
  • target (str) – The name of the target release for the package, may contain manifest vars references
Raises:
  • PackageError – When a package of the same name but with a different target has already been added.
  • PackageError – When the specified target release could not be found.
add_local(package_path)[source]

Adds a local package to the installation list

Parameters:package_path (str) – Path to the local package, may contain manifest vars references

Sources list

class bootstrapvz.base.pkg.sourceslist.Source(line)[source]

Represents a single source line

class bootstrapvz.base.pkg.sourceslist.SourceLists(manifest_vars)[source]

Represents a list of sources lists for apt

add(name, line)[source]

Adds a source to the apt sources list

Parameters:
  • name (str) – Name of the file in sources.list.d, may contain manifest vars references
  • line (str) – The line for the source file, may contain manifest vars references
target_exists(target)[source]

Checks whether the target exists in the sources list

Parameters:target (str) – Name of the target to check for, may contain manifest vars references
Returns:Whether the target exists
Return type:bool

Preferences list

class bootstrapvz.base.pkg.preferenceslist.Preference(preference)[source]

Represents a single preference

class bootstrapvz.base.pkg.preferenceslist.PreferenceLists(manifest_vars)[source]

Represents a list of preferences lists for apt

add(name, preferences)[source]

Adds a preference to the apt preferences list

Parameters:
  • name (str) – Name of the file in preferences.list.d, may contain manifest vars references
  • preferences (object) – The preferences

Exceptions

exception bootstrapvz.base.pkg.exceptions.PackageError[source]

Raised when an error occurrs while handling the packageslist

exception bootstrapvz.base.pkg.exceptions.SourceError[source]

Raised when an error occurs while handling the sourceslist