Exemple #1
0
#!/usr/bin/env python

import sys
import string
import os

sys.path.append('..')

import remote_shell

host = remote_shell.smbclient(username='******',
                              hostname='cygwin-mono.boston.ximian.com',
                              env={'SMB_SHARE': 'msys'})

if not os.path.exists('tmp'): os.mkdir('tmp')

host.copy_to(['*.py'], '/tmp')
host.copy_to(['../../packaging/sources/libgdiplus/*'], '/tmp')

host.copy_to(['../../packaging/sources/libgdiplus/*'], '/tmp')
host.copy_to(['../../packaging/sources/libgdiplus/*'], '/')

host.copy_from(['/tmp/libgdiplus*'], 'tmp')
Exemple #2
0
        def __init__(self, username="", hostname="", root_dir="", lock_filename="", target_command_prefix="", arch_change_path="", env=config.env_vars, my_logger="", login_mode='ssh', copy_mode='scp', exec_mode='ssh'):

		self.login_mode=login_mode
		self.copy_mode=copy_mode
		self.exec_mode=exec_mode

		# Only used by execute for now (for location of launch_process.py)
		self.build_location = env['build_location']

		# buildenv is on a remote host instead of a local one
		if hostname: 
			self.hostname = hostname

		else:
			self.login_mode = 'local'
			self.copy_mode = 'local'
			self.exec_mode = 'local'

			self.hostname = socket.gethostname()

		if username:
			self.username = username
		else:
			# portable way to do this? (doesn't work from install-deps?  What's going on)?
			#self.username = os.getlogin()
			# testing
			#self.username = "******"
			self.username = "******"
			#self.username = getpass.getuser()


		# Custom identifier to use at various places
		self.uid = "%s@%s:%s" % (self.username, self.hostname, root_dir)

		# Host lock filename
		if lock_filename:
			self.host_lock_filename = lock_filename
		else:
			self.host_lock_filename = self.uid

		# Client lock filename
		self.client_lock_filename = self.build_location + os.sep + "locked"

                # Optional...
                self.root_dir = root_dir
                self.env = env

                self.target_command_prefix = target_command_prefix

		# Optional command to run to prepend executing the shell.  suse x86_64 has 'linux32', and sles s390x has 's390'
		#  allows 32bit jails on 64bit hosts
		self.arch_change_path = arch_change_path

		# Add some things into the 'env' map
                self.env['local_tar_path'] = config.tar_path

		# initialize objects for later
		self.modes = {}
		self.modes['ssh'] = remote_shell.ssh(username=username, hostname=hostname, env=self.env, my_logger=my_logger)
		self.modes['scp'] = remote_shell.scp(username=username, hostname=hostname, env=self.env, my_logger=my_logger)
		self.modes['smbclient'] = remote_shell.smbclient(username=username, hostname=hostname, env=self.env, my_logger=my_logger)
		self.modes['local'] = remote_shell.local(username=username, hostname=hostname, env=self.env, my_logger=my_logger)

		self.logger = my_logger

		# chroot options
		if root_dir:
			self.root_dir_options = "sudo -H %s %s sudo -H -u %s" % (env['chroot_path'], self.root_dir, self.username)
		else:   self.root_dir_options = ""

		# Set flag so we don't copy over and over for execute_command
		self.exec_util_files_copied = False

		# Keep track of dirs we create so it doesn't get done over and over
		self.created_dest_dirs = {}

		# empty logger to use at various places
		self.empty_logger = logger.Logger(print_file=0, print_screen=0)

		# Filenames for process jobs
		self.interrupted_file = self.build_location + os.sep + 'interrupted'
		self.pgkill_file = self.build_location + os.sep + 'pgid_kill'
#!/usr/bin/env python

import sys
import string
import os

sys.path.append('..')

import remote_shell

host = remote_shell.smbclient(username='******', hostname='cygwin-mono.boston.ximian.com', env={'SMB_SHARE': 'msys'})

if not os.path.exists('tmp'): os.mkdir('tmp')

host.copy_to(['*.py'], '/tmp')
host.copy_to(['../../packaging/sources/libgdiplus/*'], '/tmp')

host.copy_to(['../../packaging/sources/libgdiplus/*'], '/tmp')
host.copy_to(['../../packaging/sources/libgdiplus/*'], '/')

host.copy_from(['/tmp/libgdiplus*'], 'tmp')