The Meowgorithm Dotfiles, Collectors’ Edition
#!/usr/bin/env bash
# dnf-bundle - Package management script for Fedora
# Usage: dnf-bundle [command]
# Commands:
# install - Install all packages from DNFfile
# remove - Remove packages not in DNFfile
# sync - Sync packages (install + cleanup)
# upgrade - Upgrade all installed
# check - Check for missing/extra
# add PKG - Add package to DNFfile, install, and categorize
set -euo pipefail
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
DATA_DIR="$XDG_DATA_HOME/meowgorithm"
DNFFILE="$DATA_DIR/DNFfile"
LOCKFILE="$DATA_DIR/DNFfile.lock"
# =============================================================================
# LOCKFILE MANAGEMENT
# =============================================================================
# Initialize lockfile with preamble
init_lockfile() {
if [ ! -f "$LOCKFILE" ]; then
cat > "$LOCKFILE" <<EOF
# DNFfile.lock - Metadata for packages in DNFfile
# Auto-generated by dnf-bundle add
# Do not edit manually
EOF
fi
}
# Initialize lockfile if missing
ensure_lockfile() {
init_lockfile
}