From: Juergen Hoetzel <juer...@archlinux.org>

Prevents consequential build errors.

Signed-off-by: Juergen Hoetzel <juer...@archlinux.org>
---
 makechrootpkg.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index d81be84..419e495 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -145,8 +145,10 @@ install_packages() {
        local ret
 
        pkgnames=("${install_pkgs[@]##*/}")
-
-       cp -- "${install_pkgs[@]}" "$copydir/root/"
+       if ! cp -- "${install_pkgs[@]}" "$copydir/root/"; then
+           error "Cannot copy packages"
+           return 1
+       fi
        arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
                pacman -U --noconfirm -- "${pkgnames[@]/#//root/}"
        ret=$?
-- 
2.18.0

Reply via email to