Commit dbc5bca8 authored by intrigeri's avatar intrigeri
Browse files

Adjust tails-diff-suites to take into account the move to APT_overlays.d.

parent a431e309
......@@ -49,7 +49,7 @@ packages_in_iso() {
# Gather information from the content of the branch we are looking
# at. Let's try to be a bit defensive, as we don't want to trust
# config/{base_branch,APT_overlays} too much... even though the
# config/{base_branch,APT_overlays.d} too much... even though the
# rest of the build system would run plenty of code from said
# branch, but at least it's (hopefully) clear to its users, which
# may not necessarily be the case here.
......@@ -66,7 +66,27 @@ packages_in_iso() {
base_branch_suite=$(ref_name_to_suite "$base_branch")
assert_is_apt_suite "$base_branch_suite"
overlays=$(git --git-dir="$git_dir" show "${branch}:config/APT_overlays")
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
assert_is_list_of_apt_suites $overlays
# And now we have all the info we need to output the suites we want
......@@ -80,8 +100,11 @@ packages_in_iso() {
packages_in_suites $overlays
}
sort_packages_list() {
sort --key=1 | sort --key=2
sort_packages_list_inplace() {
local list="$1"
sort --key=1 --output="$list" "$list"
sort --key=2 --output="$list" "$list"
}
### Sanity checks
......@@ -119,8 +142,10 @@ case "$MODE" in
error "Unsupported mode: '$MODE'"
esac
if ! diff -Naur <(cat "$OLDLIST" | sort_packages_list) \
<(cat "$NEWLIST" | sort_packages_list) ; then
sort_packages_list_inplace "$OLDLIST"
sort_packages_list_inplace "$NEWLIST"
if ! diff -Naur "$OLDLIST" "$NEWLIST" ; then
RET=$?
case "$RET" in
0|1)
......
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