summaryrefslogtreecommitdiff
blob: 1904c57158cb2266ea472e9558ffa30ddc20564e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

argv0=${BASH_ARGV[0]}
this_file=$argv0
this_dirname=$(/bin/dirname $this_file)
this_repo="${this_dirname}/../../"

#discover category, package name and version
cat_pn_pvr=$(echo $this_file|/bin/sed -r 's$.+?/([A-Za-z0-9+_.-]+)/([A-Za-z0-9+_-]+)/\2-([0-9]+(\.[0-9]+)*[a-z]?((_alpha|_beta|_pre|_rc|_p)[0-9]*)*(-r[0-9]*)?)\.ebuild$\1/\2 \3$')

#this reads in metadata from g-common
{ while read -r line
do
	export "$line"
done
} < <(/usr/bin/g-common $this_repo package $cat_pn_pvr || die);

for phase in $GCOMMON_PHASES
do
	eval "$(printf '%q() { exec_phase %q; }' "$phase" "$phase")"
done

function exec_phase() {
	/usr/bin/g-common $this_repo $1 || die
}