1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/un.rb (wait_writable): wait until target files can be

written actually.

	* win32/Makefile.sub (LDSHARED_0, LINK_SO): get rid of failure of
	  mt.exe.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-02 09:51:30 +00:00
parent c147806901
commit eaa3ffbae8
3 changed files with 41 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Mon Jun 2 18:51:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/un.rb (wait_writable): wait until target files can be
written actually.
* win32/Makefile.sub (LDSHARED_0, LINK_SO): get rid of failure of
mt.exe.
Mon Jun 2 16:26:17 2008 Akinori MUSHA <knu@iDaemons.org>
* lib/delegate.rb (Delegator::MethodDelegation#respond_to):

View file

@ -213,6 +213,33 @@ def touch
end
end
##
# Wait until the file becomes writable.
#
# ruby -run -e wait_writable -- [OPTION] FILE
#
def wait_writable
setup("n:w:v") do |argv, options|
verbose = options[:verbose]
n = options[:n] and n = Integer(n)
wait = (wait = options[:w]) ? Float(wait) : 0.2
argv.each do |file|
begin
open(file, "r+b")
rescue Errno::ENOENT
break
rescue Errno::EACCES => e
raise if n and (n -= 1) <= 0
puts e
STDOUT.flush
sleep wait
retry
end
end
end
end
##
# Display help message.
#

View file

@ -184,6 +184,7 @@ XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)
# Prevents VC++ 2005 (cl ver 14) warnings
DEFS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
MANIFESTTOOL = mt -nologo
LDSHARED_0 = @$(MINIRUBY) -run -e wait_writable -- -n 10 $@
LDSHARED_1 = $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
LDSHARED_2 = @$(RM) $(@:/=\).manifest
!endif
@ -610,6 +611,7 @@ s,@RPATHFLAG@,,;t t
s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t
!if $(MSC_VER) >= 1400
s,@LINK_SO@,@$$(RUBY) -run -e wait_writable -- -n 10 $$(@),;t t
s,@LINK_SO@,$(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
s,@LINK_SO@,@$$(RM) $$(@:/=\).manifest,;t t
!endif
@ -639,7 +641,7 @@ s,@top_srcdir@,$(srcdir),;t t
miniruby$(EXEEXT):
@echo. $(LIBS)
$(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(LIBS) -Fe$@ $(LDFLAGS)
miniruby.exe -v
$(LDSHARED_0)
$(LDSHARED_1)
$(LDSHARED_2)
@ -647,6 +649,7 @@ miniruby$(EXEEXT):
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS)
$(LDSHARED_0)
$(LDSHARED_1)
$(LDSHARED_2)
!endif
@ -656,6 +659,7 @@ $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
$(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
$(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
$(LDSHARED_0)
$(LDSHARED_1)
$(LDSHARED_2)
!endif
@ -672,6 +676,7 @@ $(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
$(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
$(LIBRUBY_DLDFLAGS)
$(LDSHARED_0)
$(LDSHARED_1)
$(LDSHARED_2)