Commit 9c92ca10 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add methods to run genhdlist and genbt5list.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5139 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a68c42fb
...@@ -32,6 +32,9 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface ...@@ -32,6 +32,9 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ExtFile.ExtFile import ExtFile from Products.ExtFile.ExtFile import ExtFile
from Products.ExtFile.ExtImage import ExtImage from Products.ExtFile.ExtImage import ExtImage
import os
from App.config import getConfiguration
from Globals import package_home
from zLOG import LOG from zLOG import LOG
...@@ -67,3 +70,26 @@ class ExtFolder( XMLObject ): ...@@ -67,3 +70,26 @@ class ExtFolder( XMLObject ):
return ExtImage(name) return ExtImage(name)
return ExtFile(name) return ExtFile(name)
def _getRepositoryPath(self):
"""Return the path in the filesystem.
"""
instance_home = getConfiguration().instancehome
repository = os.path.join(ExtFile._repository)
return os.path.join(instance_home, repository, self.getPath())
security.declareProtected('Manage portal', 'PUT_factory')
def generateRpmHeaderList(self):
"""Run genhdlist on the directory behind this object.
"""
status = os.system("/usr/bin/genhdlist -s %s" % self._getRepositoryPath())
if status != 0:
raise RuntimeError, "failed in executing genhdlist"
security.declareProtected('Manage portal', 'PUT_factory')
def generateBt5HeaderList(self):
"""Run genbt5list on the directory behind this object.
"""
product_path = package_home( globals() )
status = os.system("%s/bin/genbt5list %s" % (product_path, self._getRepositoryPath()))
if status != 0:
raise RuntimeError, "failed in executing genbt5list"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment