Skip to content

Commit bdf091e

Browse files
committed
fix: use underscore (_) for subarch marking
When using / as the subarch marker, it would prevent autobuild/$ARCH or .patch.$ARCH from working, using _ as a workaround.
1 parent b7bd7a4 commit bdf091e

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

lib/builtin.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ab_match_arch() {
4242
abinfo "Usage: ab_match_arch \"match_pattern\""
4343
abdie "Misuse of ab_match_arch()! Refuse to proceed."
4444
fi
45-
if [[ ${ABHOST%%\/*} = $1 ]]; then
45+
if [[ ${ABHOST%%_*} = $1 ]]; then
4646
abinfo "Architecture $ABHOST matches $1: taking true branch."
4747
return 0
4848
else
@@ -72,7 +72,7 @@ ab_match_archgroup() {
7272
if [[ ${_grp%%\/*} = $1 ]]; then
7373
abinfo "Member '${_grp}' in Architecture group '${ABHOST_GROUP[*]}' matches $1: taking true branch."
7474
return 0
75-
else
75+
else
7676
abdbg "Member '${_grp}' in Architecture group '${ABHOST_GROUP[*]}' mismatches $1."
7777
fi
7878
done

pm/dpkg.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ dpkgfield() {
8181
}
8282

8383
dpkgctrl() {
84-
local arch="${DPKG_ARCH%%\/*}"
84+
local arch="${DPKG_ARCH%%_*}"
8585
[[ "$arch" == noarch ]] && arch=all
8686
echo "Package: $PKGNAME"
8787
echo "Version: $(dpkgpkgver)"
@@ -135,7 +135,7 @@ dpkgctrl() {
135135
}
136136

137137
dpkgctrl_dbg() {
138-
local arch="${DPKG_ARCH%%\/*}"
138+
local arch="${DPKG_ARCH%%_*}"
139139
[[ "$arch" == noarch ]] && arch=all
140140
echo "Package: $PKGNAME-dbg"
141141
echo "Version: $(dpkgpkgver)"
@@ -165,7 +165,7 @@ pm_install_all() {
165165
}
166166

167167
pm_build_package() {
168-
local _file="${PKGNAME}_${PKGVER}-${PKGREL}${VERSTAMP:-}_${DPKG_ARCH%%\/*}.deb"
168+
local _file="${PKGNAME}_${PKGVER}-${PKGREL}${VERSTAMP:-}_${DPKG_ARCH%%_*}.deb"
169169
mkdir -p "$PKGDIR"/DEBIAN \
170170
|| abdie "Failed to create DEBIAN directory for .deb metadata: $?."
171171
cp -rl "$SRCDIR"/abscripts/* "$PKGDIR"/DEBIAN \
@@ -191,7 +191,7 @@ pm_build_package() {
191191
}
192192

193193
pm_build_debug_package() {
194-
local _file="${PKGNAME}-dbg_${PKGVER}-${PKGREL}${VERSTAMP:-}_${DPKG_ARCH%%\/*}.deb"
194+
local _file="${PKGNAME}-dbg_${PKGVER}-${PKGREL}${VERSTAMP:-}_${DPKG_ARCH%%_*}.deb"
195195
mkdir -p "$SYMDIR"/DEBIAN \
196196
|| abdie "Failed to create DEBIAN directory for -dbg .deb metadata: $?."
197197
dpkgctrl_dbg > "$SYMDIR"/DEBIAN/control \

proc/01-core-defines.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ elif [[ "$ABHOST" != 'noarch' ]]; then
5757
abdie "Cross-compilation is no longer supported."
5858
fi
5959

60-
load_strict "$AB/arch/${ABHOST//\//_}.sh"
60+
load_strict "$AB/arch/${ABHOST}.sh"
6161
load_strict "$AB"/lib/default-flags.sh
6262

6363
if ! abisdefined DPKG_ARCH ; then
@@ -84,7 +84,7 @@ if [ -n "$ALLOW_ARCH" ] && [ "${ABBUILD%%\/*}" != $ALLOW_ARCH ]; then
8484
abdie "This package can only be built on $ALLOW_ARCH, not including $ABHOST."
8585
fi
8686
# shellcheck disable=SC2053
87-
[[ ${ABHOST%%\/*} != $FAIL_ARCH ]] ||
87+
[[ ${ABHOST} != $FAIL_ARCH ]] ||
8888
abdie "This package cannot be built for $FAIL_ARCH, e.g. $ABHOST."
8989

9090
if ! bool "$ABSTRIP" && bool "$ABSPLITDBG"; then

sets/arch_groups.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"amd64",
44
"arm64",
55
"loongarch64",
6-
"loongarch64/nosimd",
6+
"loongarch64_nosimd",
77
"loongson3",
88
"ppc64el",
99
"riscv64"
@@ -27,7 +27,7 @@
2727
"amd64",
2828
"arm64",
2929
"loongarch64",
30-
"loongarch64/nosimd",
30+
"loongarch64_nosimd",
3131
"loongson3",
3232
"mips64r6el",
3333
"ppc64el",
@@ -50,7 +50,7 @@
5050
],
5151
"without_dotnet": [
5252
"loongarch64",
53-
"loongarch64/nosimd",
53+
"loongarch64_nosimd",
5454
"loongson3",
5555
"ppc64el",
5656
"riscv64",

sets/arch_targets.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"amd64": "x86_64-aosc-linux-gnu",
3-
"amd64/avx+": "x86_64-aosc-linux-gnu",
4-
"amd64/avx2+": "x86_64-aosc-linux-gnu",
53
"arm64": "aarch64-aosc-linux-gnu",
64
"armv4": "arm-aosc-linux-gnueabi",
75
"armv6hf": "arm-aosc-linux-gnueabihf",
@@ -10,7 +8,7 @@
108
"loongson2f": "mips64el-aosc-linux-gnuabi64",
119
"loongson3": "mips64el-aosc-linux-gnuabi64",
1210
"loongarch64": "loongarch64-aosc-linux-gnu",
13-
"loongarch64/nosimd": "loongarch64-aosc-linux-gnu",
11+
"loongarch64_nosimd": "loongarch64-aosc-linux-gnu",
1412
"m68k": "m68k-aosc-linux-gnu",
1513
"mips32r6el": "mipsisa32r6el-aosc-linux-gnu",
1614
"mips64r6el": "mipsisa64r6el-aosc-linux-gnuabi64",

0 commit comments

Comments
 (0)