craft_archives.defaults

This module allows modification of the default sources in a given root.

craft_archives.defaults.use_old_releases(root: Path = PosixPath('/'), *, deb822_name: str = 'ubuntu.sources', old_releases_url: str = 'http://old-releases.ubuntu.com/ubuntu', change_domain: str = 'ubuntu.com') bool[source]

Migrate the given root to use an old-releases archive if relevant.

This changes the given root to use an archive on an old-releases site if the release exists on that site. If not, it’s a no-op.

Parameters:
  • root – The root of the filesystem to examine.

  • deb822_name – The name of the deb822 file to search for default sources. (Default: ubuntu.sources)

  • old_releases_url – The URL of the old-releases site. (Default: http://old-releases.ubuntu.com/ubuntu)

  • change_domain – Only change sources on this domain. (Default: ubuntu.com)

Returns:

True if any default releases were changed, False otherwise.