[pacman-dev] [PATCH] makechrootpkg: handle errors when copying packages into chroot
From: Juergen Hoetzel <juergen@archlinux.org> Prevents consequential build errors. Signed-off-by: Juergen Hoetzel <juergen@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
On 08/01/2018 12:31 PM, juergen@hoetzel.info wrote:
From: Juergen Hoetzel <juergen@archlinux.org>
Prevents consequential build errors.
1) this is a patch to devtools, not pacman, and should go to the arch-projects mailing list. 2) This doesn't really "fix" build errors, it just returns 1 after the first error instead of the third, then continues trying to build the package because makechrootpkg does not consider failure in install_packages() to be an error state and prefers to let makepkg speak for itself. It just makes the error logging more pretty. -- Eli Schwartz Bug Wrangler and Trusted User
participants (2)
-
Eli Schwartz
-
juergen@hoetzel.info