Skip to content

Commit

Permalink
fixup! python: setup: arch: installimage adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Dec 4, 2024
1 parent bb8c2f1 commit a7b0cc6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/setup/arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory

sys.path.append(str(Path(__file__).resolve().parents[1]))
# pylint: disable=wrong-import-position
Expand Down Expand Up @@ -626,6 +627,14 @@ def pacman_settings(dryrun=False):

lib.utils.print_or_write_text(PACMAN_CONF, conf_text, dryrun)

# Ensure that my database exists, as we may need to reinstall the linux
# package and that can fail if my database is not available. It is tempting
# to just 'pacman -Sy' here but we do not want to risk a partial upgrade...
if not (nathan_db := Path('/var/lib/pacman/sync/nathan.db')).exists():
with TemporaryDirectory() as tempdir:
subprocess.run(['pacman', '--dbpath', tempdir, '-Sy'], check=True)
Path(tempdir, '/'.join(nathan_db.parts[-2:])).rename(nathan_db)


def pacman_update():
pacman_install(['-yyu'])
Expand Down

0 comments on commit a7b0cc6

Please sign in to comment.