Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 516644
Collapse All | Expand All

(-)/usr/portage/eclass/mercurial.eclass (-9 / +14 lines)
Lines 28-34 Link Here
28
28
29
# @ECLASS-VARIABLE: EHG_REVISION
29
# @ECLASS-VARIABLE: EHG_REVISION
30
# @DESCRIPTION:
30
# @DESCRIPTION:
31
# Create working directory for specified revision, defaults to tip.
31
# Create working directory for specified revision, defaults to default.
32
#
32
#
33
# EHG_REVISION is passed as a value for --updaterev parameter, so it can be more
33
# EHG_REVISION is passed as a value for --updaterev parameter, so it can be more
34
# than just a revision, please consult `hg help revisions' for more details.
34
# than just a revision, please consult `hg help revisions' for more details.
Lines 47-52 Link Here
47
# between several ebuilds.
47
# between several ebuilds.
48
[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}"
48
[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}"
49
49
50
# @ECLASS-VARIABLE: EGIT_CHECKOUT_DIR
51
# @DESCRIPTION:
52
# The directory to check the hg sources out to.
53
#
54
# EHG_CHECKOUT_DIR=${S}
55
50
# @ECLASS-VARIABLE: EHG_QUIET
56
# @ECLASS-VARIABLE: EHG_QUIET
51
# @DESCRIPTION:
57
# @DESCRIPTION:
52
# Suppress some extra noise from mercurial, set it to 'ON' to be quiet.
58
# Suppress some extra noise from mercurial, set it to 'ON' to be quiet.
Lines 76-82 Link Here
76
# Clone or update repository.
82
# Clone or update repository.
77
#
83
#
78
# If repository URI is not passed it defaults to EHG_REPO_URI, if module is
84
# If repository URI is not passed it defaults to EHG_REPO_URI, if module is
79
# empty it defaults to basename of EHG_REPO_URI, sourcedir defaults to S.
85
# empty it defaults to basename of EHG_REPO_URI, sourcedir defaults to 
86
# EHG_CHECKOUT_DIR, which defaults to S.
87
80
mercurial_fetch() {
88
mercurial_fetch() {
81
	debug-print-function ${FUNCNAME} "${@}"
89
	debug-print-function ${FUNCNAME} "${@}"
82
90
Lines 85-96 Link Here
85
	EHG_REPO_URI=${1-${EHG_REPO_URI}}
93
	EHG_REPO_URI=${1-${EHG_REPO_URI}}
86
	[[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty"
94
	[[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty"
87
95
88
	local cert_opt=()
89
	[[ -f ${EPREFIX}/etc/ssl/certs/ca-certificates.crt ]] && \
90
		cert_opt=( --config "web.cacerts=${EPREFIX}/etc/ssl/certs/ca-certificates.crt" )
91
92
	local module="${2-$(basename "${EHG_REPO_URI}")}"
96
	local module="${2-$(basename "${EHG_REPO_URI}")}"
93
	local sourcedir="${3-${S}}"
97
	local sourcedir="${3:-${EHG_CHECKOUT_DIR:-${S}}}"
94
98
95
	# Should be set but blank to prevent using $HOME/.hgrc
99
	# Should be set but blank to prevent using $HOME/.hgrc
96
	export HGRCPATH=
100
	export HGRCPATH=
Lines 114-120 Link Here
114
	# Clone/update repository:
118
	# Clone/update repository:
115
	if [[ ! -d "${module}" ]]; then
119
	if [[ ! -d "${module}" ]]; then
116
		einfo "Cloning ${EHG_REPO_URI} to ${EHG_STORE_DIR}/${EHG_PROJECT}/${module}"
120
		einfo "Cloning ${EHG_REPO_URI} to ${EHG_STORE_DIR}/${EHG_PROJECT}/${module}"
117
		${EHG_CLONE_CMD} "${cert_opt[@]}" "${EHG_REPO_URI}" "${module}" || {
121
		${EHG_CLONE_CMD} "${EHG_REPO_URI}" "${module}" || {
118
			rm -rf "${module}"
122
			rm -rf "${module}"
119
			die "failed to clone ${EHG_REPO_URI}"
123
			die "failed to clone ${EHG_REPO_URI}"
120
		}
124
		}
Lines 122-132 Link Here
122
	elif [[ -z "${EHG_OFFLINE}" ]]; then
126
	elif [[ -z "${EHG_OFFLINE}" ]]; then
123
		einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}"
127
		einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}"
124
		cd "${module}" || die "failed to cd to ${module}"
128
		cd "${module}" || die "failed to cd to ${module}"
125
		${EHG_PULL_CMD} "${cert_opt[@]}" "${EHG_REPO_URI}" || die "update failed"
129
		${EHG_PULL_CMD} "${EHG_REPO_URI}" || die "update failed"
126
	fi
130
	fi
127
131
128
	# Checkout working copy:
132
	# Checkout working copy:
129
	einfo "Creating working directory in ${sourcedir} (target revision: ${EHG_REVISION})"
133
	einfo "Creating working directory in ${sourcedir} (target revision: ${EHG_REVISION})"
134
	mkdir -p "${sourcedir}" || die "failed to create ${sourcedir}"
130
	hg clone \
135
	hg clone \
131
		${EHG_QUIET_CMD_OPT} \
136
		${EHG_QUIET_CMD_OPT} \
132
		--updaterev="${EHG_REVISION}" \
137
		--updaterev="${EHG_REVISION}" \

Return to bug 516644