# $Id$ # svn checkout functions # at least only SVNROOT must be exported # needed vars MY_SVN_MODULE="${PNAME}" MY_SVN_OPTS="" SVNROOT="" SDEPEND="${SDEPEND} >= dev-util/subversion-1" svn_fetch_source() { [[ -z ${SVNROOT} ]] && die "no SVNROOT given, cannot run a checkout." [ ! -d "${SRCDIR}" ] && { install -d ${SRCDIR} || die; } # get all our modules or update them if [ ! -d ${SRCDIR}/${MY_SVN_MODULE}/.svn ] then ( cd ${SRCDIR}; svn checkout ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} ) else ( cd ${SRCDIR}; svn update ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} ) fi # correct permissions find ${SRCDIR} -type f -exec chmod 0644 '{}' ';' find ${SRCDIR} -type d -exec chmod 0755 '{}' ';' # delete svn directories for file in $(find ${SRCDIR} -type d -name .svn) do rm -rf ${file} done # set correct SRCDIR export SRCDIR="${SRCDIR}/${MY_SVN_MODULE}" cd ${SRCDIR} # clean up backup files (foo~) find ${SRCDIR} -name *~ -exec rm '{}' ';' || die } svn_src_prepare() { svn_fetch_source || die } export_inherits svn src_prepare