[entropy.const] drop etpConst['triggersdir'] global variable

This commit is contained in:
Fabio Erculiani
2011-10-27 22:05:27 +02:00
parent 9eb47eaeaa
commit faaa3d5b2c
3 changed files with 14 additions and 5 deletions

View File

@@ -190,7 +190,6 @@ def const_default_settings(rootdir):
default_etp_dbfile = "packages.db"
default_etp_dbclientfile = "equo.db"
default_etp_client_repodir = "/client"
default_etp_triggersdir = "/triggers/"+ETP_ARCH_CONST
default_etp_smartappsdir = "/smartapps/"+ETP_ARCH_CONST
default_etp_smartpackagesdir = "/smartpackages/"+ETP_ARCH_CONST
default_etp_cachesdir = "/caches/"
@@ -223,8 +222,7 @@ def const_default_settings(rootdir):
# etpConst['smartpackagesdir'] location where
# smart packages files are places
'smartpackagesdir': default_etp_dir+default_etp_smartpackagesdir,
# etpConst['triggersdir'] location where external triggers are placed
'triggersdir': default_etp_dir+default_etp_triggersdir,
# directory where entropy stores its configuration
'confdir': default_etp_confdir,
# same as above + /packages

View File

@@ -1173,7 +1173,8 @@ class PortagePlugin(SpmPlugin):
ebuild_path)
data['trigger'] = const_convert_to_rawstring("")
trigger_file = os.path.join(etpConst['triggersdir'], data['category'],
triggers_dir = SpmPlugin.external_triggers_dir()
trigger_file = os.path.join(triggers_dir, data['category'],
data['name'], etpConst['triggername'])
if os.access(trigger_file, os.R_OK) and os.path.isfile(trigger_file):
with open(trigger_file, "rb") as trig_f:

View File

@@ -12,7 +12,7 @@
"""
import os
from entropy.const import etpConst
from entropy.const import etpConst, etpSys
from entropy.core import Singleton
from entropy.misc import LogFile
from entropy.core.settings.base import SystemSettings
@@ -52,6 +52,16 @@ class SpmPlugin(Singleton):
"""
raise NotImplementedError()
@staticmethod
def external_triggers_dir():
"""
External Entropy triggers executable directory
This path should be used by SPM to read the trigger for
packages inside extract_package_metadata()
"""
return os.path.join(
etpConst['entropyworkdir'], "triggers", etpSys['arch'])
@staticmethod
def get_package_groups():
"""