update build-pkg scripts

This commit is contained in:
Daniel Langbein 2021-06-14 20:16:40 +02:00
parent 3e0b35e3e6
commit 25ce522e5e
5 changed files with 35 additions and 13 deletions

View File

@ -31,7 +31,7 @@ sudo pacman -U out/de-p1st-repo*.pkg.tar.*
Then you can start building all packages and adding them to your mirror-server:
```shell
./build-pkg-docker.sh
./build-all.sh
```

View File

@ -82,9 +82,9 @@ function main() {
done
else
# Stage1
build-and-push xorg-meta de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo || return $?
build-and-push xorg-meta de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo de-p1st-ssh-key-placeholder de-p1st-ssh-key-yoda || return $?
# Stage2
build-and-push de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns || return $?
build-and-push de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns de-p1st-ssh || return $?
# Stage3
build-and-push de-p1st-base || return $?
# Stage4

View File

@ -28,7 +28,13 @@ function start-docker() {
function build-pkg() {
# --rm: Remove container after run.
sudo docker-compose run --rm makepkg "${1}"
COMPOSE_ARGS=('run' '--rm' 'makepkg')
if [ "${INTERACTIVE}" = "true" ]; then
COMPOSE_ARGS+=('interactive')
fi
COMPOSE_ARGS+=("${1}")
sudo docker-compose "${COMPOSE_ARGS[@]}"
}
function push-pkg() {
@ -46,15 +52,16 @@ function main() {
start-docker || return $?
is-installed "docker-compose" || return $?
# PKGS=(xorg-meta de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo)
# for PKG in "${PKGS[@]}"; do
# build-pkg "${PKG}" || return $?
# done
if [ "${1}" = "interactive" ]; then
echo "Interactive mode enabled"
INTERACTIVE=true
shift; # remove first argument
fi
# Stage1
build-and-push xorg-meta de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo || return $?
build-and-push xorg-meta de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo de-p1st-ssh-key-placeholder de-p1st-ssh-key-yoda || return $?
# Stage2
build-and-push de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns || return $?
build-and-push de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns de-p1st-ssh || return $?
# Stage3
build-and-push de-p1st-base || return $?
# Stage4

View File

@ -1,7 +1,13 @@
version: '3.7'
services:
# usage: sudo docker-compose run --rm makepkg
# usage:
# - use PKGBUILD found in /pkg
# sudo docker-compose run --rm makepkg
# sudo docker-compose run --rm makepkg interactive
# - use PKGBUILD found in /pkg/<RelativePath>
# sudo docker-compose run --rm makepkg <RelativePath>
# sudo docker-compose run --rm makepkg interactive <RelativePath>
makepkg:
build: .

View File

@ -13,10 +13,14 @@ function build-pkg(){
cp -r "${PKG}" /tmp/pkg
cd /tmp/pkg
MAKEPKG_ARGS=('--syncdeps')
if [ "${INTERACTIVE}" != "true" ]; then
MAKEPKG_ARGS+=('--noconfirm') # --noconfirm is passed to pacman
fi
# Build the package.
# One could add argument "--noconfirm" to "makepkg" (which will be passed to Pacman) for non-interactive mode.
set +e
makepkg --syncdeps
makepkg "${MAKEPKG_ARGS[@]}"
saved="$?"
set -e
@ -43,6 +47,11 @@ function main(){
# Refresh mirrors
sudo pacman -Sy
if [ "${1}" = "interactive" ]; then
INTERACTIVE=true
shift; # remove first argument
fi
# If first argument is zero, use default directory
if [ -z "${1}" ]; then
PKG=/pkg