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

Test #1 for checking that the modified script is purely running or not. #6811

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from all 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
23 changes: 9 additions & 14 deletions tools/repository/repo
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

# Drop unsupported releases
drop_unsupported_releases() {
Expand Down Expand Up @@ -44,9 +45,8 @@ for f in "${4}${2}"/*.deb; do
version=$(echo "${package}" | awk /Version/'{print $2}')
arch=$(echo "${package}" | awk /Architecture/'{print $2}')
# add if not already there
aptly repo search -architectures="${arch}" -config="${CONFIG}" "${1}" \
'Name (% '${name}'), $Version (='${version}'), $Architecture (='${arch}')' &> /dev/null
if [[ $? -ne 0 ]]; then
if aptly repo search -architectures="${arch}" -config="${CONFIG}" "${1}" \
'Name (% '${name}'), $Version (='${version}'), $Architecture (='${arch}')' &> /dev/null; then
echo -e "Checking and adding \x1B[92m$name\x1B[0m to repository \x1B[92m$release $3\x1B[0m"
aptly repo add -config="${CONFIG}" "${1}" "${f}" &> /dev/null
fi
Expand Down Expand Up @@ -160,16 +160,15 @@ for release in "${distributions[@]}"; do
sudo date +%s > ${2}/public/control
# publish
echo "Publishing: ${release}"
aptly publish \
if aptly publish \
-acquire-by-hash \
-architectures="armhf,arm64,amd64,riscv64,i386,all" \
-passphrase="${4}" \
-origin="Armbian" \
-label="Armbian" \
-config="${CONFIG}" \
-component="${COMPONENTS// /,}" \
-distribution="${release}" repo "${release}" ${COMPONENTS//main/} > /dev/null
if [[ $? -ne 0 ]]; then
-distribution="${release}" repo "${release}" ${COMPONENTS//main/} > /dev/null; then
echo "Publishing failed ${release}"
errors=$((errors + 1))
exit 0
Expand Down Expand Up @@ -277,11 +276,8 @@ case $3 in
LIST=("${new_list[@]}")
LIST_LENGTH=$((${#LIST[@]} / 2))
exec 3>&1
TARGET_VERSION=$(dialog --cancel-label "Cancel" --backtitle "BACKTITLE" --no-collapse --title \
"Remove packages from repositories" --clear --menu "Delete" $((9 + LIST_LENGTH)) 82 65 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?
exec 3>&-
if [[ $exitstatus -eq 0 ]]; then
if TARGET_VERSION=$(dialog --cancel-label "Cancel" --backtitle "BACKTITLE" --no-collapse --title \
"Remove packages from repositories" --clear --menu "Delete" $((9 + LIST_LENGTH)) 82 65 "${LIST[@]}" 2>&1 1>&3); then
for release in "${DISTROS[@]}"; do
aptly repo remove -config="${CONFIG}" "${release}" "$TARGET_VERSION"
aptly repo remove -config="${CONFIG}" "${release}-utils" "$TARGET_VERSION"
Expand All @@ -290,6 +286,7 @@ case $3 in
else
return 1
fi
exec 3>&-
aptly db cleanup -config="${CONFIG}" > /dev/null 2>&1
# remove empty folders
find $2/public -type d -empty -print -exec rm -rf {} \;
Expand Down Expand Up @@ -399,6 +396,4 @@ sed 's|"rootDir": ".*"|"rootDir": "'$output'"|g' tools/repository/aptly.conf > "
CONFIG="${TempDir}/aptly.conf"

# main
repo-manipulate "$input" "$output" "$command" "$password" "$releases" "$list"
RETURN=$?
exit $RETURN
exit $(repo-manipulate "$input" "$output" "$command" "$password" "$releases" "$list")