From f4dd3b7532e59b22a650ee83ba8bb85dbbf4215d Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Sun, 20 Sep 2026 04:27:40 -0400 Subject: [PATCH] Fix package lists that only resolved via the Omarchy repository --- bin/blob-packages-check | 54 ++++++++++++++++++++++++++++++++++++++ docs/commands.md | 8 +++++- docs/packages.md | 28 ++++++++++++++++++-- install.sh | 31 +++++++++++++++++++--- packages/blob-aur.packages | 9 +++---- packages/blob.packages | 14 ++++++---- 6 files changed, 128 insertions(+), 16 deletions(-) create mode 100755 bin/blob-packages-check diff --git a/bin/blob-packages-check b/bin/blob-packages-check new file mode 100755 index 0000000..4b6f3db --- /dev/null +++ b/bin/blob-packages-check @@ -0,0 +1,54 @@ +#!/bin/bash + +# blob:summary=Verify every package list entry resolves, ignoring extra repositories +# blob:hidden=true + +set -e + +bin_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +repo_dir="$(dirname "$bin_dir")" +official_list="$repo_dir/packages/blob.packages" +aur_list="$repo_dir/packages/blob-aur.packages" + +failures=0 + +entries() { + grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$1" 2>/dev/null || true +} + +# pacman -Si and yay -Si both search every configured repository, so a package +# that exists only in a third-party repo passes them and then fails on a machine +# that does not have that repo. These checks name the repositories explicitly. +official_names="$(pacman -Sl core extra multilib 2>/dev/null | awk '{print $2}' | sort -u)" + +echo "Checking $official_list against core, extra, multilib" +for entry in $(entries "$official_list"); do + name=${entry%%|*} + if ! printf '%s\n' "$official_names" | grep -qx "$name"; then + echo " NOT IN OFFICIAL REPOS: $name" + failures=$((failures + 1)) + fi +done + +echo "Checking $aur_list against the AUR" +for entry in $(entries "$aur_list"); do + name=${entry%%|*} + if printf '%s\n' "$official_names" | grep -qx "$name"; then + echo " IN OFFICIAL REPOS, MOVE IT: $name" + failures=$((failures + 1)) + continue + fi + if ! yay -Ssa "$name" 2>/dev/null | grep -qE "^aur/$name "; then + echo " NOT IN AUR: $name" + failures=$((failures + 1)) + fi +done + +echo +if (( failures == 0 )); then + echo "All entries resolve." + exit 0 +fi + +echo "$failures problem(s)." +exit 1 diff --git a/docs/commands.md b/docs/commands.md index d081a37..feb4b7e 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -348,6 +348,12 @@ of the `blob` listing. | --- | --- | --- | | `blob-osd` | Show the Blob Quickshell on-screen display | [-i\|--icon ] [-m\|--message ] [-p\|--progress <0-100>] [-d\|--duration ] | +## packages + +| Command | Does | Arguments | +| --- | --- | --- | +| `blob-packages-check` | Verify every package list entry resolves, ignoring extra repositories (hidden) | - | + ## pkg | Command | Does | Arguments | @@ -622,4 +628,4 @@ of the `blob` listing. ## Totals -293 commands. +294 commands. diff --git a/docs/packages.md b/docs/packages.md index cd6d341..5d9374b 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -69,14 +69,38 @@ Two are worth knowing about: `install.sh` installs what is missing before it writes any config: ``` -packages/blob.packages 117 packages from core, extra, multilib -packages/blob-aur.packages 11 packages with no official equivalent +packages/blob.packages 119 packages from core, extra, multilib +packages/blob-aur.packages 10 packages with no official equivalent ``` Only missing packages are touched, through `pacman -S --needed` and `yay -S --needed`. `./install.sh --check` lists what it would install without installing anything, and `--skip-packages` does the directories and config only. +### Validating the lists + +``` +blob-packages-check +``` + +`pacman -Si` and `yay -Si` both search *every* configured repository, so a +package that exists only in a third-party repo passes them and then fails on a +machine without that repo. `blob-packages-check` names the repositories +explicitly instead: official entries must be in core, extra or multilib, and AUR +entries must have an exact `aur/` match and must not be in an official repo. + +Run it after editing either list. It caught `localsend` and `tzupdate` sitting in +the official list when they only exist in the Omarchy repository, and `awww`, +`lazydocker` and `woff2-font-awesome` sitting in the AUR list when they are in +official `extra`. + +### Bootstrapping an AUR helper + +A fresh Arch install has no AUR helper, and `yay` is not in the official +repositories. `install.sh` builds `yay-bin` from the AUR once with `makepkg` +before installing anything from the AUR list, which is why `base-devel` and +`git` are in the official list. + An entry may be written `wanted|already-fine`, which asks for the first name but accepts either as satisfying the requirement. That is how `hyprland-preview-share-picker-git` avoids conflicting with the non-git build diff --git a/install.sh b/install.sh index eb7400b..57dbe50 100755 --- a/install.sh +++ b/install.sh @@ -137,15 +137,40 @@ install_packages() { fi if (( ${#aur_missing[@]} )); then - if ! command -v yay &>/dev/null; then - say "WARN yay is not installed; skipping ${#aur_missing[@]} AUR package(s)" + ensure_aur_helper || { + say "WARN no AUR helper; skipping ${#aur_missing[@]} AUR package(s): ${aur_missing[*]}" return 0 - fi + } say "install ${#aur_missing[@]} AUR package(s)" yay -S --needed --noconfirm "${aur_missing[@]}" fi } +# A fresh Arch install has no AUR helper, and yay is not in the official +# repositories, so it is built from the AUR once with makepkg. Everything after +# this point can then use yay normally. +ensure_aur_helper() { + command -v yay &>/dev/null && return 0 + + say "bootstrap yay from the AUR" + sudo pacman -S --needed --noconfirm base-devel git + + local build_dir + build_dir="$(mktemp -d)" + if ! git clone --depth 1 https://aur.archlinux.org/yay-bin.git "$build_dir/yay-bin"; then + rm -rf "$build_dir" + return 1 + fi + + ( cd "$build_dir/yay-bin" && makepkg -si --noconfirm ) || { + rm -rf "$build_dir" + return 1 + } + + rm -rf "$build_dir" + command -v yay &>/dev/null +} + blob_sudo_keepalive() { sudo -v 2>/dev/null || true } diff --git a/packages/blob-aur.packages b/packages/blob-aur.packages index 8dff8e2..0363a69 100644 --- a/packages/blob-aur.packages +++ b/packages/blob-aur.packages @@ -3,9 +3,6 @@ # # These have no official-repo equivalent. See docs/packages.md. -# Wallpaper daemon used by blob-wallpaper-set and blob-theme-menu -awww - # Palette extraction behind blob-wallpaper-set python-pywal @@ -20,10 +17,12 @@ aether # Fonts and icons with no official build ttf-ia-writer -woff2-font-awesome yaru-icon-theme # Tooling mise-bin ufw-docker -lazydocker + +# Only in the Omarchy repository as binaries; these are the AUR sources +tzupdate +localsend diff --git a/packages/blob.packages b/packages/blob.packages index aa8033e..85ac425 100644 --- a/packages/blob.packages +++ b/packages/blob.packages @@ -85,7 +85,6 @@ zram-generator # System utilities plocate man-db -tzupdate expac pacman-contrib @@ -99,6 +98,7 @@ noto-fonts noto-fonts-cjk noto-fonts-emoji fontconfig +woff2-font-awesome gnome-themes-extra # Image and video handling @@ -107,6 +107,9 @@ libvips webp-pixbuf-loader ffmpegthumbnailer +# Theming +awww + # Capture grim slurp @@ -133,6 +136,10 @@ neovim # Browser for web apps chromium +# Build tools, needed to bootstrap an AUR helper +base-devel +git + # Command line bat eza @@ -142,7 +149,6 @@ fzf zoxide jq starship -git lazygit btop fastfetch @@ -161,6 +167,4 @@ python-gobject docker docker-compose docker-buildx - -# Sharing -localsend +lazydocker