Skip to content

Commit

Permalink
Merge pull request #5653 from AenBleidd/vko_fix_rpmrepo_script
Browse files Browse the repository at this point in the history
[ci] fix more issues with the debrepo and rpmrepo
  • Loading branch information
AenBleidd authored Jun 12, 2024
2 parents 47b739f + 18404b8 commit 6153039
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/debrepo/repo_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,26 @@ fi

if [[ "$TYPE" == "stable" ]]; then
# get only one latest packages of each type from the alpha repo
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)
declare -A split_lists
packets_list=()
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)
declare -A alpha_split_lists
alpha_packets_list=()
while IFS= read -r line; do
packets_list+=("$line")
done <<< "$packets"
for item in "${packets_list[@]}"; do
alpha_packets_list+=("$line")
done <<< "$alpha_packets"
for item in "${alpha_packets_list[@]}"; do
prefix="${item%%_*}" # Extract the prefix (text before the first underscore)
split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
alpha_split_lists["$prefix"]+="$item"$'\n' # Append the item to the corresponding prefix's list
done
for prefix in "${!split_lists[@]}"; do
for prefix in "${!alpha_split_lists[@]}"; do
echo "List for prefix: $prefix"
echo "${split_lists[$prefix]}"
values_list=()
echo "${alpha_split_lists[$prefix]}"
alpha_values_list=()
while IFS= read -r line; do
values_list+=("$line")
done <<< "${split_lists[$prefix]}"
for value in "${values_list[@]}"; do
alpha_values_list+=("$line")
done <<< "${alpha_split_lists[$prefix]}"
for value in "${alpha_values_list[@]}"; do
# copy the latest package to the local repo
echo "Adding: $value"
aptly -config=$CONF_FILE repo import boinc-alpha-mirror boinc-$TYPE $value
break
done
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/rpmrepo/repo_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,25 +169,26 @@ max_parallel_downloads = 2

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

for prefix in "${!split_lists[@]}"; do
for prefix in "${!alpha_split_lists[@]}"; do
echo "List for prefix: $prefix"
echo "${split_lists[$prefix]}"
echo "${alpha_split_lists[$prefix]}"
values_list=()
while IFS= read -r line; do
values_list+=("$line")
done <<< "${split_lists[$prefix]}"
done <<< "${alpha_split_lists[$prefix]}"
for value in "${values_list[@]}"; do
echo "Copy: $value"
cp $value $CWD/mirror/
exit_on_fail "Failed to copy the package $value"
break
Expand Down

0 comments on commit 6153039

Please sign in to comment.