Skip to content
forked from BOINC/boinc

Commit a20afb2

Browse files
committed
Merge pull request BOINC#5653 from AenBleidd/vko_fix_rpmrepo_script
[ci] fix more issues with the debrepo and rpmrepo
1 parent f5903c1 commit a20afb2

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

.github/workflows/debrepo/repo_update.sh

+14-13
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,26 @@ fi
191191

192192
if [[ "$TYPE" == "stable" ]]; then
193193
# get only one latest packages of each type from the alpha repo
194-
packets=$(aptly -config=$CONF_FILE mirror search boinc-alpha-mirror | grep -o '[^[:space:]]*_\([[:digit:]]*\.\)\{2\}[[:digit:]]*-\([[:digit:]]*_\)[^[:space:]]*' | sort -t '_' -k 2 -V -r | uniq)
195-
declare -A split_lists
196-
packets_list=()
194+
alpha_packets=$(aptly -config=$CONF_FILE mirror search boinc-alpha-mirror | grep -o '[^[:space:]]*_\([[:digit:]]*\.\)\{2\}[[:digit:]]*-\([[:digit:]]*_\)[^[:space:]]*' | sort -t '_' -k 2 -V -r | uniq)
195+
declare -A alpha_split_lists
196+
alpha_packets_list=()
197197
while IFS= read -r line; do
198-
packets_list+=("$line")
199-
done <<< "$packets"
200-
for item in "${packets_list[@]}"; do
198+
alpha_packets_list+=("$line")
199+
done <<< "$alpha_packets"
200+
for item in "${alpha_packets_list[@]}"; do
201201
prefix="${item%%_*}" # Extract the prefix (text before the first underscore)
202-
split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
202+
alpha_split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
203203
done
204-
for prefix in "${!split_lists[@]}"; do
204+
for prefix in "${!alpha_split_lists[@]}"; do
205205
echo "List for prefix: $prefix"
206-
echo "${split_lists[$prefix]}"
207-
values_list=()
206+
echo "${alpha_split_lists[$prefix]}"
207+
alpha_values_list=()
208208
while IFS= read -r line; do
209-
values_list+=("$line")
210-
done <<< "${split_lists[$prefix]}"
211-
for value in "${values_list[@]}"; do
209+
alpha_values_list+=("$line")
210+
done <<< "${alpha_split_lists[$prefix]}"
211+
for value in "${alpha_values_list[@]}"; do
212212
# copy the latest package to the local repo
213+
echo "Adding: $value"
213214
aptly -config=$CONF_FILE repo import boinc-alpha-mirror boinc-$TYPE $value
214215
break
215216
done

.github/workflows/rpmrepo/repo_update.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -169,25 +169,26 @@ max_parallel_downloads = 2
169169

170170
# keep only 1 last version of each package
171171
cd $CWD/alpha/
172-
packets=$(find *.rpm | sort -t '-' -k 2 -V -r | uniq)
173-
declare -A split_lists
174-
packets_list=()
172+
alpha_packets=$(find *.rpm | sort -t '-' -k 2 -V -r | uniq)
173+
declare -A alpha_split_lists
174+
alpha_packets_list=()
175175
while IFS= read -r line; do
176-
packets_list+=("$line")
177-
done <<< "$packets"
178-
for item in "${packets_list[@]}"; do
176+
alpha_packets_list+=("$line")
177+
done <<< "$alpha_packets"
178+
for item in "${alpha_packets_list[@]}"; do
179179
prefix=$(echo "$item" | cut -d '-' -f 1-2 ) # Extract the prefix (text before the second dash)
180-
split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
180+
alpha_split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
181181
done
182182

183-
for prefix in "${!split_lists[@]}"; do
183+
for prefix in "${!alpha_split_lists[@]}"; do
184184
echo "List for prefix: $prefix"
185-
echo "${split_lists[$prefix]}"
185+
echo "${alpha_split_lists[$prefix]}"
186186
values_list=()
187187
while IFS= read -r line; do
188188
values_list+=("$line")
189-
done <<< "${split_lists[$prefix]}"
189+
done <<< "${alpha_split_lists[$prefix]}"
190190
for value in "${values_list[@]}"; do
191+
echo "Copy: $value"
191192
cp $value $CWD/mirror/
192193
exit_on_fail "Failed to copy the package $value"
193194
break

0 commit comments

Comments
 (0)