镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-07 06:56:47 +00:00
add apt-download helper, updated gitlab-ce mirror script
这个提交包含在:
@@ -1,14 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
_here=`dirname $(realpath $0)`
|
||||
. ${_here}/helpers/apt-download
|
||||
|
||||
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
|
||||
|
||||
BASE_PATH="${TUNASYNC_WORKING_DIR}"
|
||||
|
||||
|
||||
APT_PATH="${BASE_PATH}/apt"
|
||||
YUM_PATH="${BASE_PATH}/yum"
|
||||
|
||||
UBUNTU_VERSIONS=("trusty" "wily")
|
||||
DEBIAN_VERSIONS=("wheezy" "jessie" "stretch")
|
||||
UBUNTU_PATH="${BASE_PATH}/ubuntu/"
|
||||
DEBIAN_PATH="${BASE_PATH}/debian/"
|
||||
|
||||
mkdir -p $UBUNTU_PATH $DEBIAN_PATH $YUM_PATH
|
||||
|
||||
@@ -35,44 +40,23 @@ sslverify=0
|
||||
EOF
|
||||
|
||||
reposync -c $cfg -d -p ${YUM_PATH}
|
||||
createrepo -o ${YUM_PATH}/el6 ${YUM_PATH}/el6
|
||||
createrepo -o ${YUM_PATH}/el7 ${YUM_PATH}/el7
|
||||
createrepo --update -o ${YUM_PATH}/el6 ${YUM_PATH}/el6
|
||||
createrepo --update -o ${YUM_PATH}/el7 ${YUM_PATH}/el7
|
||||
rm $cfg
|
||||
|
||||
|
||||
cfg="/tmp/gitlab-ce-ubuntu.list"
|
||||
cat << EOF > ${cfg}
|
||||
set mirror_path ${APT_PATH}
|
||||
set nthreds 5
|
||||
set _tilde 0
|
||||
|
||||
EOF
|
||||
base_url="https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu"
|
||||
for version in ${UBUNTU_VERSIONS[@]}; do
|
||||
echo "deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
|
||||
echo "deb-i386 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
|
||||
echo "deb-amd64 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
|
||||
echo "deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
|
||||
apt-download-binary ${base_url} "$version" "main" "amd64" "${UBUNTU_PATH}"
|
||||
apt-download-binary ${base_url} "$version" "main" "i386" "${UBUNTU_PATH}"
|
||||
done
|
||||
echo "Ubuntu finished"
|
||||
|
||||
apt-mirror $cfg
|
||||
rm $cfg
|
||||
|
||||
|
||||
cfg="/tmp/gitlab-ce-debian.list"
|
||||
cat << EOF > ${cfg}
|
||||
set mirror_path ${APT_PATH}
|
||||
set nthreds 5
|
||||
set _tilde 0
|
||||
|
||||
EOF
|
||||
base_url="https://packages.gitlab.com/gitlab/gitlab-ce/debian"
|
||||
for version in ${DEBIAN_VERSIONS[@]}; do
|
||||
echo "deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
|
||||
echo "deb-i386 https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
|
||||
echo "deb-amd64 https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
|
||||
echo "deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
|
||||
apt-download-binary ${base_url} "$version" "main" "amd64" "${DEBIAN_PATH}"
|
||||
apt-download-binary ${base_url} "$version" "main" "i386" "${DEBIAN_PATH}"
|
||||
done
|
||||
echo "Debian finished"
|
||||
|
||||
apt-mirror $cfg
|
||||
rm $cfg
|
||||
|
||||
# vim: ts=4 sts=4 sw=4
|
||||
|
||||
在新工单中引用
屏蔽一个用户