Skip to content

Commit

Permalink
migrate_to_bullseye: /etc/apt/sources.list may not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Apr 27, 2022
1 parent 1e1b0dd commit b928dd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/yunohost/data_migrations/0021_migrate_to_bullseye.py
Expand Up @@ -299,7 +299,7 @@ def check_assertions(self):
# Check system is up to date
# (but we don't if 'bullseye' is already in the sources.list ...
# which means maybe a previous upgrade crashed and we're re-running it)
if " bullseye " not in read_file("/etc/apt/sources.list"):
if os.path.exists("/etc/apt/sources.list") and " bullseye " not in read_file("/etc/apt/sources.list"):
tools_update(target="system")
upgradable_system_packages = list(_list_upgradable_apt_packages())
if upgradable_system_packages:
Expand Down Expand Up @@ -355,7 +355,8 @@ def disclaimer(self):
def patch_apt_sources_list(self):

sources_list = glob.glob("/etc/apt/sources.list.d/*.list")
sources_list.append("/etc/apt/sources.list")
if os.path.exists("/etc/apt/sources.list"):
sources_list.append("/etc/apt/sources.list")

# This :
# - replace single 'buster' occurence by 'bulleye'
Expand Down

0 comments on commit b928dd1

Please sign in to comment.