mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2025-08-07 06:37:23 +02:00
Embedding one pieces of code into another (shell script into a makefiles in this case) is rarely pretty. Split things up, as appropriate. While here, simplify the rootfs in a few ways: - pass only the extra non-base (and effectively group name) package - add a handy variable for the fakeroot/fakechroot combo - split and rewrap long lines As a bonus point, this makes it easier to use pattern rules in the makefile - which will be handy for the upcoming multilib-devel group/target. Plus we can check the scripts via shellcheck/etc CI stage, as follow-up. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
17 lines
567 B
Bash
Executable File
17 lines
567 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
declare -r GROUP="$1"
|
|
declare -r OUTPUTDIR="$2"
|
|
|
|
sed -e "s|TEMPLATE_ROOTFS_FILE|$GROUP.tar.zst|" \
|
|
-e "s|TEMPLATE_ROOTFS_RELEASE_URL|Local build|" \
|
|
-e "s|TEMPLATE_ROOTFS_DOWNLOAD|ROOTFS=\"$GROUP.tar.zst\"|" \
|
|
-e "s|TEMPLATE_ROOTFS_HASH|$(cat $OUTPUTDIR/$GROUP.tar.zst.SHA256)|" \
|
|
-e "s|TEMPLATE_TITLE|Arch Linux Dev Image|" \
|
|
-e "s|TEMPLATE_VERSION_ID|dev|" \
|
|
-e "s|TEMPLATE_REVISION|$(git rev-parse HEAD)|" \
|
|
-e "s|TEMPLATE_CREATED|$(date -Is)|" \
|
|
Dockerfile.template > "$OUTPUTDIR/Dockerfile.$GROUP"
|