implement 2 function that allows to fetch Portage tree from either git or rsync; downloaded tree is ready for further use and for distribution as a tarball

这个提交包含在:
belliash 2012-01-30 15:39:18 +01:00
父节点 32bcb4866b
当前提交 db4f141f24
共有 1 个文件被更改,包括 34 次插入0 次删除

查看文件

@ -76,6 +76,40 @@ function mirrorRsync() {
return ${?}
}
#-------------------------------------------------------------------------------
# Downloads Portage tree ready for use at production using GIT protocol
# Parameters: %dest_directory% %address%
#-------------------------------------------------------------------------------
function originGitPortage() {
local DST="${1}"
local SRC="${2}"
if [ -e ${DST} ]; then
return 1
fi
run "git clone --depth 1 ${SRC} ${DST}" || return 1
cd ${DST}
run "git config core.compression 0" || return 1
run "git gc --aggressive" || return 1
return 0
}
#-------------------------------------------------------------------------------
# Downloads Portage tree ready for use at production using RSYNC protocol
# Parameters: %dest_directory% %address%
#-------------------------------------------------------------------------------
function originRsyncPortage() {
local DST="${1}"
local SRC="${2}"
if [ -e ${DST} ]; then
return 1
fi
run "rsync --compress --delete --delete-after --devices --force --links \
--partial --perms --recursive --safe-links --stats --times \
--timeout=${FETCHTIMEOUT} --whole-file --exclude=/distfiles \
--exclude=/local --exclude=/packages ${SRC}/ ${DST}" || return 1
return 0
}
#-------------------------------------------------------------------------------
# Prepares SSH Wrappers for use with unknown hosts (requires key authentication)
#-------------------------------------------------------------------------------