Add local-mirror module

Este commit está contenido en:
belliash 2012-01-17 11:29:03 +01:00
padre 564e8e98d2
commit b132748288
Se han modificado 2 ficheros con 31 adiciones y 0 borrados

Ver fichero

@ -0,0 +1,7 @@
# This specifies the local repository with the base path. This is the directory, where
# Portage mirror will be saved. Don't forget to uncomment this option!
#LOCALMIRROR_PATH="/path/to/portage-mirror.git"
# Directive sets a username, that will be used to pull changes from remote repository.
# This is useful when the local daemon is running with different permissions.
LOCALMIRROR_USER="root"

24
modules/local-mirror.ezmod Archivo normal
Ver fichero

@ -0,0 +1,24 @@
# Copyright 2010-2012, Asio Software Technologies
# Distributed under the terms of the GNU General Public License v3
EZMOD_DESCRIPTION="Synchronizes local Portage mirror"
EZMOD_COMPATIBILITY="ezsync"
EZMOD_AUTHOR="Rafal Kupiec"
EZMOD_VERSION="1.0"
ezsync_postcommit() {
if [ "${LOCALMIRROR_PATH}" != "" ]; then
printInfo "Synchronizing local Portage mirror..."
if [ "$(toUpper ${PORTAGE_BUILD[1]})" != "GIT" ]; then
printWarn "Local mirror actually supports only GIT!"
return 1
fi
if [ -d ${LOCALMIRROR_PATH} ]; then
cd ${LOCALMIRROR_PATH}
run "su ${LOCALMIRROR_USER} -s \"/bin/sh\" -c \"git fetch --all\"" || return 1
else
makeDirectory ${LOCALMIRROR_PATH}
run "su ${LOCALMIRROR_USER} -s \"/bin/sh\" -c \"git clone --mirror --bare ${PORTAGE_BUILD[2]} ${LOCALMIRROR_PATH}\"" || return 1
fi
fi
return 0
}