Commit 17e875f6 authored by Pierre Schmitz's avatar Pierre Schmitz
Browse files

makechrootpkg: Keep source files even if build fails

implementes FS#18437
parent a7c5010d
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -221,6 +221,14 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
		fi
	done

	for l in "${copydir}"/build/*-{build,package}.log; do
		[ -f "$l" ] && mv "$l" "${WORKDIR}"
	done
else
	#just in case. We returned 1, make sure we fail
	touch "${copydir}/build/BUILD_FAILED"
fi

for f in "${copydir}"/srcdest/*; do
	[ -e "$f" ] || continue
	if [ -d "$SRCDEST" ]; then
@@ -230,14 +238,6 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
	fi
done

	for l in "${copydir}"/build/*-{build,package}.log; do
		[ -f "$l" ] && mv "$l" "${WORKDIR}"
	done
else
	#just in case. We returned 1, make sure we fail
	touch "${copydir}/build/BUILD_FAILED"
fi

if [ -e "${copydir}/build/BUILD_FAILED" ]; then
	echo "Build failed, check $copydir/build"
	rm "${copydir}/build/BUILD_FAILED"