~rcj/charms/trusty/ubuntu-repository-cache/personal

Viewing all changes in revision 193.

  • Committer: Robert Jennings
  • Date: 2015-05-06 19:01:04 UTC
  • Revision ID: robert.jennings@canonical.com-20150506190104-cj8vplrgggjpkfyh
Fix apt warning when pre-install payloads add apt sources

When a pre-install script is added (via exec.d/*/charm-pre-install)
that creates apt source list files under /etc/apt/sources.list.d/ 
those files will be backed up during charm setup.  The backup is made
prior to changing the apt sources url to the archive url the
charm will be pulling metadata from (to avoid a chicken or egg
issue during charm deployment where the VM would try to point to the
archive mirror to be served by the charm).

Prior to this patch, the backup file ended in the name of the service
and 'apt-get update' would throw a warning like:
N: Ignoring file 'foo.listubuntu-repository-cache' in directory
 '/etc/apt/sources.list.d/' as it has an invalid filename extension

By adding '.save' to the end of the backup file the warning is eliminated.
Additionally, the comment in change_aptsources_url() was corrected.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: