package-repositories repeatedly adds identical entries to sources.list between runs

Bug #1982953 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lpci
Triaged
Low
Unassigned

Bug Description

The implementation of `package-repositories` in `lpcraft.commands.run._install_apt_packages` appends entries to `/etc/apt/sources.list` without checking whether they're already present. As a result, if you repeatedly run `lpcraft` locally against the same tree without running `lpcraft clean` in between, the container's `/etc/apt/sources.list` keeps growing and you get warnings from apt.

I think it would make sense to write additional apt repositories to a separate `/etc/apt/sources.list.d/lpcraft.list` file. It would then be reasonably straightforward to ensure that that file only contains the additional apt repositories specified in the current run, or to remove that file if the current run doesn't specify any additional apt repositories. (Replacement apt repositories should continue to write to `/etc/apt/sources.list` as before.)

Guruprasad (lgp171188)
Changed in lpcraft:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.