Skip to content

Commit

Permalink
Retire old erlang script, replace with new one
Browse files Browse the repository at this point in the history
Signed-off-by: Shengqi Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Apr 7, 2024
1 parent 3bd346b commit e590153
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 53 deletions.
47 changes: 0 additions & 47 deletions erlang-new.sh

This file was deleted.

34 changes: 28 additions & 6 deletions erlang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,43 @@ apt_sync="${_here}/apt-sync.py"
yum_sync="${_here}/yum-sync.py"

BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL="https://packages.erlang-solutions.com"
BASE_URL="${TUNASYNC_UPSTREAM_URL}"

YUM_PATH="${BASE_PATH}/centos"
CENTOS_PATH="${BASE_PATH}/centos"
UBUNTU_PATH="${BASE_PATH}/ubuntu"
DEBIAN_PATH="${BASE_PATH}/debian"
export REPO_SIZE_FILE=/tmp/reposize.$RANDOM

# generate codenames for repos
ubuntu_os=(bionic focal jammy)
debian_os=(bullseye buster)
deb_suffixes=(
mongooseim-5
mongooseim-6
esl-erlang-24
esl-erlang-25
esl-erlang-26
elixir-1.12
elixir-1.13
elixir-1.14
elixir-1.15
)

function join_by { local IFS="$1"; shift; echo "$*"; }
ubuntu_codenames=$(join_by ',' $(IFS=','; eval echo {"${ubuntu_os[*]}"}-{"${deb_suffixes[*]}"}))
debian_codenames=$(join_by ',' $(IFS=','; eval echo {"${debian_os[*]}"}-{"${deb_suffixes[*]}"}))

# =================== APT repos ===============================
"$apt_sync" --delete "${BASE_URL}/ubuntu" @ubuntu-lts contrib amd64,i386 "$UBUNTU_PATH"

"$apt_sync" --delete "${BASE_URL}/ubuntu" "$ubuntu_codenames" contrib amd64,arm64 "$UBUNTU_PATH"
echo "Ubuntu finished"
"$apt_sync" --delete "${BASE_URL}/debian" @debian-current contrib amd64,i386 "$DEBIAN_PATH"
"$apt_sync" --delete "${BASE_URL}/debian" "$debian_codenames" contrib amd64,arm64 "$DEBIAN_PATH"
echo "Debian finished"

# =================== YUM repos ===============================
"$yum_sync" "${BASE_URL}/rpm/centos/@{os_ver}/@{arch}" 7 erlang x86_64 "@{os_ver}" "$YUM_PATH"
echo "YUM finished"
## DISABLED due to invalid repo structure

# "$yum_sync" "${BASE_URL}/centos/@{os_ver}/@{arch}" 7 erlang x86_64 "@{os_ver}" "$CENTOS_PATH"
# echo "CentOS finished"

"${_here}/helpers/size-sum.sh" $REPO_SIZE_FILE --rm
27 changes: 27 additions & 0 deletions retired/erlang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e
set -o pipefail

_here=`dirname $(realpath $0)`
apt_sync="${_here}/apt-sync.py"
yum_sync="${_here}/yum-sync.py"

BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL="https://packages.erlang-solutions.com"

YUM_PATH="${BASE_PATH}/centos"
UBUNTU_PATH="${BASE_PATH}/ubuntu"
DEBIAN_PATH="${BASE_PATH}/debian"
export REPO_SIZE_FILE=/tmp/reposize.$RANDOM

# =================== APT repos ===============================
"$apt_sync" --delete "${BASE_URL}/ubuntu" @ubuntu-lts contrib amd64,i386 "$UBUNTU_PATH"
echo "Ubuntu finished"
"$apt_sync" --delete "${BASE_URL}/debian" @debian-current contrib amd64,i386 "$DEBIAN_PATH"
echo "Debian finished"

# =================== YUM repos ===============================
"$yum_sync" "${BASE_URL}/rpm/centos/@{os_ver}/@{arch}" 7 erlang x86_64 "@{os_ver}" "$YUM_PATH"
echo "YUM finished"

"${_here}/helpers/size-sum.sh" $REPO_SIZE_FILE --rm

0 comments on commit e590153

Please sign in to comment.