diff --git a/pisi/cli/buildhelper.py b/pisi/cli/buildhelper.py index 98a3d23f..8aea3514 100644 --- a/pisi/cli/buildhelper.py +++ b/pisi/cli/buildhelper.py @@ -43,6 +43,15 @@ class RemoteSource(object): self.url.uri = patchuri self.fetch(const.files_dir) + def fetch_comarfiles(self): + spec = self.ctx.spec + for package in spec.packages: + for pcomar in package.providesComar: + comaruri = join(self.location, + const.comar_dir, pcomar.script) + self.url.uri = comaruri + self.fetch(const.comar_dir) + def fetch_additionalFiles(self): spec = self.ctx.spec for afile in spec.source.additionalFiles: diff --git a/pisi/comariface.py b/pisi/comariface.py index 21b99c53..7e269ef4 100644 --- a/pisi/comariface.py +++ b/pisi/comariface.py @@ -2,25 +2,20 @@ import socket -def registerScript(om, appname, scriptPath): +def sendCommand(cmd, blocking=False): s = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM) s.connect("/tmp/comar") - cmd = '+' + om + ' ' + appname + ' ' +scriptPath + '\n' s.send(cmd) s.close() - return True + +def registerScript(om, appname, scriptPath): + cmd = '+' + om + ' ' + appname + ' ' +scriptPath + '\n' + sendCommand(cmd) def removeScript(appname): - s = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM) - s.connect("/tmp/comar") cmd = "-" + appname + '\n' - s.send(cmd) - s.close() - return True + sendCommand(cmd) def call(om): - s = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM) - s.connect("/tmp/comar") cmd = '$' + om + '\n' - s.send(cmd) - return True + sendCommand(cmd) diff --git a/pisi/constants.py b/pisi/constants.py index 8731ee2f..590f391a 100644 --- a/pisi/constants.py +++ b/pisi/constants.py @@ -45,6 +45,7 @@ class Constants: # file/directory names self.__c.actions_file = "actions.py" self.__c.files_dir = "files" + self.__c.comar_dir = "comar" self.__c.files_xml = "files.xml" self.__c.metadata_xml = "metadata.xml"