craft_archives.defaults

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

craft_archives.defaults.use_old_releases(root=PosixPath('/'), *, deb822_name='ubuntu.sources', old_releases_url='http://old-releases.ubuntu.com/ubuntu', change_domain='ubuntu.com')[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 (Path) – The root of the filesystem to examine.

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

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

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

Return type:

bool

Returns:

True if any default releases were changed, False otherwise.