chore: format
This commit is contained in:
parent
27da28ccca
commit
53e7c32106
1 changed files with 31 additions and 18 deletions
39
akshara
39
akshara
|
@ -103,7 +103,8 @@ def error(err):
|
|||
|
||||
|
||||
def interpret_track(blend_release):
|
||||
result = yaml.safe_load(requests.get(blend_release.get('impl') + '/' + blend_release.get('track') + '.yaml', allow_redirects=True).content.decode())
|
||||
result = yaml.safe_load(requests.get(blend_release.get(
|
||||
'impl') + '/' + blend_release.get('track') + '.yaml', allow_redirects=True).content.decode())
|
||||
|
||||
if (type(result.get('impl')) == str and
|
||||
type(result.get('track')) != 'custom'):
|
||||
|
@ -239,13 +240,16 @@ def update_system():
|
|||
|
||||
with open('/.new_rootfs/etc/pacman.d/mirrorlist', 'w') as pacman_mirrorlist_conf:
|
||||
if type(blend_release.get('arch-repo')) == str:
|
||||
pacman_mirrorlist_conf.write(f'Server = {blend_release.get("arch-repo")}/$repo/os/$arch\n')
|
||||
pacman_mirrorlist_conf.write(
|
||||
f'Server = {blend_release.get("arch-repo")}/$repo/os/$arch\n')
|
||||
else:
|
||||
pacman_mirrorlist_conf.write('Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch\n')
|
||||
pacman_mirrorlist_conf.write(
|
||||
'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch\n')
|
||||
|
||||
exec_chroot('mkdir', '-p', '/var/cache/pacman/pkg')
|
||||
exec_chroot('rm', '-rf', '/var/cache/pacman/pkg')
|
||||
exec('cp', '-r', '/var/cache/pacman/pkg', '/.new_rootfs/var/cache/pacman')
|
||||
exec('cp', '-r', '/var/cache/pacman/pkg',
|
||||
'/.new_rootfs/var/cache/pacman')
|
||||
|
||||
# update packages
|
||||
exec_chroot('pacman-key', '--init')
|
||||
|
@ -261,14 +265,20 @@ def update_system():
|
|||
if return_val == 0:
|
||||
break
|
||||
|
||||
exec_chroot('reflector', '--latest', '5', '--protocol', 'https', '--sort', 'rate', '--save', '/etc/pacman.d/mirrorlist')
|
||||
exec_chroot('reflector', '--latest', '5', '--protocol', 'https',
|
||||
'--sort', 'rate', '--save', '/etc/pacman.d/mirrorlist')
|
||||
|
||||
#exec_chroot('sed', 's/#//g', '-i', '/etc/pacman.d/mirrorlist')
|
||||
#exec_chroot('bash', '-c', 'grep "^Server =" /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist.tmp; mv /etc/pacman.d/mirrorlist.tmp /etc/pacman.d/mirrorlist')
|
||||
# exec_chroot('sed', 's/#//g', '-i', '/etc/pacman.d/mirrorlist')
|
||||
# exec_chroot('bash', '-c', 'grep "^Server =" /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist.tmp; mv /etc/pacman.d/mirrorlist.tmp /etc/pacman.d/mirrorlist')
|
||||
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'r') as original: data = original.read()
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'w') as modified: modified.write(data.replace("[options]", "[options]\nParallelDownloads = 32\n"))
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'w') as modified: modified.write(data.replace("#[multilib]\n#Include = /etc/pacman.d/mirrorlist", "[multilib]\nInclude = /etc/pacman.d/mirrorlist"))
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'r') as original:
|
||||
data = original.read()
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'w') as modified:
|
||||
modified.write(data.replace(
|
||||
"[options]", "[options]\nParallelDownloads = 32\n"))
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'w') as modified:
|
||||
modified.write(data.replace(
|
||||
"#[multilib]\n#Include = /etc/pacman.d/mirrorlist", "[multilib]\nInclude = /etc/pacman.d/mirrorlist"))
|
||||
|
||||
with open('/.new_rootfs/etc/pacman.conf', 'a') as pacman_conf:
|
||||
pacman_conf.write(f'''
|
||||
|
@ -312,8 +322,10 @@ Server = {package_repo["repo-url"]}
|
|||
counter = 0
|
||||
if aur_packages != []:
|
||||
while True:
|
||||
exec_chroot('useradd', '-m', '-G', 'wheel', '-s', '/bin/bash', 'aur')
|
||||
exec_chroot('bash', '-c', 'echo "aur ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aur')
|
||||
exec_chroot('useradd', '-m', '-G', 'wheel',
|
||||
'-s', '/bin/bash', 'aur')
|
||||
exec_chroot(
|
||||
'bash', '-c', 'echo "aur ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aur')
|
||||
return_val = exec_chroot(
|
||||
'runuser', '-u', 'aur', '--', 'paru', '-Sy', '--noconfirm', '--needed',
|
||||
'--noprogressbar', '--skipreview', '--removemake', '--cleanafter', '--ask=4',
|
||||
|
@ -385,7 +397,8 @@ Server = {package_repo["repo-url"]}
|
|||
|
||||
exec('cp', '-ax', '/var/lib', '/.new.var.lib')
|
||||
|
||||
var_lib_diff = filecmp.dircmp('/.new_rootfs/var/lib/', '/.new.var.lib/')
|
||||
var_lib_diff = filecmp.dircmp(
|
||||
'/.new_rootfs/var/lib/', '/.new.var.lib/')
|
||||
|
||||
dir_name = '/.new.var.lib/'
|
||||
for name in var_lib_diff.left_only:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue