reGen2 Linux Release Metatool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

local-mirror.ezmod 831B

123456789101112131415161718192021222324
  1. # Copyright 2010-2012, Asio Software Technologies
  2. # Distributed under the terms of the GNU General Public License v3
  3. EZMOD_DESCRIPTION="Synchronizes local Portage mirror"
  4. EZMOD_COMPATIBILITY="ezsync"
  5. EZMOD_AUTHOR="Rafal Kupiec"
  6. EZMOD_VERSION="1.0"
  7. ezsync_postcommit() {
  8. if [ "${LOCALMIRRORPATH}" != "" ]; then
  9. printInfo "Synchronizing local Portage mirror..."
  10. if [ "$(toUpper ${PORTAGE_BUILD[1]})" != "GIT" ]; then
  11. printWarn "Local mirror actually supports only GIT!"
  12. return 0
  13. fi
  14. if [ -d ${LOCALMIRRORPATH} ]; then
  15. cd ${LOCALMIRRORPATH}
  16. run "su ${LOCALMIRRORUSER} -s \"/bin/sh\" -c \"git fetch --all\"" || return 1
  17. else
  18. makeDirectory ${LOCALMIRRORPATH}
  19. run "su ${LOCALMIRRORUSER} -s \"/bin/sh\" -c \"git clone --mirror --bare ${PORTAGE_BUILD[2]} ${LOCALMIRRORPATH}\"" || return 1
  20. fi
  21. fi
  22. return 0
  23. }