""" This class represents one command given by an rpc client for the slave: only contains variables and can be passed by xmlrpc """ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2004 Dries Verachtert import config from log4py import Logger from command import Command from specfiletags import SpecFileTags class SlaveCommand(Command): # from Comand.py start def __init__(self,tempObj): self.__cat = Logger().get_instance(self) self.__tempObj = tempObj print "tempObj=" + str(tempObj) def getDefines(self): return self.__tempObj["defines"] def getCommandName(self): return self.__tempObj["commandName"] def getUserId(self): return self.__tempObj["userId"] def getSpecRepoId(self): return self.__tempObj["specRepoId"] def getSpecFileId(self): return self.__tempObj["specFileId"] def getToEmail(self): return self.__tempObj["toEmail"] def getDistroArchTag(self): return self.__tempObj["distroArchTag"] def getPriority(self): return self.__tempObj["priority"] def getTargetId(self): return self.__tempObj["targetId"] def getId(self): return self.__tempObj["commandId"] def getSpecRepositoryName(self): return self.__tempObj["specRepoName"] def getSpecFileFileName(self): return self.__tempObj["specFileFileName"] def getVersion(self): return self.__tempObj["version"] def getAuthority(self): return self.__tempObj["authority"] # from Command.py end def fromXmlRpcPersistantObject(tempObj): return SlaveCommand(tempObj) fromXmlRpcPersistantObject = staticmethod(fromXmlRpcPersistantObject) # this is the directory which contains the spec file, the sources and possibly the log or rpms # this is NOT the %{buildroot} def setBuildDir(self,commandBuildDir): self.__buildDir = commandBuildDir print 'builddir set to ' + self.__buildDir def getBuildDir(self): return self.__buildDir # this returns an array! def getSpecFileBuildReqs(self): self.__cat.debug("start") # create a tags object based on the spec file and the defines specFile = self.getBuildDir() + "/" + self.getSpecFileShortFileName() self.__cat.debug("specFile: " + specFile) sft = SpecFileTags(specFile,self.getDefines()) br = sft.getBuildRequires() self.__cat.debug("br: " + str(br)) return br