parameters: (self, src, tgt, lbl, **kw)
docstring: Copies a file from src to tgt with given file permissions. The actual copy is only performed
  		if the source and target file sizes or timestamps differ. When the copy occurs,
  		the file is always first removed and then copied so as to prevent stale inodes.
  
  		:param src: file name as absolute path
  		:type src: string
  		:param tgt: file destination, as absolute path
  		:type tgt: string
  		:param lbl: file source description
  		:type lbl: string
  		:param chmod: installation mode
  		:type chmod: int
  		:raises: :py:class:`waflib.Errors.WafError` if the file cannot be written
docstring_summary: Copies a file from src to tgt with given file permissions. The actual copy is only performed
  		if the source and target file sizes or timestamps differ. When the copy occurs,
  		the file is always first removed and then copied so as to prevent stale inodes.
docstring_tokens: Copies a file from src to tgt with given file permissions . The actual copy is only performed if the source and target file sizes or timestamps differ . When the copy occurs the file is always first removed and then copied so as to prevent stale inodes .
function: def do_install(self, src, tgt, lbl, **kw):
  		"""
  		Copies a file from src to tgt with given file permissions. The actual copy is only performed
  		if the source and target file sizes or timestamps differ. When the copy occurs,
  		the file is always first removed and then copied so as to prevent stale inodes.
  
  		:param src: file name as absolute path
  		:type src: string
  		:param tgt: file destination, as absolute path
  		:type tgt: string
  		:param lbl: file source description
  		:type lbl: string
  		:param chmod: installation mode
  		:type chmod: int
  		:raises: :py:class:`waflib.Errors.WafError` if the file cannot be written
  		"""
  		if not Options.options.force:
  			# check if the file is already there to avoid a copy
  			try:
  				st1 = os.stat(tgt)
  				st2 = os.stat(src)
  			except OSError:
  				pass
  			else:
  				# same size and identical timestamps -> make no copy
  				if st1.st_mtime + 2 >= st2.st_mtime and st1.st_size == st2.st_size:
  					if not self.generator.bld.progress_bar:
  						Logs.info('- install %s (from %s)', tgt, lbl)
  					return False
  
  		if not self.generator.bld.progress_bar:
  			Logs.info('+ install %s (from %s)', tgt, lbl)
  
  		# Give best attempt at making destination overwritable,
  		# like the 'install' utility used by 'make install' does.
  		try:
  			os.chmod(tgt, Utils.O644 | stat.S_IMODE(os.stat(tgt).st_mode))
  		except EnvironmentError:
  			pass
  
  		# following is for shared libs and stale inodes (-_-)
  		try:
  			os.remove(tgt)
  		except OSError:
  			pass
  
  		try:
  			self.copy_fun(src, tgt)
  		except EnvironmentError as e:
  			if not os.path.exists(src):
  				Logs.error('File %r does not exist', src)
  			elif not os.path.isfile(src):
  				Logs.error('Input %r is not a file', src)
  			raise Errors.WafError('Could not install the file %r' % tgt, e)
function_tokens: def do_install ( self , src , tgt , lbl , * * kw ) : if not Options . options . force : # check if the file is already there to avoid a copy try : st1 = os . stat ( tgt ) st2 = os . stat ( src ) except OSError : pass else : # same size and identical timestamps -> make no copy if st1 . st_mtime + 2 >= st2 . st_mtime and st1 . st_size == st2 . st_size : if not self . generator . bld . progress_bar : Logs . info ( '- install %s (from %s)' , tgt , lbl ) return False if not self . generator . bld . progress_bar : Logs . info ( '+ install %s (from %s)' , tgt , lbl ) # Give best attempt at making destination overwritable, # like the 'install' utility used by 'make install' does. try : os . chmod ( tgt , Utils . O644 | stat . S_IMODE ( os . stat ( tgt ) . st_mode ) ) except EnvironmentError : pass # following is for shared libs and stale inodes (-_-) try : os . remove ( tgt ) except OSError : pass try : self . copy_fun ( src , tgt ) except EnvironmentError as e : if not os . path . exists ( src ) : Logs . error ( 'File %r does not exist' , src ) elif not os . path . isfile ( src ) : Logs . error ( 'Input %r is not a file' , src ) raise Errors . WafError ( 'Could not install the file %r' % tgt , e )