summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Booij (tulcod) <auke@tulcod.com>2010-07-15 15:37:48 +0200
committerAuke Booij (tulcod) <auke@tulcod.com>2010-07-15 15:38:24 +0200
commit15723e7e1fc380d0d119a915965c9065277e15a0 (patch)
treea780d1a47b0b7a832e6dabc7dac225a4899b4679 /g_common/gcommon.eclass
parentFix (diff)
downloadg-cran-15723e7e1fc380d0d119a915965c9065277e15a0.tar.gz
g-cran-15723e7e1fc380d0d119a915965c9065277e15a0.tar.bz2
g-cran-15723e7e1fc380d0d119a915965c9065277e15a0.zip
Start development of g-common
Diffstat (limited to 'g_common/gcommon.eclass')
-rw-r--r--g_common/gcommon.eclass32
1 files changed, 32 insertions, 0 deletions
diff --git a/g_common/gcommon.eclass b/g_common/gcommon.eclass
new file mode 100644
index 0000000..b1b7bd3
--- /dev/null
+++ b/g_common/gcommon.eclass
@@ -0,0 +1,32 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+#
+# Original Author: Auke Booij
+# Purpose: g-common compatibility layer for package managers without native
+# support for g-common-capable non-ebuild repository drivers
+#
+
+this_dirname=$(/bin/dirname ${BASH_ARGV[0]})
+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-cran
+{ 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
+}
+