The builder stage never declared ARG MIRROR, so the keyring [omarchy] repo pointed at the channel-less legacy pkgs.omarchy.org/$arch path — it works only because a stale copy of the old layout still answers there, and it would miss a keyring rotation. Each image now pulls omarchy-keyring from its own channel (edge/rc/stable), matching the base mirror it already selects. update-repo and remove-package switch to the edge x86_64 image: repo-add and repo-remove compile nothing, and using the channel image would deadlock bootstrap-rc — the rc image can only build once the rc channel it pulls the keyring from exists remotely.
92 lines
2.3 KiB
Bash
Executable File
92 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Omarchy Repository Database Manager
|
|
# Updates the repository database with all packages
|
|
|
|
set -e
|
|
|
|
# Source common functions
|
|
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
|
|
source "$BUILD_ROOT/helpers/message-helpers.sh"
|
|
source "$BUILD_ROOT/helpers/docker-helpers.sh"
|
|
source "$BUILD_ROOT/helpers/paths.sh"
|
|
source "$BUILD_ROOT/helpers/lock-helpers.sh"
|
|
|
|
# Function to update repository database using Docker
|
|
update_database() {
|
|
print_info "Updating repository database in Docker container..."
|
|
|
|
# Check Docker is available
|
|
check_docker
|
|
|
|
# Ensure output directory exists
|
|
if [[ ! -d "$REPO_DIR" ]]; then
|
|
print_error "Output directory not found: $REPO_DIR"
|
|
print_warning "Run bin/repo build first"
|
|
exit 1
|
|
fi
|
|
|
|
# Make output directory writable for container
|
|
make_dir_writable "$REPO_DIR"
|
|
|
|
# repo-add is architecture- and mirror-independent, so always use the edge
|
|
# x86_64 image. This also lets bootstrap-rc build the rc database before the
|
|
# rc channel exists remotely (an rc image can only build after it does).
|
|
build_docker_image "$BUILD_DIR" "x86_64" "edge"
|
|
|
|
docker run --rm --platform linux/amd64 \
|
|
-e ARCH="$ARCH" \
|
|
-e MIRROR="$MIRROR" \
|
|
-v "$REPO_ROOT:/output" \
|
|
-v "$BUILD_DIR:/build:ro" \
|
|
omarchy-pkg-builder:latest-x86_64-edge /build/update-repo.sh
|
|
}
|
|
|
|
# Main execution
|
|
main() {
|
|
print_header "Omarchy Repository Database Manager"
|
|
|
|
# Parse command line arguments
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--arch)
|
|
ARCH="$2"
|
|
update_arch_paths
|
|
shift 2
|
|
;;
|
|
--mirror)
|
|
MIRROR="$2"
|
|
require_valid_mirror "$MIRROR"
|
|
update_arch_paths
|
|
shift 2
|
|
;;
|
|
-h | --help)
|
|
echo "Usage: $0 [OPTIONS]"
|
|
echo ""
|
|
echo "Options:"
|
|
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
|
|
echo " --mirror <mirror> Mirror to use (edge, rc, or stable, default: edge)"
|
|
echo " -h, --help Show this help message"
|
|
exit 0
|
|
;;
|
|
*)
|
|
print_error "Unknown option: $1"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
print_info "Target architecture: $ARCH"
|
|
print_info "Mirror: $MIRROR"
|
|
print_info "Output directory: $REPO_DIR"
|
|
|
|
acquire_release_lock || exit 1
|
|
|
|
update_database
|
|
|
|
echo ""
|
|
print_success "Repository update complete!"
|
|
}
|
|
|
|
# Run main function
|
|
main "$@"
|