#!/usr/bin/env bash # 2018 Luke Shumaker { set -euE gitrev="${1:-systemd/master}" workdir=$PWD/workdir mkdir -p -- "$workdir" gitget bare https://git.parabola.nu/~lukeshu/systemd.git "$workdir/systemd.git" pushd "$workdir/systemd.git" COMMIT=$(git rev-parse --verify "$gitrev") popd # Build systemd 232 mkdir -p "$workdir/build-232" ./osi-mk \ --size=4G \ --package='base' \ --module=osi-mk.d/libretools.sh \ --module=osi-mk.d/builddeps.sh \ --module=osi-mk.d/systemd-dhcpcd.sh \ --module=osi-mk.d/systemd-osi-run.sh \ --directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \ --directory="abs/systemd-232:/home/testuser/packages/abs/systemd" \ "${workdir}/build-232/build.raw" ./osi-run "${workdir}/build-232/build.raw" <<-EOF #!/usr/bin/env bash set -ex cd ~/packages/abs/systemd script --return --quiet --command 'sudo libremakepkg' /dev/null EOF ./osi-extract "${workdir}/build-232/build.raw" /home/testuser/packages/pkgdest "${workdir}/build-232/pkgdest" # Build the code under under test mkdir -p "$workdir/build-main" ./osi-mk \ --size=4G \ --package='base' \ --module=osi-mk.d/libretools.sh \ --module=osi-mk.d/builddeps.sh \ --module=osi-mk.d/systemd-dhcpcd.sh \ --module=osi-mk.d/systemd-osi-run.sh \ --directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \ --directory="abs/systemd:/home/testuser/packages/abs/systemd" \ "${workdir}/build-main/build.raw" ./osi-run "${workdir}/build-main/build.raw" <<-EOF #!/usr/bin/env bash set -ex cd ~/packages/abs/systemd sed 's:@COMMIT@:${COMMIT}:' < PKGBUILD.in > PKGBUILD script --return --quiet --command 'sudo libremakepkg' /dev/null EOF ./osi-extract "${workdir}/build-main/build.raw" /home/testuser/packages/pkgdest "${workdir}/build-main/pkgdest" }