pkgsetcomp package

Submodules

pkgsetcomp.pkgsetcomp module

class pkgsetcomp.pkgsetcomp.PkgComparison[source]

Bases: pkgsetcomp.pkgsetcomp.PkgComparison

A package set comparison namedtuple with serializers

print_string()[source]

Print the minimal, also_installed, and uninstalled lists

write_package_scripts(output_dir)[source]

Generate boilerplate apt-get command scripts for minimal, also_installed, and uninstalled

Parameters:output_dir (str) – directory in which to write scripts
pkgsetcomp.pkgsetcomp.compare_package_lists(manifest, installed)[source]

Compare two sets (manifest, installed) of package names.

Parameters:
  • default (iterable) – names of packages listed in a given MANIFEST
  • installed (iterable) – names of packages installed locally
Returns:

set comparison outputs

Return type:

PkgComparison

pkgsetcomp.pkgsetcomp.ensure_file(command, filename, overwrite=False, shell=False)[source]

Run a command if a file doesn’t exist

Parameters:
  • command (str) – shell command to subprocess.call
  • filename (str) – path to os.path.exists
  • overwrite (bool) – if true, overwrite existing file
  • shell (bool) – subprocess command parsing
Returns:

None

pkgsetcomp.pkgsetcomp.get_installed_packages(cache=False, output_dir='.', output_filename='installed.pkgs.txt')[source]

Get a list of the packages in a manifest

Parameters:manifest_url (str) – path or URL of a debian/ubuntu .manifest file

Returns:

pkgsetcomp.pkgsetcomp.get_manifest_packages(cache=False, manifest_url=None, output_dir='.', output_filename='manifest.pkgs.txt')[source]

Get a list of the packages in a manifest

Parameters:manifest_url (str) – path or URL of a debian/ubuntu .manifest file

Returns:

pkgsetcomp.pkgsetcomp.get_package_lists(manifest_url='/var/build/user_builds/pkgsetcomp/checkouts/latest/pkgsetcomp/../tests/testdata/ubuntu-12.04.4-desktop-i386.manifest', cache=False, output_dir=None)[source]

Get list of installed packages and manifest packages

Generate:
installed.pkgs.txt manifest.pkgs.txt
Parameters:cache (bool) – whether to cache
Returns:tuple of lists: (installed, manifest)
pkgsetcomp.pkgsetcomp.import_apt()[source]

import apt

Returns:apt module
Return type:module
pkgsetcomp.pkgsetcomp.main()[source]

pksetcomp main method (CLI)

pkgsetcomp.pkgsetcomp.pkgsetcomp_packages_with_manifest(manifest_url, output_dir)[source]

Compare installed packages with manifest packages

Parameters:
  • manifest_url (str) – URL (or local path) to a debian/ubuntu .manifest
  • output_dir (str) – directory in which to write .pkg.sh and pkg.txt files
Returns:

output of compare_package_lists

Return type:

PkgComparison

pkgsetcomp.pkgsetcomp.read_lines(filename)[source]

Read and format lines of a file

Parameters:filename (str) – path to file to open as read-only
Returns:generator of lines

Note

this method is not unicode compatible

pkgsetcomp.pyrpo module

Module contents

pkgsetcomp module