Skip to content

Commit 5143c59

Browse files
reubenoCopilot
authored andcommitted
azurelinux-repos: fix dist tag date extraction for tilde-only forms
The date extraction logic split on '.' to get the last segment, which worked for dist tags like '.azl4~bootstrap.20260303' but failed for '.azl4~20260412' where there is no dot before the date. Replace the awk dot-split with grep -oE to extract the 8-digit date directly from anywhere in the dist tag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d714daf commit 5143c59

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

base/comps/azurelinux-repos/azurelinux-repos.spec

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: Azure Linux package repositories
55
Name: azurelinux-repos
66
Version: 4.0
7-
Release: 4%{?dist}
7+
Release: 5%{?dist}
88
License: MIT
99
URL: https://aka.ms/azurelinux
1010

@@ -114,10 +114,11 @@ for repo in $RPM_BUILD_ROOT/etc/yum.repos.d/azurelinux.repo; do
114114
done
115115

116116
# Update BASE_REPO_URI in azurelinux.repo; compute based on dist tag.
117-
# Extract the last dot-delimited segment from %%dist (e.g. "20260303" from ".azl4~bootstrap.20260303").
118-
# If the segment doesn't contain an 8-digit date, fall back to a hard-coded URI.
119-
date_segment=$(echo '%{dist}' | awk -F. '{print $NF}')
120-
if echo "$date_segment" | grep -qE '[0-9]{8}'; then
117+
# Extract an 8-digit date stamp from %%dist.
118+
# Handles both dotted forms (e.g. ".azl4~bootstrap.20260303") and tilde-only forms (e.g. ".azl4~20260412").
119+
# If no 8-digit date is found, fall back to a hard-coded URI.
120+
date_segment=$(echo '%{dist}' | grep -oE '[0-9]{8}')
121+
if [ -n "$date_segment" ]; then
121122
base_repo_uri="https://stcontroltowerdevjwisitg.blob.core.windows.net/daily-repo-dev/${date_segment}"
122123
else
123124
base_repo_uri='https://packages.microsoft.com/azurelinux/$releasever/prod/base'
@@ -258,6 +259,9 @@ rm -f "$TMPRING"
258259

259260

260261
%changelog
262+
* Mon Apr 13 2026 Reuben Olinsky <reubeno@microsoft.com> - 4.0-5
263+
- Fix dist tag date extraction to handle tilde-only forms (e.g. ".azl4~20260412").
264+
261265
* Wed Mar 25 2026 Sam Meluch <sammeluch@microsoft.com> - 4.0-4
262266
- Update .repo files for daily repo publishing to dev blob storage.
263267

0 commit comments

Comments
 (0)