Przeglądaj źródła

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 lat temu
rodzic
commit
db4f141f24
1 zmienionych plików z 34 dodań i 0 usunięć
  1. 34
    0
      libraries/repositories

+ 34
- 0
libraries/repositories Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz