Fix: only add apt sources for users that want them (#22145) (#221285)

Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
This commit is contained in:
Matthias B.
2024-08-06 23:54:05 +02:00
committed by GitHub
parent ab962cd422
commit cd340e6aa4
4 changed files with 61 additions and 6 deletions

View File

@@ -14,3 +14,22 @@ fi
if hash update-mime-database 2>/dev/null; then
update-mime-database /usr/share/mime
fi
RET=true
if [ -e '/usr/share/debconf/confmodule' ]; then
. /usr/share/debconf/confmodule
db_get @@NAME@@/add-microsoft-repo || true
fi
if [ "$RET" = "true" ]; then
eval $(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d)
CODE_SOURCE_PART=${APT_SOURCE_PARTS}vscode.list
rm -f $CODE_SOURCE_PART
eval $(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d)
CODE_TRUSTED_PART=${APT_TRUSTED_PARTS}microsoft.gpg
rm -f $CODE_TRUSTED_PART
fi
if [ "$1" = "purge" ] && [ -e '/usr/share/debconf/confmodule' ]; then
db_purge
fi