From 4c6d141e12e1ba83b780d4de945f0513e661a964 Mon Sep 17 00:00:00 2001 From: Matthias Fulz Date: Sun, 18 Jul 2021 22:48:42 +0200 Subject: [PATCH] Fixed keys param. Version bump --- Makefile | 2 +- archbuilder.in | 9 +-------- lib/buildah.inc.sh | 13 ++----------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index ac42ad9..79c9e7e 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ ARCHBUILDER_LIB_DIR ?= $(LIBDIR)/$(PROGNM) ARCHBUILDER_CONF_DIR ?= $(CNFDIR)/$(PROGNM) ARCHBUILDER_VERSION ?= $(shell git describe --tags || true) ifeq ($(ARCHBUILDER_VERSION),) - ARCHBUILDER_VERSION := 0.9.4 + ARCHBUILDER_VERSION := 0.9.5 endif .PHONY: install build archbuilder diff --git a/archbuilder.in b/archbuilder.in index 57dc3dd..804ff8c 100644 --- a/archbuilder.in +++ b/archbuilder.in @@ -20,7 +20,6 @@ unset _FLAG_KEEP unset _FLAG_SILENT _OPT_MODE="build" -_OPT_DEPS=() _OPT_KEYS=() _OPT_CON_BUILD_USER="archbuilder" @@ -49,7 +48,6 @@ function usage() { echo -e " \t\tcreate will setup the base image" echo -e " \t\tupdate will update the base image" echo -e " \t\tbuild will build the PKGBUILD" - echo -e " -d, --dep \t\t\t\tPath to pacman package file that is needed as dependency for the build. (Can be added multiple times)" echo -e " -e, --key \t\t\t\tPublic signing keys that should be trusted by for the build. (Can be added multiple times)" echo -e " -r, --repo \t\t\t\tHost path to use as repository inside the container. This can be used to avoid" echo -e " \t\t\t\thanding over dependencies via command line arguments as they will be added to this repo" @@ -63,12 +61,11 @@ function usage() { } options=$(getopt \ - -o hkn:m:p:d:r:e:sl: \ + -o hkn:m:p:r:e:sl: \ -l "help" \ -l keep \ -l name: \ -l mode: \ - -l dep: \ -l repo: \ -l silent: \ -l level: \ @@ -89,10 +86,6 @@ while true; do shift _OPT_MODE="${1}" ;; - -d|--dep) - shift - _OPT_DEPS[${#_OPT_DEPS[*]}]="${1}" - ;; -e|--key) shift _OPT_KEYS[${#_OPT_KEYS[*]}]="${1}" diff --git a/lib/buildah.inc.sh b/lib/buildah.inc.sh index d21f754..3880b72 100644 --- a/lib/buildah.inc.sh +++ b/lib/buildah.inc.sh @@ -4,7 +4,6 @@ _BUILDAH_CONT="" _BUILDAH_BASE_IMAGE="archlinux" _BUILDAH_BASE_PATH="/home/archbuilder" -_BUILDAH_DEP_PATH="${_BUILDAH_BASE_PATH}/deps" _BUILDAH_MKPKG_PATH="${_BUILDAH_BASE_PATH}/mkpgs" _BUILDAH_PKGDEST_PATH="${_BUILDAH_BASE_PATH}/pkgdest" _BUILDAH_CACHE_REPO_NAME="archbuilder_cache_repo" @@ -143,17 +142,9 @@ function buildah_prepare_build() { log_info "Updating container system" exec_cmd buildah run --user ${_OPT_CON_BUILD_USER} ${_BUILDAH_PARAMS} "${_BUILDAH_CONT}" sudo pacman --noconfirm -Syu - return 0 - for d in "${DEPS[@]}" + for k in "${_OPT_KEYS[@]}" do - buildah copy --chown "${_BUILD_USER}" "${CONT}" "${d}" "${_DEP_PATH}/" - f=$(basename "${d}") - buildah run "${CONT}" pacman --noconfirm -U "${_DEP_PATH}/${f}" - done - - for k in "${KEYS[@]}" - do - buildah run --user "${_BUILD_USER}" "${CONT}" gpg --receive-keys "${k}" + exec_cmd buildah run --user ${_OPT_CON_BUILD_USER} ${_BUILDAH_PARAMS} "${_BUILDAH_CONT}" gpg --receive-keys "${k}" done }