From 854f697c08efbb7c20653b36bf8f43d71af4ec11 Mon Sep 17 00:00:00 2001 From: eater <=@eater.me> Date: Fri, 5 Jul 2019 16:20:10 +0200 Subject: [PATCH] xbps-builder: Add xbps-build and fetch default last changes --- xbps-builder/Dockerfile | 5 ++--- .../{setup-fakedchroot.sh => setup-fakedchroot} | 9 ++++++--- xbps-builder/files/xbps-build | 12 ++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) rename xbps-builder/files/{setup-fakedchroot.sh => setup-fakedchroot} (85%) create mode 100644 xbps-builder/files/xbps-build diff --git a/xbps-builder/Dockerfile b/xbps-builder/Dockerfile index 0529a69..627a11d 100644 --- a/xbps-builder/Dockerfile +++ b/xbps-builder/Dockerfile @@ -1,5 +1,4 @@ FROM d.xr.to/base:glibc -COPY files/fakedchroot.sh /_fakedchroot.sh -COPY files/setup-fakedchroot.sh / -RUN bash /setup-fakedchroot.sh && rm /setup-fakedchroot.sh +COPY files/* /opt/dxrto/ +RUN chmod a+x /opt/dxrto/setup-fakedchroot /opt/dxrto/fakedchroot.sh /opt/dxrto/xbps-build && /opt/dxrto/setup-fakedchroot && ln -s /opt/dxrto/xbps-build /bin/xbps-build WORKDIR '/_workdir' diff --git a/xbps-builder/files/setup-fakedchroot.sh b/xbps-builder/files/setup-fakedchroot similarity index 85% rename from xbps-builder/files/setup-fakedchroot.sh rename to xbps-builder/files/setup-fakedchroot index 8aa8aee..5dafe0b 100644 --- a/xbps-builder/files/setup-fakedchroot.sh +++ b/xbps-builder/files/setup-fakedchroot @@ -1,7 +1,11 @@ #!/usr/bin/env bash - set -e; +if [ "$1" == "--fix" ]; then + sed -i 's:check_installed_pkg base-chroot-0.1_1:true:' common/xbps-src/shutils/common.sh; + exit $? +fi + readonly WORKDIR="/_workdir" # Install base utils required for downloading latest void packages and running xbps-src xbps-install -Sy xtools base-devel chroot-git chroot-util-linux tar wget coreutils @@ -11,8 +15,7 @@ git clone --depth 1 'https://github.com/void-linux/void-packages.git' "${WORKDIR cd "${WORKDIR}"; # Copy fakedchroot chroot style into chroot-style dir and make it executable -cp /_fakedchroot.sh "${WORKDIR}/common/chroot-style/fakedchroot.sh"; -chmod a+x "${WORKDIR}/common/chroot-style/fakedchroot.sh"; +ln -s /opt/dxrto/fakedchroot.sh "${WORKDIR}/common/chroot-style/fakedchroot.sh"; # If masterdir exists: remove it, because we will replace it with a symlink if [ -d "${WORKDIR}/masterdir" ]; then diff --git a/xbps-builder/files/xbps-build b/xbps-builder/files/xbps-build new file mode 100644 index 0000000..01375fc --- /dev/null +++ b/xbps-builder/files/xbps-build @@ -0,0 +1,12 @@ +#!/usr/bin/bash +set -e + +cd /_workdir; + +echo "Updating srcpkgs"; +git checkout .; +git pull --ff; +echo "Fixing fakedchroot"; +/opt/dxrto/setup-fakedchroot --fix; +echo "Running build"; +./xbps-src pkg "$@";