Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(srcinfo.sh): fix AARCH + CARCH replace #6239

Merged
merged 3 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/hakuneko-deb/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ pkgbase = hakuneko-deb
arch = armhf
arch = i386
maintainer = Diegiwg <[email protected]>
source_amd64 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_CARCH_REPLACE.deb
source_amd64 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_amd64.deb
sha256sums_amd64 = 48e9a77015695fe69390ac99b54184cf793f31c3452d174fcf41052ccb2ae211
source_arm64 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_CARCH_REPLACE.deb
source_arm64 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_arm64.deb
sha256sums_arm64 = 5e4b992b58a67ddac96410975e10577befe67479c1c2b3d12b2bcbaf6f6c003a
source_armhf = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_CARCH_REPLACE.deb
source_armhf = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_armhf.deb
sha256sums_armhf = 4dabbfa9d775da72499f594bfdda86adc62a5caaa579c73b9d4ccf5d778c903d
source_i386 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_CARCH_REPLACE.deb
source_i386 = https://github.com/manga-download/hakuneko/releases/download/nightly-20200705.1/hakuneko-desktop_8.3.4_linux_i386.deb
sha256sums_i386 = 3608ff4e8a3257fffedfa2dcea6501cb6d0d203235a2e4c6e6bbf01b93dce240

pkgname = hakuneko-deb
2 changes: 1 addition & 1 deletion packages/lsd-deb/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pkgbase = lsd-deb
sha256sums_amd64 = 488b098e9cc4bb193c10d3a9abe8b06282099ee73a3e9f7f1febd19a9d9b89f0
source_arm64 = https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd_1.0.0_arm64.deb
sha256sums_arm64 = 4a0e6931823869b401a7ef3dae26e3c027aaee3c42bd62129ee2c6a93489412d
source_i386 = https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd_1.0.0_i386.deb
source_i386 = https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd_1.0.0_i686.deb
sha256sums_i386 = 3a9d7193f90cce0884edb6f1c2230ec5cf942fd122e75691fc32cf3e8f728dcb

pkgname = lsd-deb
22 changes: 16 additions & 6 deletions scripts/srcinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@

function srcinfo.write_global() {
unset "${allvars[@]}" "${allars[@]}"
local CARCH='CARCH_REPLACE' DISTRO='DISTROBASE:DISTROVER' CDISTRO='CDISTROBASE:CDISTROVER' AARCH='AARCH_REPLACE' var ar aars bar ars rar rep seek
local CARCH='CARCH_REPLACE' DISTRO='DISTROBASE:DISTROVER' CDISTRO='CDISTROBASE:CDISTROVER' AARCH='AARCH_REPLACE' var ar aars bar ars rar rep seek multilist
local -A AARCHS_MAP=(
["amd64"]="x86_64"
["arm64"]="aarch64"
Expand All @@ -178,9 +178,14 @@
)
# shellcheck disable=SC1090
source "${1}"
for ar in "${allars[@]}"; do
[[ ${ar} != "arch" ]] \
&& local -n bar="${ar}"
multilist=("${multivalued_arch_attrs[@]}")
for i in "${multivalued_arch_attrs[@]}"; do
for j in {amd64,x86_64,arm64,aarch64,armel,arm,armhf,armv7h,i386,i686,mips64el,ppc64el,riscv64,s390x}; do
multilist+=("${i}_${j}")
done
done
for ar in "${multilist[@]}"; do
local -n bar="${ar}"
if [[ -n ${bar[*]} ]]; then
for ars in "${bar[@]}"; do
ars="${ars//+([[:space:]])/ }"
Expand All @@ -204,16 +209,21 @@
rep="${aars}"
fi
fi
local -n fin="${ar}_${rep}"
# shellcheck disable=SC2076
if [[ " ${AARCHS_MAP[*]} " =~ " ${ar##*_} " || " ${!AARCHS_MAP[*]} " =~ " ${ar##*_} " || ${ar} == *"x86_64" ]]; then
: "${ar}=${ars}"
[[ ${ar} != *"${aars}" ]] && continue
else
: "${ar}_${aars}=${ars}"
fi
eval "${_//${seek}/${rep}}"
if [[ -z ${fin[*]} ]]; then
eval "${_//${seek}/${rep}}"
fi
done
unset "${ar}"
if [[ " ${multivalued_arch_attrs[*]} " =~ " ${ar} " ]]; then
Dismissed Show dismissed Hide dismissed
unset "${ar}"
fi
fi
done
fi
Expand Down
Loading