瀏覽代碼

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

master
belliash 7 年之前
父節點
當前提交
db4f141f24
共有 1 個文件被更改,包括 34 次插入0 次删除
  1. 34
    0
      libraries/repositories

+ 34
- 0
libraries/repositories 查看文件

@@ -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)
#-------------------------------------------------------------------------------

Loading…
取消
儲存