aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-07-13 01:34:36 +0200
committerJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-07-13 01:34:36 +0200
commit266a041c08dac43069b6772d0ef7769ab7f295a9 (patch)
tree41135b00522123834d7e8c58f262e083871cacca
parentbin/g-elpa (diff)
downloadgs-elpa-266a041c08dac43069b6772d0ef7769ab7f295a9.tar.gz
gs-elpa-266a041c08dac43069b6772d0ef7769ab7f295a9.tar.bz2
gs-elpa-266a041c08dac43069b6772d0ef7769ab7f295a9.zip
cli for generate a single package
-rwxr-xr-x[-rw-r--r--]bin/g-elpa0
-rw-r--r--g_elpa/backend.py14
-rw-r--r--g_elpa/data/ebuild_with_digest.tmpl1
-rw-r--r--g_elpa/data/g-elpa.eclass10
-rw-r--r--g_elpa/elpa_db.py2
5 files changed, 19 insertions, 8 deletions
diff --git a/bin/g-elpa b/bin/g-elpa
index d23fa8a..d23fa8a 100644..100755
--- a/bin/g-elpa
+++ b/bin/g-elpa
diff --git a/g_elpa/backend.py b/g_elpa/backend.py
index 545b7b6..e3406ba 100644
--- a/g_elpa/backend.py
+++ b/g_elpa/backend.py
@@ -11,11 +11,21 @@
:license: GPL-2, see LICENSE for more details.
"""
+import os
+
from g_sorcery.backend import Backend
from g_sorcery.metadata import MetadataGenerator
+from g_sorcery.eclass import EclassGenerator
from .elpa_db import ElpaDB
from .ebuild import ElpaEbuildWithDigestGenerator, ElpaEbuildWithoutDigestGenerator
+from .fileutils import get_pkgpath
+
+class ElpaEclassGenerator(EclassGenerator):
+ def __init__(self):
+ super(ElpaEclassGenerator, self).__init__(os.path.join(get_pkgpath(), 'data'))
+
-instance = Backend(ElpaDB, ElpaEbuildWithDigestGenerator,
- ElpaEbuildWithoutDigestGenerator, MetadataGenerator, sync_db=False)
+instance = Backend(ElpaDB,
+ ElpaEbuildWithDigestGenerator, ElpaEbuildWithoutDigestGenerator,
+ ElpaEclassGenerator, MetadataGenerator, sync_db=False)
diff --git a/g_elpa/data/ebuild_with_digest.tmpl b/g_elpa/data/ebuild_with_digest.tmpl
index 5575a3b..6d599e6 100644
--- a/g_elpa/data/ebuild_with_digest.tmpl
+++ b/g_elpa/data/ebuild_with_digest.tmpl
@@ -6,6 +6,7 @@ EAPI=5
REPO_URI="$repo_uri"
PKG_TYPE="$source_type"
REALNAME="$realname"
+DIGEST_SOURCES="yes"
inherit g-elpa
diff --git a/g_elpa/data/g-elpa.eclass b/g_elpa/data/g-elpa.eclass
index 1b66340..4497fc4 100644
--- a/g_elpa/data/g-elpa.eclass
+++ b/g_elpa/data/g-elpa.eclass
@@ -34,11 +34,7 @@ GELPA_FETCH_CMD="wget"
inherit elisp
-if [ x${DIGEST_SOURCES} = x]; then
- EXPORT_FUNCTIONS src_{unpack,compile,install}
-else
- EXPORT_FUNCTIONS src_{compile,install}
-fi
+EXPORT_FUNCTIONS src_{unpack,compile,install}
if [[ ${PKG_TYPE} != "single" ]]; then
SUFFIX="${PKG_TYPE}"
@@ -58,7 +54,9 @@ g-elpa_fetch() {
}
g-elpa_src_unpack() {
- g-elpa_fetch
+ if [[ x${DIGEST_SOURCES} = x ]]; then
+ g-elpa_fetch
+ fi
if [[ ${PKG_TYPE} != "single" ]]; then
unpack ${P}.${PKG_TYPE}
else
diff --git a/g_elpa/elpa_db.py b/g_elpa/elpa_db.py
index 93a628f..070d830 100644
--- a/g_elpa/elpa_db.py
+++ b/g_elpa/elpa_db.py
@@ -72,6 +72,8 @@ class ElpaDB(PackageDB):
'homepage' : self.repo_uri,
'repo_uri' : self.repo_uri,
'realname' : realname,
+ #eclass entry
+ 'eclasses' : ['g-elpa'],
#metadata entries
'maintainer' : [{'email' : 'piatlicki@gmail.com',
'name' : 'Jauhien Piatlicki'}],