From 5cc5ed05cef0ece968315276fca99e83696b1063 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 4 Dec 2015 22:50:34 +0100 Subject: [PATCH] Do not fail source retrieval step with apt >=1.1 apt >=1.1 tries to drop privileges which fails in our typical setup with: | W: Can't drop privileges for downloading as file 'zsh_5.2-2.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) Instead let's check for actual errors (starting with "E:"), and do not fail the build if there warnings only ("W:"). --- etc/grml/fai/config/scripts/GRMLBASE/03-get-sources | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/grml/fai/config/scripts/GRMLBASE/03-get-sources b/etc/grml/fai/config/scripts/GRMLBASE/03-get-sources index 4e20182..4deb887 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/03-get-sources +++ b/etc/grml/fai/config/scripts/GRMLBASE/03-get-sources @@ -42,11 +42,19 @@ apt-get --download-only source "$package" 2>>/grml-live/sources/errors.log EOT done - if grep -q . "${target}/grml-live/sources/errors.log" ; then + if grep -q '^E:' "${target}/grml-live/sources/errors.log" ; then echo "Errors noticed while retrieving sources:" >&2 cat "${target}/grml-live/sources/errors.log" >&2 bailout exit 1 + elif grep -q '^W:' "${target}/grml-live/sources/errors.log" ; then + echo "Warnings noticed while retrieving sources (not failing the build though):" + cat "${target}/grml-live/sources/errors.log" + elif grep -q '.' "${target}/grml-live/sources/errors.log" ; then + echo "Unclassified problems noticed while retrieving sources:" >&2 + cat "${target}/grml-live/sources/errors.log" >&2 + bailout + exit 1 fi fi -- 2.1.4