diff --git a/akshara b/akshara index 4a0dfa8..bd6fd18 100644 --- a/akshara +++ b/akshara @@ -19,11 +19,15 @@ import os import sys +import time import yaml +import shutil import filecmp import argparse import requests +import platform import fasteners +from threading import Event import subprocess __version = '1.0.0' @@ -162,6 +166,7 @@ def update_system(): repo = "https://pkg-repo.blendos.co" elif not (repo.startswith("https://") or repo.startswith("http://")): repo = "https://" + repo + if not os.path.isfile('/.update.tar.zst'): if exec('wget', '-q', '--show-progress', f'{bootstrap_repo}/iso/latest/archlinux-bootstrap-x86_64.tar.zst', '-O', '/.update.tar.zst') != 0: warn('failed download') @@ -219,6 +224,10 @@ def update_system(): 'blend-files' ] + keep = [ + '/usr/share' + ] + if (type(blend_release.get('impl')) == str and type(blend_release.get('track')) != 'custom'): res = interpret_track(blend_release) @@ -250,7 +259,7 @@ def update_system(): with open('/.new_rootfs/etc/pacman.d/mirrorlist', 'w') as pacman_mirrorlist_conf: pacman_mirrorlist_conf.write( - f'Server = {arch_repo}/$repo/os/$arch\n') + f'Server = {arch_repo}/$repo/os/$arch\n') exec_chroot('mkdir', '-p', '/var/cache/pacman/pkg') exec_chroot('rm', '-rf', '/var/cache/pacman/pkg') @@ -430,6 +439,7 @@ Server = {package_repo["repo-url"]} exec('cp', '-ax', '/.new_rootfs/var/lib/pacman', '/.new.var.lib/pacman') exec('mv', '.new_rootfs', '.update_rootfs') + exec('cp', '-ax', '/.update_rootfs/etc', '/.update_rootfs/usr/etc') new_boot_files = [] @@ -520,7 +530,7 @@ except: # remove update and akshara stuff if the program errors (either exited by the user or an error) and is updating if command == update_system and not args.keep_files_on_error: exec('umount', '-rf', '/.new_rootfs/') - exec('rmdir', '/.new_rootfs/') + exec('rm', '-rf', '/.new_rootfs/') exec('rm', '-rf', '/.update_rootfs') exec('rm', '-f', '/.update') else: