Commit 1055c30a authored by intrigeri's avatar intrigeri
Browse files

Fix error handling for the git|sed|grep pipeline.

... for similar reasons to the previous commit about the diff(1) command.
parent 2ee73aa1
......@@ -66,27 +66,29 @@ packages_in_iso() {
base_branch_suite=$(ref_name_to_suite "$base_branch")
assert_is_apt_suite "$base_branch_suite"
if ! overlays=$(git --git-dir="$git_dir" \
ls-tree --name-only "$branch" config/APT_overlays.d/ \
| sed --regexp-extended -e 's,^config/APT_overlays\.d/,,' \
| grep -v --line-regexp --fixed-strings '.placeholder')
then
local ret=$?
case "$ret" in
0|1)
# grep did its job just fine
:
;;
2)
# grep had trouble
error "grep(1) failed."
;;
*)
# undocumented diff exit code
error "grep(1) returned $? -- I don't know what it means."
;;
esac
fi
overlays_dir_entries=$(git --git-dir="$git_dir" ls-tree --name-only \
"$branch" config/APT_overlays.d/ \
| sed --regexp-extended \
-e 's,^config/APT_overlays\.d/,,')
set +e
overlays=$(echo "$overlays_dir_entries" \
| grep -v --line-regexp --fixed-strings '.placeholder')
local grep_ret=$?
set -e
case "$grep_ret" in
0|1)
# grep did its job just fine
:
;;
2)
# grep had trouble
error "grep(1) failed."
;;
*)
# undocumented diff exit code
error "grep(1) returned $grep_ret -- I don't know what it means."
;;
esac
assert_is_list_of_apt_suites $overlays
# And now we have all the info we need to output the suites we want
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment