gentoo-asahi-releng/tools-musl/run-stage4.sh

24 lines
940 B
Bash
Raw Normal View History

#!/bin/bash
set -eu
source /etc/catalyst/catalyst.conf
2017-01-02 03:35:11 +00:00
MUSL_DIR="$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )"
MY_DATE="$(date +%Y%m%d)"
# munge specfile for this run
2017-01-02 03:35:11 +00:00
cp "${MUSL_DIR}"/stage4-hardened-amd64.spec "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
sed -i "s|@REPO_DIR@|${MUSL_DIR}|g" "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
sed -i "s|MY_DATE|${MY_DATE}|g" "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
2017-01-02 03:35:11 +00:00
# catalyst stuff
2017-01-02 03:35:11 +00:00
catalyst -f "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec | tee -a "${MUSL_DIR}"/zzz.log
# update link, rm -f returns 0 if file isn't there yet
rm -f "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened.tar.bz2"
ln -s "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened-${MY_DATE}.tar.bz2" "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened.tar.bz2"
# remove old specfile
rm "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec