Skip to content

Commit

Permalink
debs/
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Aug 20, 2024
1 parent 15b187d commit 663df32
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions debs/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ APTLY=("$APTLY_BIN" -config="${APTLY_CONF}")

DEBS_ROOT="${DEBS_ROOT:-${DEBS_ROOT_DEFAULT}}"

REPOS=(focal jammy bullseye bookworm)
declare -A REPO_PACKAGES


publish_dir () {
"${APTLY[@]}" config show \
| jq -r '.FileSystemPublishEndpoints.public.rootDir'
}

REPOS=(focal jammy bullseye bookworm)
declare -A REPO_PACKAGES

create_dirs () {
PUBLIC_DIR="$(publish_dir)"
mkdir -p "${PUBLIC_DIR}"
Expand All @@ -41,16 +42,11 @@ create_repos () {

list_packages () {
local imported=()

for repo in "${REPOS[@]}"; do
serialized_values=$("${APTLY[@]}" repo search "$repo" || echo "" | tr '\n' ' ')
IFS=' ' read -r -a array <<< "$serialized_values"
for element in "${array[@]}"; do
filename="${element}.${key}.changes"
imported+=("$filename")
"${APTLY[@]}" repo search "$repo" 2>/dev/null | while IFS= read -r package; do
echo "${package}.${repo}.changes"
done
done
printf "%s\n" "${imported[@]}"
}

include_debs () {
Expand All @@ -59,7 +55,7 @@ include_debs () {

for file in "${changes_files[@]}"; do
filename=$(basename $file)
if echo $imported | tr ' ' '\n' | grep -q "^${filename}$"; then
if echo $imported | grep -q "^${filename}$"; then
continue
fi
"${APTLY[@]}" -no-remove-files repo include $file
Expand Down

0 comments on commit 663df32

Please sign in to comment.