Project

General

Profile

« Previous | Next » 

Revision 184b39e1

Added by Renato Botelho almost 10 years ago

Create a new function pkg_repo_rsync, it'll be also used for core pkgs

View differences:

tools/builder_common.sh
1589 1589
	echo ">>> Operation $0 has ended at $(date)"
1590 1590
}
1591 1591

  
1592
pkg_repo_rsync() {
1593
	local _repo_path="${1}"
1594

  
1595
	if [ -z "${DO_NOT_UPLOAD}" -o -z "${_repo_path}" -o ! -d "${_repo_path}" ]; then
1596
		return
1597
	fi
1598

  
1599
	if [ -z "${LOGFILE}" ]; then
1600
		local _logfile="/dev/null"
1601
	else
1602
		local _logfile="${LOGFILE}"
1603
	fi
1604

  
1605
	echo -n ">>> Sending updated repository to ${PKG_RSYNC_HOSTNAME}... " | tee -a ${_logfile}
1606
	if script -aq ${_logfile} rsync -ave "ssh -p ${PKG_RSYNC_SSH_PORT}" \
1607
		--timeout=60 --delete-delay ${_repo_path} \
1608
		${PKG_RSYNC_USERNAME}@${PKG_RSYNC_HOSTNAME}:${PKG_RSYNC_DESTDIR} >/dev/null 2>&1
1609
	then
1610
		echo "Done!" | tee -a ${_logfile}
1611
	else
1612
		echo "Failed!" | tee -a ${_logfile}
1613
		echo ">>> ERROR: An error occurred sending repo to remote hostname"
1614
		print_error_pfS
1615
	fi
1616
}
1617

  
1592 1618
poudriere_create_patch() {
1593 1619
	local _jail_patch="${SCRATCHDIR}/poudriere_jail.${GIT_REPO_BRANCH_OR_TAG}.patch"
1594 1620

  
......
1896 1922
		fi
1897 1923

  
1898 1924
		# ./ is intentional, it's a rsync trick to make it chdir to directory before send it
1899
		REPO_PATH="/usr/local/poudriere/data/packages/./${jail_name}-${POUDRIERE_PORTS_NAME}"
1900
		if [ -z "${DO_NOT_UPLOAD}" -a -d "${REPO_PATH}" ]; then
1901
			echo -n ">>> Sending updated repository to ${PKG_RSYNC_HOSTNAME}... " | tee -a ${LOGFILE}
1902
			if script -aq ${LOGFILE} rsync -ave "ssh -p ${PKG_RSYNC_SSH_PORT}" \
1903
				--timeout=60 --delete-delay ${REPO_PATH} \
1904
				${PKG_RSYNC_USERNAME}@${PKG_RSYNC_HOSTNAME}:${PKG_RSYNC_DESTDIR} >/dev/null 2>&1
1905
			then
1906
				echo "Done!" | tee -a ${LOGFILE}
1907
			else
1908
				echo "Failed!" | tee -a ${LOGFILE}
1909
				echo ">>> ERROR: An error occurred sending repo to remote hostname"
1910
				print_error_pfS
1911
			fi
1912
		fi
1925
		pkg_repo_rsync "/usr/local/poudriere/data/packages/./${jail_name}-${POUDRIERE_PORTS_NAME}"
1913 1926
	done
1914 1927
}
1915 1928

  

Also available in: Unified diff