From 52d23375e18bd2a1354bc374ed6308f0ecd252d7 Mon Sep 17 00:00:00 2001 From: z4yx Date: Sun, 5 Apr 2020 13:28:20 +0800 Subject: [PATCH] fix scripts --- mysql.sh | 6 +++--- percona.sh | 47 ----------------------------------------------- 2 files changed, 3 insertions(+), 50 deletions(-) delete mode 100755 percona.sh diff --git a/mysql.sh b/mysql.sh index e6b708b..dafc3f5 100755 --- a/mysql.sh +++ b/mysql.sh @@ -4,7 +4,7 @@ set -e set -o pipefail _here=`dirname $(realpath $0)` -alias apt-sync="${_here}/apt-sync.py" +apt_sync="${_here}/apt-sync.py" BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_URL="${TUNASYNC_UPSTREAM_URL:-"https://repo.mysql.com"}" @@ -26,9 +26,9 @@ mkdir -p ${YUM_PATH} ${UBUNTU_PATH} ${DEBIAN_PATH} # =================== APT repos =============================== MYSQL_APT_REPOS="mysql-5.6,mysql-5.7,mysql-tools,connector-python-2.1,mysql-8.0" -apt-sync "${BASE_URL}/apt/ubuntu" @ubuntu-lts $MYSQL_APT_REPOS amd64,i386 "${UBUNTU_PATH}" +"$apt_sync" "${BASE_URL}/apt/ubuntu" @ubuntu-lts $MYSQL_APT_REPOS amd64,i386 "${UBUNTU_PATH}" echo "Ubuntu finished" -apt-sync "${BASE_URL}/apt/debian" @debian-current $MYSQL_APT_REPOS amd64,i386 "${DEBIAN_PATH}" +"$apt_sync" "${BASE_URL}/apt/debian" @debian-current $MYSQL_APT_REPOS amd64,i386 "${DEBIAN_PATH}" echo "Debian finished" # =================== YUM/DNF repos ========================== diff --git a/percona.sh b/percona.sh deleted file mode 100755 index f456d14..0000000 --- a/percona.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# requires: createrepo reposync wget curl -set -e -set -o pipefail - -_here=`dirname $(realpath $0)` -alias apt-sync="${_here}/apt-sync.py" - -BASE_PATH="${TUNASYNC_WORKING_DIR}" -BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://repo.percona.com"} - -YUM_PATH="${BASE_PATH}/yum" -APT_PATH="${BASE_PATH}/apt" - -EL_VERSIONS=("6" "7") - -# =================== APT repos =============================== -apt-sync "${BASE_URL}/apt" @debian-current,@ubuntu-lts main amd64,i386 "${APT_PATH}" -echo "APT finished" - -# =================== YUM/DNF repos ========================== -mkdir -p ${YUM_PATH} - -cache_dir="/tmp/yum-percona-cache/" -cfg="/tmp/yum-percona.conf" -cat < ${cfg} -[main] -keepcache=0 - -EOF - -for elver in ${EL_VERSIONS[@]}; do -cat << EOF >> $cfg -[el${elver}] -name=el${elver} -baseurl=${BASE_URL}/centos/$elver/os/x86_64/ -enabled=1 -EOF -done - -if [[ -z ${DRY_RUN:-} ]]; then - reposync -c $cfg -d -p ${YUM_PATH} -e $cache_dir - for elver in ${EL_VERSIONS[@]}; do - createrepo --update -v -c $cache_dir -o ${YUM_PATH}/el${elver}/ ${YUM_PATH}/el${elver}/ - done -fi -rm $cfg