Skip to content

Commit ff64fc5

Browse files
committed
fix(wine): resolve arch conflicts
1 parent 7413f10 commit ff64fc5

File tree

5 files changed

+95
-50
lines changed

5 files changed

+95
-50
lines changed

wine/10-stable/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,38 @@ RUN set -eux; \
6060
| sed -E 's/\(.*\)//; s/^[[:space:]]+|[[:space:]]+$//g' \
6161
| grep -E '.' \
6262
| grep -Ev '^(wine|winehq)[[:alnum:]-]*$'; } >> /tmp/wine-reqs.i386 || :; \
63-
# Pick first available alternative
64-
pick_first_available() { \
65-
line="$1"; \
63+
# Pick first available and non-conflicting alternative
64+
resolve_alt() { \
65+
line="$1"; mode="$2"; \
6666
printf '%s' "$line" \
6767
| awk 'BEGIN{RS="\\|"}{gsub(/^[[:space:]]+|[[:space:]]+$/,""); if(length) print}' \
6868
| while IFS= read -r cand; do \
69-
candver="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
70-
if [ -n "$candver" ] && [ "$candver" != "(none)" ] && [ "$candver" != "none" ]; then \
71-
printf '%s\n' "$cand"; exit 0; \
69+
# For i386-mode, prefer armhf if candidate exists AND MA:same; else try native. For amd64-mode, native only. \
70+
if [ "$mode" = "i386" ]; then \
71+
arm_cand="$(apt-cache policy "${cand}:armhf" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
72+
if [ -n "$arm_cand" ] && [ "$arm_cand" != "(none)" ] && [ "$arm_cand" != "none" ]; then \
73+
ma="$(apt-cache show "${cand}:armhf" 2>/dev/null | awk -F': ' "/^Multi-Arch:/{print \$2; exit}")"; \
74+
if [ "$ma" = "same" ]; then printf '%s:armhf\n' "$cand"; exit 0; fi; \
75+
fi; \
76+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
77+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
78+
else \
79+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
80+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
7281
fi; \
73-
done; \
82+
done; \
7483
return 1; \
7584
}; \
7685
# Resolve separate lists
7786
: >/tmp/wine-deps.amd64; \
7887
while IFS= read -r line; do \
79-
sel="$(pick_first_available "$line")" || true; \
88+
sel="$(resolve_alt "$line" amd64)" || true; \
8089
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.amd64; \
8190
done < /tmp/wine-reqs.amd64; \
8291
: >/tmp/wine-deps.armhf; \
8392
while IFS= read -r line; do \
84-
sel="$(pick_first_available "$line")" || true; \
85-
[ -n "$sel" ] && printf '%s:armhf\n' "$sel" >> /tmp/wine-deps.armhf; \
93+
sel="$(resolve_alt "$line" i386)" || true; \
94+
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.armhf; \
8695
done < /tmp/wine-reqs.i386; \
8796
# Generate final dependency list
8897
sort -u /tmp/wine-deps.amd64 /tmp/wine-deps.armhf > /tmp/wine-deps.txt; \

wine/9-stable/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,38 @@ RUN set -eux; \
6060
| sed -E 's/\(.*\)//; s/^[[:space:]]+|[[:space:]]+$//g' \
6161
| grep -E '.' \
6262
| grep -Ev '^(wine|winehq)[[:alnum:]-]*$'; } >> /tmp/wine-reqs.i386 || :; \
63-
# Pick first available alternative
64-
pick_first_available() { \
65-
line="$1"; \
63+
# Pick first available and non-conflicting alternative
64+
resolve_alt() { \
65+
line="$1"; mode="$2"; \
6666
printf '%s' "$line" \
6767
| awk 'BEGIN{RS="\\|"}{gsub(/^[[:space:]]+|[[:space:]]+$/,""); if(length) print}' \
6868
| while IFS= read -r cand; do \
69-
candver="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
70-
if [ -n "$candver" ] && [ "$candver" != "(none)" ] && [ "$candver" != "none" ]; then \
71-
printf '%s\n' "$cand"; exit 0; \
69+
# For i386-mode, prefer armhf if candidate exists AND MA:same; else try native. For amd64-mode, native only. \
70+
if [ "$mode" = "i386" ]; then \
71+
arm_cand="$(apt-cache policy "${cand}:armhf" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
72+
if [ -n "$arm_cand" ] && [ "$arm_cand" != "(none)" ] && [ "$arm_cand" != "none" ]; then \
73+
ma="$(apt-cache show "${cand}:armhf" 2>/dev/null | awk -F': ' "/^Multi-Arch:/{print \$2; exit}")"; \
74+
if [ "$ma" = "same" ]; then printf '%s:armhf\n' "$cand"; exit 0; fi; \
75+
fi; \
76+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
77+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
78+
else \
79+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
80+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
7281
fi; \
73-
done; \
82+
done; \
7483
return 1; \
7584
}; \
7685
# Resolve separate lists
7786
: >/tmp/wine-deps.amd64; \
7887
while IFS= read -r line; do \
79-
sel="$(pick_first_available "$line")" || true; \
88+
sel="$(resolve_alt "$line" amd64)" || true; \
8089
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.amd64; \
8190
done < /tmp/wine-reqs.amd64; \
8291
: >/tmp/wine-deps.armhf; \
8392
while IFS= read -r line; do \
84-
sel="$(pick_first_available "$line")" || true; \
85-
[ -n "$sel" ] && printf '%s:armhf\n' "$sel" >> /tmp/wine-deps.armhf; \
93+
sel="$(resolve_alt "$line" i386)" || true; \
94+
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.armhf; \
8695
done < /tmp/wine-reqs.i386; \
8796
# Generate final dependency list
8897
sort -u /tmp/wine-deps.amd64 /tmp/wine-deps.armhf > /tmp/wine-deps.txt; \

wine/devel/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,38 @@ RUN set -eux; \
5454
| sed -E 's/\(.*\)//; s/^[[:space:]]+|[[:space:]]+$//g' \
5555
| grep -E '.' \
5656
| grep -Ev '^(wine|winehq)[[:alnum:]-]*$'; } >> /tmp/wine-reqs.i386 || :; \
57-
# Pick first available alternative
58-
pick_first_available() { \
59-
line="$1"; \
57+
# Pick first available and non-conflicting alternative
58+
resolve_alt() { \
59+
line="$1"; mode="$2"; \
6060
printf '%s' "$line" \
6161
| awk 'BEGIN{RS="\\|"}{gsub(/^[[:space:]]+|[[:space:]]+$/,""); if(length) print}' \
6262
| while IFS= read -r cand; do \
63-
candver="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
64-
if [ -n "$candver" ] && [ "$candver" != "(none)" ] && [ "$candver" != "none" ]; then \
65-
printf '%s\n' "$cand"; exit 0; \
63+
# For i386-mode, prefer armhf if candidate exists AND MA:same; else try native. For amd64-mode, native only. \
64+
if [ "$mode" = "i386" ]; then \
65+
arm_cand="$(apt-cache policy "${cand}:armhf" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
66+
if [ -n "$arm_cand" ] && [ "$arm_cand" != "(none)" ] && [ "$arm_cand" != "none" ]; then \
67+
ma="$(apt-cache show "${cand}:armhf" 2>/dev/null | awk -F': ' "/^Multi-Arch:/{print \$2; exit}")"; \
68+
if [ "$ma" = "same" ]; then printf '%s:armhf\n' "$cand"; exit 0; fi; \
69+
fi; \
70+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
71+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
72+
else \
73+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
74+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
6675
fi; \
67-
done; \
76+
done; \
6877
return 1; \
6978
}; \
7079
# Resolve separate lists
7180
: >/tmp/wine-deps.amd64; \
7281
while IFS= read -r line; do \
73-
sel="$(pick_first_available "$line")" || true; \
82+
sel="$(resolve_alt "$line" amd64)" || true; \
7483
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.amd64; \
7584
done < /tmp/wine-reqs.amd64; \
7685
: >/tmp/wine-deps.armhf; \
7786
while IFS= read -r line; do \
78-
sel="$(pick_first_available "$line")" || true; \
79-
[ -n "$sel" ] && printf '%s:armhf\n' "$sel" >> /tmp/wine-deps.armhf; \
87+
sel="$(resolve_alt "$line" i386)" || true; \
88+
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.armhf; \
8089
done < /tmp/wine-reqs.i386; \
8190
# Generate final dependency list
8291
sort -u /tmp/wine-deps.amd64 /tmp/wine-deps.armhf > /tmp/wine-deps.txt; \

wine/stable/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,38 @@ RUN set -eux; \
5454
| sed -E 's/\(.*\)//; s/^[[:space:]]+|[[:space:]]+$//g' \
5555
| grep -E '.' \
5656
| grep -Ev '^(wine|winehq)[[:alnum:]-]*$'; } >> /tmp/wine-reqs.i386 || :; \
57-
# Pick first available alternative
58-
pick_first_available() { \
59-
line="$1"; \
57+
# Pick first available and non-conflicting alternative
58+
resolve_alt() { \
59+
line="$1"; mode="$2"; \
6060
printf '%s' "$line" \
6161
| awk 'BEGIN{RS="\\|"}{gsub(/^[[:space:]]+|[[:space:]]+$/,""); if(length) print}' \
6262
| while IFS= read -r cand; do \
63-
candver="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
64-
if [ -n "$candver" ] && [ "$candver" != "(none)" ] && [ "$candver" != "none" ]; then \
65-
printf '%s\n' "$cand"; exit 0; \
63+
# For i386-mode, prefer armhf if candidate exists AND MA:same; else try native. For amd64-mode, native only. \
64+
if [ "$mode" = "i386" ]; then \
65+
arm_cand="$(apt-cache policy "${cand}:armhf" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
66+
if [ -n "$arm_cand" ] && [ "$arm_cand" != "(none)" ] && [ "$arm_cand" != "none" ]; then \
67+
ma="$(apt-cache show "${cand}:armhf" 2>/dev/null | awk -F': ' "/^Multi-Arch:/{print \$2; exit}")"; \
68+
if [ "$ma" = "same" ]; then printf '%s:armhf\n' "$cand"; exit 0; fi; \
69+
fi; \
70+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
71+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
72+
else \
73+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
74+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
6675
fi; \
67-
done; \
76+
done; \
6877
return 1; \
6978
}; \
7079
# Resolve separate lists
7180
: >/tmp/wine-deps.amd64; \
7281
while IFS= read -r line; do \
73-
sel="$(pick_first_available "$line")" || true; \
82+
sel="$(resolve_alt "$line" amd64)" || true; \
7483
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.amd64; \
7584
done < /tmp/wine-reqs.amd64; \
7685
: >/tmp/wine-deps.armhf; \
7786
while IFS= read -r line; do \
78-
sel="$(pick_first_available "$line")" || true; \
79-
[ -n "$sel" ] && printf '%s:armhf\n' "$sel" >> /tmp/wine-deps.armhf; \
87+
sel="$(resolve_alt "$line" i386)" || true; \
88+
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.armhf; \
8089
done < /tmp/wine-reqs.i386; \
8190
# Generate final dependency list
8291
sort -u /tmp/wine-deps.amd64 /tmp/wine-deps.armhf > /tmp/wine-deps.txt; \

wine/staging/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,38 @@ RUN set -eux; \
5454
| sed -E 's/\(.*\)//; s/^[[:space:]]+|[[:space:]]+$//g' \
5555
| grep -E '.' \
5656
| grep -Ev '^(wine|winehq)[[:alnum:]-]*$'; } >> /tmp/wine-reqs.i386 || :; \
57-
# Pick first available alternative
58-
pick_first_available() { \
59-
line="$1"; \
57+
# Pick first available and non-conflicting alternative
58+
resolve_alt() { \
59+
line="$1"; mode="$2"; \
6060
printf '%s' "$line" \
6161
| awk 'BEGIN{RS="\\|"}{gsub(/^[[:space:]]+|[[:space:]]+$/,""); if(length) print}' \
6262
| while IFS= read -r cand; do \
63-
candver="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
64-
if [ -n "$candver" ] && [ "$candver" != "(none)" ] && [ "$candver" != "none" ]; then \
65-
printf '%s\n' "$cand"; exit 0; \
63+
# For i386-mode, prefer armhf if candidate exists AND MA:same; else try native. For amd64-mode, native only. \
64+
if [ "$mode" = "i386" ]; then \
65+
arm_cand="$(apt-cache policy "${cand}:armhf" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
66+
if [ -n "$arm_cand" ] && [ "$arm_cand" != "(none)" ] && [ "$arm_cand" != "none" ]; then \
67+
ma="$(apt-cache show "${cand}:armhf" 2>/dev/null | awk -F': ' "/^Multi-Arch:/{print \$2; exit}")"; \
68+
if [ "$ma" = "same" ]; then printf '%s:armhf\n' "$cand"; exit 0; fi; \
69+
fi; \
70+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
71+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
72+
else \
73+
nat_cand="$(apt-cache policy "$cand" 2>/dev/null | awk "/Candidate:/ {print \$2}")"; \
74+
if [ -n "$nat_cand" ] && [ "$nat_cand" != "(none)" ] && [ "$nat_cand" != "none" ]; then printf '%s\n' "$cand"; exit 0; fi; \
6675
fi; \
67-
done; \
76+
done; \
6877
return 1; \
6978
}; \
7079
# Resolve separate lists
7180
: >/tmp/wine-deps.amd64; \
7281
while IFS= read -r line; do \
73-
sel="$(pick_first_available "$line")" || true; \
82+
sel="$(resolve_alt "$line" amd64)" || true; \
7483
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.amd64; \
7584
done < /tmp/wine-reqs.amd64; \
7685
: >/tmp/wine-deps.armhf; \
7786
while IFS= read -r line; do \
78-
sel="$(pick_first_available "$line")" || true; \
79-
[ -n "$sel" ] && printf '%s:armhf\n' "$sel" >> /tmp/wine-deps.armhf; \
87+
sel="$(resolve_alt "$line" i386)" || true; \
88+
[ -n "$sel" ] && printf '%s\n' "$sel" >> /tmp/wine-deps.armhf; \
8089
done < /tmp/wine-reqs.i386; \
8190
# Generate final dependency list
8291
sort -u /tmp/wine-deps.amd64 /tmp/wine-deps.armhf > /tmp/wine-deps.txt; \

0 commit comments

Comments
 (0)