% filePath), 1)
-def git_extract(from_what, tag, where, logger):
+def git_extract(from_what, tag, where, logger, environment=None):
'''Extracts sources from a git repository.
:param from_what str: The remote git repository.
:param tag str: The tag.
:param where str: The path where to extract.
:param logger Logger: The logger instance to use.
+ :param environment src.environment.Environ: The environment to source when
+ extracting.
:return: True if the extraction is successful
:rtype: boolean
'''
logger.logTxtFile.write("\n" + command + "\n")
logger.logTxtFile.flush()
- res = subprocess.call(command, cwd=str(where.dir()), shell=True,
- stdout=logger.logTxtFile, stderr=subprocess.STDOUT)
+ res = subprocess.call(command,
+ cwd=str(where.dir()),
+ env=environment.environ.environ,
+ shell=True,
+ stdout=logger.logTxtFile,
+ stderr=subprocess.STDOUT)
return (res == 0)
def archive_extract(from_what, where, logger):
return False, None
def cvs_extract(protocol, user, server, base, tag, product, where,
- logger, checkout=False):
+ logger, checkout=False, environment=None):
'''Extracts sources from a cvs repository.
:param protocol str: The cvs protocol.
:param where str: The path where to extract.
:param logger Logger: The logger instance to use.
:param checkout boolean: If true use checkout cvs.
+ :param environment src.environment.Environ: The environment to source when
+ extracting.
:return: True if the extraction is successful
:rtype: boolean
'''
logger.logTxtFile.write("\n" + command + "\n")
logger.logTxtFile.flush()
- res = subprocess.call(command, cwd=str(where.dir()), shell=True,
- stdout=logger.logTxtFile, stderr=subprocess.STDOUT)
+ res = subprocess.call(command,
+ cwd=str(where.dir()),
+ env=environment.environ.environ,
+ shell=True,
+ stdout=logger.logTxtFile,
+ stderr=subprocess.STDOUT)
return (res == 0)
-def svn_extract(user, from_what, tag, where, logger, checkout=False):
+def svn_extract(user,
+ from_what,
+ tag,
+ where,
+ logger,
+ checkout=False,
+ environment=None):
'''Extracts sources from a svn repository.
:param user str: The user to be used.
:param where str: The path where to extract.
:param logger Logger: The logger instance to use.
:param checkout boolean: If true use checkout svn.
+ :param environment src.environment.Environ: The environment to source when
+ extracting.
:return: True if the extraction is successful
:rtype: boolean
'''
logger.write(command + "\n", 5)
logger.logTxtFile.write("\n" + command + "\n")
logger.logTxtFile.flush()
- res = subprocess.call(command, cwd=str(where.dir()), shell=True,
- stdout=logger.logTxtFile, stderr=subprocess.STDOUT)
+ res = subprocess.call(command,
+ cwd=str(where.dir()),
+ env=environment.environ.environ,
+ shell=True,
+ stdout=logger.logTxtFile,
+ stderr=subprocess.STDOUT)
return (res == 0)
\ No newline at end of file