Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to new source format and the mandatory signed-by #239390

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion resources/linux/debian/postinst.template
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ if [ "@@NAME@@" != "code-oss" ]; then
db_get @@NAME@@/add-microsoft-repo
if [ "$RET" = false ]; then
WRITE_SOURCE='no'
else
WRITE_SOURCE='yes'
fi
else
# The terminal is interactive but there is no debconf.
Expand All @@ -90,9 +92,24 @@ if [ "@@NAME@@" != "code-oss" ]; then
fi

if [ "$WRITE_SOURCE" != 'no' ]; then
echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# Check if apt modernize-sources is available.
if apt modernize-sources --help >/dev/null 2>&1; then
# Write repository in deb822 format with Signed-By.
echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost." > "$CODE_SOURCE_PART_DEB822"
cat <<EOF >> "$CODE_SOURCE_PART_DEB822"
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: $CODE_TRUSTED_PART
EOF
else
echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/code stable main" > $CODE_SOURCE_PART
fi

# Sourced from https://packages.microsoft.com/keys/microsoft.asc
if [ ! -f $CODE_TRUSTED_PART ]; then
Expand Down