From 681562d743ca332e867e20a5d9a74f9d33e74e96 Mon Sep 17 00:00:00 2001 From: diviocity Date: Tue, 10 Nov 2026 23:57:20 +0100 Subject: [PATCH] feat: install.vsh 32-bit repo support --- README.md | 4 +++- install.vsh | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9040367..f5b041d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ vpac s -r linux-lts # search the sync databases ``` `install.vsh` also asks whether to keep vpac's database, cache, keys and hooks -in pacman's directories, and whether to turn libalpm's download sandbox off. +in pacman's directories, whether to add the distro's repo of 32-bit libraries +(`multilib` on arch, `lib32` on artix), and whether to turn libalpm's download +sandbox off. Answer no to the first only if you mean to keep vpac's state apart from pacman's: a separate database does not know the packages pacman installed. diff --git a/install.vsh b/install.vsh index 0c9d0ff..0f78dbc 100755 --- a/install.vsh +++ b/install.vsh @@ -20,6 +20,10 @@ struct Distro { name string repos []string src string + // lib32 is the distro's repo of 32-bit libraries, '' when it ships none: + // the shared mirror list serves it, the url's $repo picks the repo. + // cachyos builds a monorepo, so it has none and its question is skipped + lib32 string } fn distros() []Distro { @@ -28,16 +32,19 @@ fn distros() []Distro { name: 'arch' repos: ['core', 'extra'] src: 'https://geo.mirror.pkgbuild.com/\$repo/os/\$arch' + lib32: 'multilib' }, Distro{ name: 'artix' repos: ['system', 'world', 'galaxy'] src: 'https://mirror1.artixlinux.org/repos/\$repo/os/\$arch' + lib32: 'lib32' }, Distro{ name: 'cachyos' repos: ['cachyos'] src: 'https://mirror.cachyos.org/repo/\$arch/\$repo' + lib32: '' }, ] } @@ -80,6 +87,7 @@ fn own_paths() Paths { struct Answers { distro string aur bool + lib32 bool root string parallel int color string @@ -121,7 +129,13 @@ fn run() ! { } distro := ask_choice('mirrors for which os', distros().map(it.name), detect_distro())! + d := distro_named(distro) aur := ask_yes('add the AUR as a pkgbuild repo', true)! + mut lib32 := false + if d.lib32 != '' { + // pacman.conf ships multilib commented out, so off is the default here too + lib32 = ask_yes('add the ${d.lib32} repo for 32-bit libraries', false)! + } providers := ['doas', 'sudo', 'pkexec', 'su'] root := ask_choice('the command vpac gets root with', providers, root_default())! parallel := ask_count('parallel downloads', 3, 1)! @@ -138,13 +152,13 @@ fn run() ! { a := Answers{ distro: distro aur: aur + lib32: lib32 root: root parallel: parallel color: color sandbox: sandbox arch: os.uname().machine } - d := distro_named(distro) mirror := os.join_path(etc, 'mirrors', '${d.name}.lip') write_mirror := !os.exists(mirror) @@ -314,6 +328,9 @@ fn config_text(a Answers, p Paths, d Distro) string { for name in d.repos { repos << '(repo\n :name "${name}"\n :src mirrors-${d.name})' } + if a.lib32 { + repos << '(repo\n :name "${d.lib32}"\n :src mirrors-${d.name})' + } if a.aur { repos << '(repo\n :name "aur"\n :type "pkgbuild"\n :src "https://aur.archlinux.org")' } @@ -336,8 +353,8 @@ fn config_text(a Answers, p Paths, d Distro) string { :parallel ${a.parallel} :protocols ["https"] :user "alpm"' + - if a.sandbox { ' :disable-sandbox true' } else { '' } + -') + if a.sandbox { ' :disable-sandbox true' } else { '' } + + ') (options :root "${a.root}" -- 2.56.1