@@ -31,6 +31,7 @@ if [ "@@NAME@@" != "code-oss" ]; then
31
31
# Register apt repository
32
32
eval $( apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d)
33
33
CODE_SOURCE_PART=${APT_SOURCE_PARTS} vscode.list
34
+ CODE_SOURCE_PART_DEB822=${APT_SOURCE_PARTS} vscode.sources
34
35
35
36
eval $( apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d)
36
37
CODE_TRUSTED_PART=${APT_TRUSTED_PARTS} microsoft.gpg
@@ -41,19 +42,22 @@ if [ "@@NAME@@" != "code-oss" ]; then
41
42
db_get @@NAME@@/add-microsoft-repo || true
42
43
fi
43
44
44
- # Install repository source list
45
+ # Determine whether to install the repository source list
45
46
WRITE_SOURCE=0
46
47
if [ " $RET " = false ]; then
47
- # The user does not want to add the microsoft repository
48
+ # The user does not want to add the Microsoft repository
48
49
WRITE_SOURCE=0
49
- elif grep -q " http://packages.microsoft.com/repos/vscode" $CODE_SOURCE_PART ; then
50
+ elif [ -f " $CODE_SOURCE_PART_DEB822 " ]; then
51
+ # The user has migrated themselves to the DEB822 format
52
+ WRITE_SOURCE=0
53
+ elif [ -f " $CODE_SOURCE_PART " ] && (grep -q " http://packages.microsoft.com/repos/vscode" $CODE_SOURCE_PART ); then
50
54
# Migrate from old repository
51
55
WRITE_SOURCE=2
52
- elif grep -q " http://packages.microsoft.com/repos/code" $CODE_SOURCE_PART ; then
56
+ elif [ -f " $CODE_SOURCE_PART " ] && ( grep -q " http://packages.microsoft.com/repos/code" $CODE_SOURCE_PART ) ; then
53
57
# Migrate from old repository
54
58
WRITE_SOURCE=2
55
59
elif apt-cache policy | grep -q " https://packages.microsoft.com/repos/code" ; then
56
- # Skip following checks if the repo is already known to apt
60
+ # The user is already on the new repository
57
61
WRITE_SOURCE=0
58
62
elif [ ! -f $CODE_SOURCE_PART ] && [ ! -f /etc/rpi-issue ]; then
59
63
# Write source list if it does not exist and we're not running on Raspberry Pi OS
0 commit comments