Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: only add apt sources for users that want it (microsoft#22145)
Currently, vscode.list is added to /etc/apt/sources.d/ whenever it doesn't exist. With this patch, the new behaviour is as follows: 1. If the user already has the Microsoft source file installed for apt, sources won't be added 2. If the user sets debconf-set-selections to set code/add-microsoft-repo to false, the sources won't be added 3. If sources might be added, the script checks whether it makes sense to (over)write them (i.e. the file doesn't exist, is old or has been disabled during some OS upgrade) 4. If is makes sense and the code/add-microsoft-repo is not set, the user is asked to cofirm, whether they actually want Microsoft sources to be installed (setting code/add-microsoft-repo to the selected value) 5. Only if it makes sense and the user agrees, the sources are installed This change will mostly affect new users or those reinstalling vscode. Personally, I feel like the whole approach of automatically adding the repo is very invasive, and would prefer that it not be done at all. However, with this change, it is up to the user whether they want it to be installed or not. Since the default is set to true, users that install vscode in noninteractive environments get the current behavior. Existing users will either be asked once or never (depending on whther step 4 above gets triggered). New users will be asked unless they make a decision ahead of time using debconf-set-selections. With this, microsoft#22145 and duplicates should be sufficiently addressed. Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
- Loading branch information