pop-os / default-settings

Distribution Default Settings
Other
44 stars 16 forks source link

fix(proprietary): add the Deb822-format repository on groovy #97

Closed isantop closed 4 years ago

isantop commented 4 years ago

Since the ISO is being built with the DEB822-format sources (including the Apps repo), the postinst script needs to be adapted to add it as well if it isn't found. Otherwise, the ISO ends up getting build with two copies of the repo, causing APT errors in the ISO and installed system.

It attempts to look for matches anywhere in the apt configuration, so it shouldn't add a duplicate repo if it's already configured in either the sources.list file or anywhere in /etc/apt/sources.list.d

Required for pop-os/iso#267

jacobgkau commented 4 years ago

Confirmed this does not affect an existing Focal system with default sources (because it would have http://apt.pop-os.org/proprietary in /etc/apt/sources.list and /etc/apt/sources.list~ from the iso), and does successfully add the deb822-format repository on a Groovy iso that does not have that repo specified in DISTRO_REPOS.

This will affect a Focal system in the event all references to http://apt.pop-os.org/proprietary are removed from /etc/apt and then pop-default-settings is reconfigured. In that case, the deb822-format repository is added to the Focal system. This shouldn't happen, but if it does, the current version of Repoman won't display it, even though it will be present and working in apt.

This behavior seems reasonable because if a user used Repoman to delete http://apt.pop-os.org/proprietary, it would still be present in sources.list~, so if they reach this condition, they already modified their configuration files manually and would know how to remove it again after it was re-added (and it would start showing up in Repoman again once their system's updated to groovy with Repoman supporting deb822.)

Also did an installation from a Focal iso with this branch added just to confirm nothing changed; the proprietary repo is still added in regular format and not deb822 format.

jacobgkau commented 4 years ago

After speaking with @isantop, sources.list~ could get updated to no longer have http://apt.pop-os.org/proprietary if it's removed form sources.list and then further changes are made, and this PR is not supposed to affect Focal systems whatsoever, so holding off until we have a master_focal branch that won't be affected by this PR.

isantop commented 4 years ago

Implemented as discussed, by checking the active config files instead of all files.