From 80afdd710922f82171bb9250c33dca18475f42ca Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 15 Mar 2018 11:15:58 +0100 Subject: cleanup and plan for stage4 --- build_stage2_package.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'build_stage2_package.sh') diff --git a/build_stage2_package.sh b/build_stage2_package.sh index 2b58eff..ab06ba8 100755 --- a/build_stage2_package.sh +++ b/build_stage2_package.sh @@ -49,7 +49,7 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l cp -a "$ARCHLINUX32_PACKAGES/core/$PACKAGE" . ;; *) - print "ERROR: unknown FETCH_METHOD '$FETCH_METHOD'.." >&2 + echo "ERROR: unknown FETCH_METHOD '$FETCH_METHOD'.." >&2 exit 1 esac @@ -99,6 +99,8 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l scp -i $CROSS_HOME/.ssh/id_rsa -rC "$STAGE2_BUILD/$PACKAGE" build@$STAGE1_MACHINE_IP:/build/. # building the actual package + + echo "Building $PACKAGE on target.." ssh -i $CROSS_HOME/.ssh/id_rsa build@$STAGE1_MACHINE_IP bash -c "'cd $PACKAGE && makepkg --skipchecksums --skippgpcheck --nocheck'" > $PACKAGE.log 2>&1 RES=$? @@ -106,6 +108,8 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l tail "$PACKAGE.log" if test $RES = 0; then + + echo "Package $PACKAGE built sucessfully, installing on target.." # copy to our package folder in the first stage chroot @@ -119,10 +123,10 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l # there, packages seem to reappear in old versions) ssh -i $CROSS_HOME/.ssh/id_rsa root@$STAGE1_MACHINE_IP bash -c "' - rm -rf /var/cache/pacman/pkg/* - rm -rf /packages/$TARGET_CPU/temp.db* - rm -rf /packages/$TARGET_CPU/temp.files* - repo-add /packages/$TARGET_CPU/temp.db.tar.gz /packages/$TARGET_CPU/*pkg.tar.xz +# rm -rf /var/cache/pacman/pkg/* +# rm -rf /packages/$TARGET_CPU/temp.db* +# rm -rf /packages/$TARGET_CPU/temp.files* +# repo-add /packages/$TARGET_CPU/temp.db.tar.gz /packages/$TARGET_CPU/*pkg.tar.xz '" # install onto stage 1 system via pacman @@ -130,7 +134,7 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l if test "$FORCE_INSTALL"; then FORCE="--force" fi - + ssh -i $CROSS_HOME/.ssh/id_rsa root@$STAGE1_MACHINE_IP bash -c "' # TODO: broken [temp] repo if test \"$ADDITIONAL_INSTALL_PACKAGE\" != \"\"; then @@ -144,6 +148,8 @@ if test "$(find "$STAGE2_PACKAGES" -regex ".*/$PACKAGE-.*pkg\\.tar\\.xz" | wc -l # copy packages from target machine and replace our local version with it + echo "Salvaging build environment of $PACKAGE from target back to host.." + tmp_dir=$(mktemp -d 'tmp.compute-dependencies.0.XXXXXXXXXX' --tmpdir) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT -- cgit v1.2.3-54-g00ecf