Entropy/EquoInterface:

- allow tagging entropy packages by setting ENTROPY_PROJECT_TAG inside the ebuild


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2767 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-12-11 10:47:39 +00:00
parent c9f2a293a5
commit e46fd159e5
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -4006,6 +4006,17 @@ class EquoInterface(TextInterface):
return pkg_links
def _extract_pkg_metadata_ebuild_entropy_tag(self, ebuild):
search_tag = etpConst['spm']['ebuild_pkg_tag_var']
ebuild_tag = ''
f = open(ebuild,"r")
tags = [x.strip() for x in f.readlines() if x.strip() and x.strip().startswith(search_tag)]
f.close()
if not tags: return ebuild_tag
tag = tags[-1]
tag = tag.split("=")[-1].strip('"').strip("'").strip()
return tag
# This function extracts all the info from a .tbz2 file and returns them
def extract_pkg_metadata(self, package, etpBranch = etpConst['branch'], silent = False, inject = False):
@@ -4121,6 +4132,14 @@ class EquoInterface(TextInterface):
# you must change "reagent update"
# and "equo database gentoosync" consequentially
file_ext = etpConst['spm']['ebuild_file_extension']
ebuilds_in_path = [x for x in os.listdir(tbz2TmpDir) if x.endswith(".%s" % (file_ext,))]
if not data['versiontag'] and ebuilds_in_path:
# has the user specified a custom package tag inside the ebuild
ebuild_path = os.path.join(tbz2TmpDir,ebuilds_in_path[0])
data['versiontag'] = self._extract_pkg_metadata_ebuild_entropy_tag(ebuild_path)
data['download'] = etpConst['packagesrelativepath'] + data['branch'] + "/"
data['download'] += self.entropyTools.create_package_filename(data['category'], data['name'], data['version'], data['versiontag'])
+2
View File
@@ -686,6 +686,8 @@ def const_defaultSettings(rootdir):
'server_treeupdatescalled': set(),
'client_treeupdatescalled': set(),
'spm': {
'ebuild_file_extension': "ebuild",
'ebuild_pkg_tag_var': "ENTROPY_PROJECT_TAG",
'global_make_conf': rootdir+"/etc/make.conf",
'global_package_keywords': rootdir+"/etc/portage/package.keywords",
'global_package_use': rootdir+"/etc/portage/package.use",