Merge ~virtustom/ubuntu-docker-images/+git/utils:fix-devel into ~ubuntu-docker-images/ubuntu-docker-images/+git/utils:main

Proposed by Tomáš Virtus
Status: Merged
Merged at revision: 14478b7f169480209f338d1f9532781edcc26f54
Proposed branch: ~virtustom/ubuntu-docker-images/+git/utils:fix-devel
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/utils:main
Diff against target: 26 lines (+11/-1)
1 file modified
tag-images.sh (+11/-1)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Review via email: mp+420036@code.launchpad.net

Commit message

Don't fail when there's new devel release

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP. As we've already discussed this on Mattermost, I'm approving and merging it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tag-images.sh b/tag-images.sh
2index 61797f2..b7dd08a 100755
3--- a/tag-images.sh
4+++ b/tag-images.sh
5@@ -126,10 +126,20 @@ do_tag_base_ubuntu_image ()
6 local -a IMAGE_TAGS EDGE_TAGS
7
8 local DISTRONAME_DEVEL DISTRONAME_STABLE DISTRONAME_LTS
9- DISTRONAME_DEVEL=$(distro-info --devel)
10 DISTRONAME_STABLE=$(distro-info --stable)
11 DISTRONAME_LTS=$(distro-info --lts)
12
13+ # On new release day and some time after when there's no new devel
14+ # entry in /usr/share/distro-info/ubuntu.csv, "distro-info
15+ # --devel" fails with "Distribution data outdated." error message.
16+ # In that case keep DISTRONAME_DEVEL empty and continue.
17+ local ret=0
18+ DISTRONAME_DEVEL=$(LC_ALL=C distro-info --devel 2>&1) || ret=$?
19+ if [[ $ret -ne 0 && "$DISTRONAME_DEVEL" != *"Distribution data outdated"* ]]; then
20+ echo "$DISTRONAME_DEVEL" >&2
21+ return $ret
22+ fi
23+
24 readarray -t IMAGE_TAGS < <(print_tags_for_image "${image}")
25
26 readarray -t EDGE_TAGS < <(printf '%s\n' "${IMAGE_TAGS[@]}" \

Subscribers

People subscribed via source and target branches