--- ruby1.9-1.9.0.5.orig/debian/testrb1.9.rd +++ ruby1.9-1.9.0.5/debian/testrb1.9.rd @@ -0,0 +1,57 @@ +=begin + += NAME + +testrb1.9 - Automatic runnter for Test::Unit of Ruby + += SYNOPSIS + +testrb1.9 [options] [-- untouched arguments] test ... + += DESCRIPTION + +testrb1.9 loads and runs unit-tests. If test is directory name, testrb1.9 +testrb1.9 traverses the directory. + += OPTIONS + +: -r, --runner=RUNNER + + Use the given RUNNER. (t[k], c[onsole], g[tk], f[ox]) + +: -a, --add=TORUN + + Add TORUN to the list of things to run; can be a file or a directory. + +: -p, --pattern=PATTERN + + Match files to collect against PATTERN. (default pattern is + /\Atest_.*\.rb\Z/.) + +: -n, --name=NAME + + Runs tests matching NAME. (patterns may be used.) + +: -t, --testcase=TESTCASE + + Runs tests in TestCases matching TESTCASE. (patterns may be used.) + +: -v, --verbose=[LEVEL] + + Set the output level (default is verbose). (p[rogress], n[ormal], + v[erbose], s[ilent]) + +: -- + + Stop processing options so that the remaining options will be passed to + the test. + +: -h, --help + + Display help. + += AUTHOR + +This manpage was contributed by akira yamada + +=end --- ruby1.9-1.9.0.5.orig/debian/rules +++ ruby1.9-1.9.0.5/debian/rules @@ -0,0 +1,337 @@ +#!/usr/bin/make -f + +DEB_TAR_SRCDIR = ruby-1.9.0-0 + +ruby_ver = 1.9 +ruby_ver_teeny = 0 +ruby_ver_dir = $(ruby_ver).$(ruby_ver_teeny) +tcltk_ver = 8.4 + +arch_name = $(subst linux-gnu,linux-,$(patsubst %linux-gnu,%linux,$(DEB_HOST_GNU_TYPE))) +ifeq (i686-linux-lp,$(arch_name)) + arch_name = i686-linux +endif + +ruby_libdir = usr/lib/ruby/$(ruby_ver_dir) +ruby_archdir = usr/lib/ruby/$(ruby_ver_dir)/$(arch_name) +bin_dir = usr/bin +man_dir = usr/share/man/man1 + +el_dir = usr/share/emacs/site-lisp/ruby$(ruby_ver)-elisp +el_etc = etc/emacs/site-start.d + +examples_dir = $(CURDIR)/debian/ruby$(ruby_ver)-examples/usr/share/doc/ruby$(ruby_ver)-examples/examples + +#deb_ver = $(shell dpkg-parsechangelog | awk '/^Version:/{print $2}') + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/dpatch.mk +include /usr/share/dpatch/dpatch.make + +DEB_AUTO_UPDATE_AUTOCONF = YES + +CFLAGS := -fno-strict-aliasing -g +CXXFLAGS := -fno-strict-aliasing -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g -O0 +else + CFLAGS += -g -O2 +endif +ifneq (,$(findstring $(DEB_HOST_GNU_CPU),ia64)) + CFLAGS := $(patsubst -O1,,$(CFLAGS)) + CFLAGS := $(patsubst -O2,,$(CFLAGS)) + CFLAGS := $(patsubst -O3,,$(CFLAGS)) + CFLAGS += -O0 + CXXFLAGS := $(patsubst -O1,,$(CFLAGS)) + CXXFLAGS := $(patsubst -O2,,$(CFLAGS)) + CXXFLAGS := $(patsubst -O3,,$(CFLAGS)) + CXXFLAGS += -O0 +endif + +ifeq ($(DEB_HOST_GNU_CPU),i386) + DEB_CONFIGURE_USER_FLAGS += --enable-frame-address +endif +ifneq (,$(filter $(DEB_HOST_GNU_CPU),i486 i586 i686)) + DEB_CONFIGURE_USER_FLAGS += --enable-frame-address + DEB_CONFIGURE_USER_FLAGS += --with-extra-site-search-path='/usr/local/lib/site_ruby/$(ruby_ver)/i386-linux' + DEB_CONFIGURE_USER_FLAGS += --with-extra-search-path='/usr/lib/ruby/$(ruby_ver)/i386-linux' +endif +DEB_CONFIGURE_USER_FLAGS += --program-suffix=$(ruby_ver) +DEB_CONFIGURE_USER_FLAGS += --enable-pthread +DEB_CONFIGURE_USER_FLAGS += --enable-shared +DEB_CONFIGURE_USER_FLAGS += --enable-ipv6 +DEB_CONFIGURE_USER_FLAGS += --with-lookup-order-hack=INET +DEB_CONFIGURE_USER_FLAGS += --disable-rpath +DEB_CONFIGURE_USER_FLAGS += --disable-install-doc +DEB_CONFIGURE_USER_FLAGS += --with-sitedir='/usr/local/lib/site_ruby' +DEB_CONFIGURE_USER_FLAGS += --with-default-kcode=none +DEB_CONFIGURE_USER_FLAGS += --with-dbm-type=gdbm_compat +DEB_CONFIGURE_USER_FLAGS += --with-tklib=tk$(tcltk_ver) +DEB_CONFIGURE_USER_FLAGS += --with-tcllib=tcl$(tcltk_ver) +DEB_CONFIGURE_USER_FLAGS += --with-tcl-include=/usr/include/tcl$(tcltk_ver) +DEB_CONFIGURE_USER_FLAGS += --with-bundled-sha1 +DEB_CONFIGURE_USER_FLAGS += --with-bundled-md5 +DEB_CONFIGURE_USER_FLAGS += --with-bundled-rmd160 + +DEB_MAKE_BUILD_TARGET = all +#DEB_MAKE_BUILD_TARGET = all test +#DEB_MAKE_BUILD_TARGET = all test test-all + +DEB_INSTALL_DIRS_ruby$(ruby_ver)-elisp += $(el_dir) +DEB_INSTALL_DIRS_ruby$(ruby_ver)-elisp += $(el_etc) +DEB_INSTALL_DOCS_ruby$(ruby_ver)-elisp += $(DEB_SRCDIR)/misc/README + +DEB_INSTALL_DIRS_ri$(ruby_ver) += $(bin_dir) +DEB_INSTALL_DIRS_ri$(ruby_ver) += $(man_dir) +DEB_INSTALL_MANPAGES_ri$(ruby_ver) += debian/ri$(ruby_ver).1 + +DEB_INSTALL_DIRS_rdoc$(ruby_ver) += $(bin_dir) +DEB_INSTALL_DIRS_rdoc$(ruby_ver) += $(man_dir) +DEB_INSTALL_DIRS_rdoc$(ruby_ver) += $(ruby_libdir) +DEB_INSTALL_DOCS_rdoc$(ruby_ver) += $(DEB_SRCDIR)/lib/rdoc/README +DEB_INSTALL_MANPAGES_rdoc$(ruby_ver) += debian/rdoc$(ruby_ver).1 + +DEB_INSTALL_DIRS_irb$(ruby_ver) += $(bin_dir) +DEB_INSTALL_DIRS_irb$(ruby_ver) += $(man_dir) +DEB_INSTALL_DIRS_irb$(ruby_ver) += $(ruby_libdir) +DEB_INSTALL_DOCS_irb$(ruby_ver) += $(DEB_SRCDIR)/doc/irb/* +DEB_INSTALL_MANPAGES_irb$(ruby_ver) += debian/irb$(ruby_ver).1 + +DEB_INSTALL_DOCS_libgdbm-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/gdbm/README* + +DEB_INSTALL_DOCS_libreadline-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/readline/README* + +DEB_INSTALL_DOCS_libtcltk-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/tk/README* +DEB_INSTALL_DOCS_libtcltk-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/tk/MANUAL* + +DEB_INSTALL_DIRS_ruby$(ruby_ver) += $(bin_dir) +DEB_INSTALL_DIRS_ruby$(ruby_ver) += $(man_dir) +DEB_INSTALL_DOCS_ruby$(ruby_ver) += +DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/LEGAL +DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/README +DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/README.ja +DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/ToDo +DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/doc/NEWS +DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/testrb$(ruby_ver).1 +DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/erb$(ruby_ver).1 +DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/rake$(ruby_ver).1 + +DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/lib/README +DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/doc/NEWS +DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/doc/*.rd* + + +DEB_INSTALL_DOCS_ruby$(ruby_ver)-dev += $(DEB_SRCDIR)/README.EXT* + +DEB_COMPRESS_EXCLUDE = .rb .pl .py .scm .awk .dat +DEB_SHLIBDEPS_INCLUDE = $(CURDIR)/debian/libruby$(ruby_ver)/usr/lib +DEB_DH_MAKESHLIBS_ARGS_libruby$(ruby_ver) = -m$(ruby_ver) -V + +# XXX: magic for compat level 4 +DEB_DH_STRIP_ARGS = --dbg-package=libruby$(ruby_ver) + +pre-build:: + cp debian/generated-incs/*.inc $(DEB_SRCDIR) + echo -n "uname -a: " + uname -a + echo "/proc/cpuinfo: ----------" + -cat /proc/cpuinfo + echo "-------------------------" + +common-post-build-arch:: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) +ifneq ($(DEB_HOST_GNU_TYPE),hppa-linux-gnu) + # Do not run the test suite on hppa, since hppa currently has strange + # signal semantics that cause the test suite to fail. Could be + # re-enabled when hppa switches to NPTL for threads. + -make test + -make TESTS=ruby test-all +endif +endif + +binary-install/libdbm-ruby$(ruby_ver) \ +binary-install/libgdbm-ruby$(ruby_ver) \ +binary-install/libreadline-ruby$(ruby_ver) \ +binary-install/libopenssl-ruby$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) \ + $(ruby_archdir)/$(patsubst lib%-ruby$(ruby_ver),%,$(cdbs_curpkg)).so + sh $(CURDIR)/debian/extfixup_rubylibs.sh $(ruby_ver_dir) $(cdbs_curpkg) \ + $(DEB_SRCDIR)/ext/$(patsubst lib%-ruby$(ruby_ver),%,$(cdbs_curpkg)) + sh $(CURDIR)/debian/extfixup_examples.sh $(cdbs_curpkg) \ + $(DEB_SRCDIR)/ext/$(patsubst lib%-ruby$(ruby_ver),%,$(cdbs_curpkg)) +binary-install/libopenssl-ruby$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) \ + usr/lib/ruby/$(ruby_ver_dir)/drb/ssl.rb \ + usr/lib/ruby/$(ruby_ver_dir)/net/https.rb \ + usr/lib/ruby/$(ruby_ver_dir)/webrick/ssl.rb + +binary-install/libtcltk-ruby$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) \ + $(ruby_archdir)/tcltklib.so \ + $(ruby_archdir)/tkutil.so + sh $(CURDIR)/debian/extfixup_rubylibs.sh $(ruby_ver_dir) $(cdbs_curpkg) \ + $(DEB_SRCDIR)/ext/tk + + install -d \ + $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples + (cd $(DEB_SRCDIR)/ext/tk/sample && \ + tar cf - .) | \ + (cd $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples && tar xf -) + mv $(CURDIR)/debian/tmp/usr/lib/ruby/$(ruby_ver_dir)/tkextlib/SUPPORT_STATUS \ + $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/ + install \ + $(DEB_SRCDIR)/ext/tk/lib/README \ + $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.lib + install \ + $(DEB_SRCDIR)/ext/tk/lib/tkextlib/tcllib/README \ + $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.tcllib + install \ + $(DEB_SRCDIR)/ext/tk/lib/tkextlib/tkimg/README \ + $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.tkimg + +binary-install/libruby$(ruby_ver):: $(patsubst %,binary-install/%,$(filter-out libruby$(ruby_ver),$(DEB_PACKAGES))) + install -d $(CURDIR)/debian/$(cdbs_curpkg)/$(ruby_archdir) + for s in $(CURDIR)/debian/$(cdbs_curpkg).*.in; do \ + sed -e 's/@@arch@@/$(arch_name)/g' \ + -e 's/@@verdir@@/$(ruby_ver_dir)/g' \ + < $$s > `expr $$s : '\(.*\)\.in$$'`; \ + done + + (cd $(CURDIR)/debian/tmp/usr/lib && \ + for f in libruby$(ruby_ver).so.$(ruby_ver)*; do \ + echo usr/lib/$$f; \ + done) | xargs dh_movefiles -p$(cdbs_curpkg) + dh_movefiles -p$(cdbs_curpkg) usr/lib/ruby/$(ruby_ver_dir) + + cd $(DEB_SRCDIR)/ext && \ + for dir in \ + bigdecimal continuation curses digest dl etc \ + fcntl iconv io json nkf pty racc ripper sdbm socket \ + stringio strscan syck syslog zlib \ + ; \ + do \ + install -d "$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir"; \ + find $$dir \ + -name '*README*' -or -name '*.html*' -or \ + -name '*.txt*' -or -name '*.rd*' | \ + while read fname; \ + do \ + cp "$$fname" \ + "$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir"; \ + done; \ + rmdir "$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir" 2>/dev/null || :; \ + done + + rm -rf $(CURDIR)/debian/$(cdbs_curpkg)/$(ruby_libdir)/*ubygems* + +binary-install/ruby$(ruby_ver)-dev:: + dh_movefiles -p$(cdbs_curpkg) \ + usr/lib/libruby$(ruby_ver).so \ + usr/lib/libruby$(ruby_ver)-static.a \ + usr/lib/ruby/$(ruby_ver_dir)/mkmf.rb + (cd $(CURDIR)/debian/tmp && \ + find usr/include/ruby-$(ruby_ver_dir) -name '*.h' -type f) | \ + xargs dh_movefiles -p$(cdbs_curpkg) + +binary-install/ruby$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) \ + usr/bin/ruby$(ruby_ver) \ + usr/bin/erb$(ruby_ver) \ + usr/bin/testrb$(ruby_ver) \ + usr/bin/testrb$(ruby_ver) \ + usr/bin/rake$(ruby_ver) \ + usr/share/man/man1/ruby$(ruby_ver).1 + +binary-post-install/ruby$(ruby_ver)-elisp:: + install -m444 $(DEB_SRCDIR)/misc/*.el \ + $(CURDIR)/debian/$(cdbs_curpkg)/$(el_dir) + +binary-install/ri$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) $(bin_dir)/$(cdbs_curpkg) +binary-post-install/ri$(ruby_ver):: + $(DEB_MAKE_INVOKE) install-doc DESTDIR=$(CURDIR)/debian/$(cdbs_curpkg) + install -m444 $(CURDIR)/debian/$(cdbs_curpkg).1 \ + $(CURDIR)/debian/$(cdbs_curpkg)/$(man_dir)/$(cdbs_curpkg).1 + +binary-install/rdoc$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) \ + $(bin_dir)/$(cdbs_curpkg) \ + $(ruby_libdir)/rdoc +binary-post-install/rdoc$(ruby_ver):: + install -m444 $(CURDIR)/debian/$(cdbs_curpkg).1 \ + $(CURDIR)/debian/$(cdbs_curpkg)/$(man_dir)/$(cdbs_curpkg).1 + +binary-install/irb$(ruby_ver):: + dh_movefiles -p$(cdbs_curpkg) $(bin_dir)/$(cdbs_curpkg) \ + $(ruby_libdir)/irb.rb $(ruby_libdir)/irb +binary-post-install/irb$(ruby_ver):: + install -m444 $(CURDIR)/debian/$(cdbs_curpkg).1 \ + $(CURDIR)/debian/$(cdbs_curpkg)/$(man_dir)/$(cdbs_curpkg).1 + +binary-post-install/ruby$(ruby_ver)-examples:: + install -d $(examples_dir)/bigdecimal + cp -a $(DEB_SRCDIR)/ext/bigdecimal/sample/* $(examples_dir)/bigdecimal + install -d $(examples_dir)/curses + cd $(DEB_SRCDIR)/ext/curses && \ + cp hello.rb mouse.rb rain.rb view.rb view2.rb \ + $(examples_dir)/curses +# install -d $(examples_dir)/digest +# install -d $(examples_dir)/dl +# install -d $(examples_dir)/enumerator +# install -d $(examples_dir)/etc +# install -d $(examples_dir)/fcntl +# install -d $(examples_dir)/iconv +# install -d $(examples_dir)/io +# install -d $(examples_dir)/nkf + install -d $(examples_dir)/pty + cd $(DEB_SRCDIR)/ext/pty && \ + cp expect_sample.rb script.rb shl.rb \ + $(examples_dir)/pty +# install -d $(examples_dir)/racc + install -d $(examples_dir)/ripper + cd $(DEB_SRCDIR)/ext/ripper && \ + cp tools/* $(examples_dir)/ripper +# install -d $(examples_dir)/sdbm +# install -d $(examples_dir)/socket +# install -d $(examples_dir)/stringio +# install -d $(examples_dir)/strscan +# install -d $(examples_dir)/syck +# install -d $(examples_dir)/syslog +# install -d $(examples_dir)/zlib + + (cd $(DEB_SRCDIR)/sample && tar cf - .) | \ + (cd $(examples_dir) && tar xf -) + cd $(examples_dir) && rm -rf openssl + +$(patsubst %,binary-post-install/%,$(DEB_PACKAGES)):: + bash $(CURDIR)/debian/fixshebang.sh ruby$(ruby_ver) \ + '$(CURDIR)/debian/$(cdbs_curpkg)/$(bin_dir)' + bash $(CURDIR)/debian/fixshebang.sh ruby$(ruby_ver) \ + '$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples' + sh $(CURDIR)/debian/rmshebang.sh \ + '$(CURDIR)/debian/$(cdbs_curpkg)/$(ruby_libdir)' + +clean:: + rm -f \ + .installed.list \ + parse.c \ + prelude.c \ + largefile.h enc.mk \ + enc/*.o enc/trans/*.o \ + debian/libruby$(ruby_ver).postinst \ + debian/libruby$(ruby_ver).prerm \ + debian/libruby$(ruby_ver).postrm + cp debian/generated-incs/*.inc $(DEB_SRCDIR) + + if [ -f $(DEB_SRCDIR)/config.guess.cdbs-orig ]; \ + then \ + mv $(DEB_SRCDIR)/config.guess.cdbs-orig \ + $(DEB_SRCDIR)/config.guess; \ + fi + if [ -f $(DEB_SRCDIR)/config.sub.cdbs-orig ]; \ + then \ + mv $(DEB_SRCDIR)/config.sub.cdbs-orig \ + $(DEB_SRCDIR)/config.sub; \ + fi --- ruby1.9-1.9.0.5.orig/debian/fixshebang.sh +++ ruby1.9-1.9.0.5/debian/fixshebang.sh @@ -0,0 +1,36 @@ +#!/bin/bash +ruby="$1" +target_dir="$2" + +for f in `find "$target_dir" -type f 2>/dev/null` +do + textflag=0 + filetype="`file -b $f`" + for ft in $filetype + do + if [ "${#ft}" -lt 4 ] + then + continue + fi + if [ "${ft:0:4}" == "text" ] + then + textflag=1 + break + fi + done + + if [ "$textflag" -eq 0 ] + then + continue + fi + + cp -pf $f $f.tmp + sed -e '1,1s,^#![ ]*\([^ ]*\)/\(ruby\|env ruby\)$,#!/usr/bin/'$ruby',' \ + -e '1,1s,^#![ ]*\([^ ]*\)/\(wish\|perl\)$,#!/usr/bin/\2,' < $f > $f.tmp + if ! cmp $f $f.tmp >/dev/null + then + mv -f $f.tmp $f + else + rm -f $f.tmp + fi +done --- ruby1.9-1.9.0.5.orig/debian/testrb1.9.1 +++ ruby1.9-1.9.0.5/debian/testrb1.9.1 @@ -0,0 +1,60 @@ +.\" DO NOT MODIFY THIS FILE! it was generated by rd2 +.TH testrb1.9 1 "December 2003" +.SH NAME +.PP +testrb1.9 \- Automatic runnter for Test::Unit of Ruby +.SH SYNOPSIS +.PP +testrb1.9 [options] [\-\- untouched arguments] test ... +.SH DESCRIPTION +.PP +testrb1.9 loads and runs unit\-tests. If test is directory name, testrb1.9 +testrb1.9 traverses the directory. +.SH OPTIONS +.TP +.fi +.B +\-r, \-\-runner=RUNNER +Use the given RUNNER. (t[k], c[onsole], g[tk], f[ox]) +.TP +.fi +.B +\-a, \-\-add=TORUN +Add TORUN to the list of things to run; can be a file or a directory. +.TP +.fi +.B +\-p, \-\-pattern=PATTERN +Match files to collect against PATTERN. (default pattern is +/\\Atest_.*\\.rb\\Z/.) +.TP +.fi +.B +\-n, \-\-name=NAME +Runs tests matching NAME. (patterns may be used.) +.TP +.fi +.B +\-t, \-\-testcase=TESTCASE +Runs tests in TestCases matching TESTCASE. (patterns may be used.) +.TP +.fi +.B +\-v, \-\-verbose=[LEVEL] +Set the output level (default is verbose). (p[rogress], n[ormal], +v[erbose], s[ilent]) +.TP +.fi +.B +\-\- +Stop processing options so that the remaining options will be passed to +the test. +.TP +.fi +.B +\-h, \-\-help +Display help. +.SH AUTHOR +.PP +This manpage was contributed by akira yamada + --- ruby1.9-1.9.0.5.orig/debian/erb1.9.1 +++ ruby1.9-1.9.0.5/debian/erb1.9.1 @@ -0,0 +1,72 @@ +.TH ERB1.9 1 "April 2003" +.SH NAME +.PP +erb \- an embedded Ruby language interpreter +.SH SYNOPSIS +.PP +erb1.9 [switches] [inputfile] +.SH DESCRIPTION +.PP +erb interprets a Ruby code embedded text file. For example, erb +enables you to embed a Ruby code to a HTML file. +A Ruby block starts with `<%' and ends with `%>'. erb replaces +the block with its output. +If `<%' is followed by `=', eRuby replaces the block with a value +of the block. +If `<%' is followed by `#', the block is ignored as a comment. +.SH OPTIONS +.PP + +.TP +.fi +.B +\-x +print ruby script +.TP +.fi +.B +\-n +print ruby script with line number +.TP +.fi +.B +\-v +enables verbose mode +.TP +.fi +.B +\-d +set debugging flags (set $DEBUG to true) +.TP +.fi +.B +\-r library +load a library +.TP +.fi +.B +\-K kcode +specifies KANJI code\-set (euc or sjis) or UTF\-8 (utf8) +.TP +.fi +.B +\-S safe_level +set $SAFE (0..4) +.TP +.fi +.B +\-T trim_mode +specify trim_mode (0..2) +.TP +.fi +.B +\-P +disregard the lin which starts in "%" +.SH SEE ALSO +.PP +eruby(1) +.SH AUTHOR +.PP +This document stands on eruby(1) which is written by Shugo Maeda +. + --- ruby1.9-1.9.0.5.orig/debian/libruby1.9.prerm.in +++ ruby1.9-1.9.0.5/debian/libruby1.9.prerm.in @@ -0,0 +1,38 @@ +#! /bin/sh +# postrm script for ruby +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + if [ -w /usr/local/lib -a -e /usr/local/lib/site_ruby/@@verdir@@ ] + then + rmdir /usr/local/lib/site_ruby/@@verdir@@/@@arch@@ 2>/dev/null || true + rmdir /usr/local/lib/site_ruby/@@verdir@@ 2>/dev/null || true + rmdir /usr/local/lib/site_ruby 2>/dev/null || true + fi + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# --- ruby1.9-1.9.0.5.orig/debian/changelog +++ ruby1.9-1.9.0.5/debian/changelog @@ -0,0 +1,510 @@ +ruby1.9 (1.9.0.5-1) unstable; urgency=low + + [ Daigo Moriwaki ] + * debian/watch: corrected to follow the new versioning by the upstream such + as 1.9.1-p0.tar.gz + * Added debian/patches/090301_r22440_OCSP_basic_verify.dpatch: It did not + properly check the return value from the OCSP_basic_verify function, which + might allow remote attackers to successfully present an invalid X.509 + certificate, possibly involving a revoked certificate. [CVE-2009-0642] + (Closes: #513528) + * debian/rules: + - fixshebang.sh runs on bash. + - The upstream's COPYING* is no longer installed (due to Debian policy). + That information is included in debian/copyright. + * debian/patches/090803_exclude_rdoc.dpatch: ported from the ruby1.9.1 + package. + * debian/control: Added misc depends. + * debian/compat: Bumpled up the version to 7. + + [ Lucas Nussbaum ] + * New upstream release. + + *.inc updated. + + no longer needed (were backports): + - 101_parse_rb + - 103_array_c_r17570_to_r17756 + - 301_dns_spoofing_r18424 + - 302_r18220_webrick_DoS + - 303_r17726_syslog_safeleve4 + - 304_r17577_trace_var_safeleve4 + - 305_r18496_dl_tain + - 306_r17586_methods_called_safelevel13 + - 307_r19033_rexml_DoS + - 308_regexp_segv + - 930_zero_tainted + + Refreshed: + - 919_common.mk_tweaks + + 102_skip_test_copy_stream: file changed upstream, might no + longer be needed. + * Fix building on lpia (Closes: #532057). + * Disable the test suite on hppa since it blocks because of strange + signal semantics. (Closes: #514695). + * Agree with ftpmaster's overrides. + * Bumped Standards-Version to 3.8.2. No changes needed. + * Build-Depends on procps. Closes: #510914. + * debian/fixshebang.sh: skip non-text files, which works around + hanging of sed on scanning gif images. + * Added 940_test_file_exhaustive_fails_as_root and + 940_test_priority_fails to deal with test suite failures. + * Added patch 940_test_thread_mutex_sync_shorter: makes + test_mutex_synchronize much shorter to deal with slow arches. + Closes: #514696. + * Removed Fumitoshi UKAI from Uploaders. Thanks a + lot for the past help! Closes: #541026. + + -- Daigo Moriwaki Sat, 22 Aug 2009 09:55:25 +0900 + +ruby1.9 (1.9.0.2-9.1) unstable; urgency=high + + * Non-maintainer upload by the Security Team. + * Add upstream patch to properly check return values of the + OCSP_basic_verify function (CVE-2009-0642; Closes: #513528) + + -- Nico Golde Mon, 06 Apr 2009 18:43:32 +0200 + +ruby1.9 (1.9.0.2-9) unstable; urgency=high + + * fixes regression: + - 307_r19033_rexml_DoS.dpatch: fixed DoS vulnerability in REXML. + (ref: #502535) + * added patch: 308_regexp_segv + avoid segmentation fault in Regexp#inspect. + (backported r19384, r19433 and r20243 of upstream trunk.) + * debian/rules: copy debian/generated-incs/*.inc without "-p" option to + avoid re-generate incs. + + -- akira yamada Tue, 02 Dec 2008 14:39:22 +0900 + +ruby1.9 (1.9.0.2-8) unstable; urgency=high + + * Added patch: 930_zero_tainted.dpatch + backport of upstream r17612. Closes: #501408 (RC bug). + + -- Lucas Nussbaum Thu, 16 Oct 2008 22:15:33 +0200 + +ruby1.9 (1.9.0.2-7) unstable; urgency=low + + * debian/rules: Fixed a FTBFS on hurd-i386: failure of + cat /proc/cpuinfo no more stops the build process. + (Closes: #497737) + + -- Daigo Moriwaki Fri, 05 Sep 2008 12:07:57 +0900 + +ruby1.9 (1.9.0.2-6) unstable; urgency=low + + * Added patches under debian/patches which were backported from the + upstream and fixed multiple vulnerabilities: + - 301_dns_spoofing_r18424.dpatch: fixed DNS spoofing vulnerability + in resolv.rb. (CVE-2008-1447) + - 302_r18220_webrick_DoS.dpatch: fixed DoS vulnerability in WEBrick. + - 303_r17726_syslog_safeleve4.dpatch: syslog operations should be + protected from $SAFE level 4. + - 304_r17577_trace_var_safeleve4.dpatch: rb_f_trace_var should not + be allowed at safe level 4. + - 305_r18496_dl_tain.dpatch: dl doesn't check taintness, so it could + allow attackers to call dangerous functions. + - 306_r17586_methods_called_safelevel13.dpatch: Insecure methods may + be called at safe level 1-3. + (Closes: #494402) + - 307_r19033_rexml_DoS.dpatch: fixed DoS vulnerability in REXML. + (CVE-2008-3790) (Closes: #497610) + + -- Daigo Moriwaki Tue, 02 Sep 2008 22:11:34 -0400 + +ruby1.9 (1.9.0.2-5) unstable; urgency=low + + [ Lucas Nussbaum ] + * Because of make's dependency handling on phony targets after the addition + of the watch in 1.9.0.1-4, parse.o was rebuilt three times during the + build process. Build it only once, which should reduce the build time + significantly. + + [ Daigo Moriwaki ] + * RubyGems did not work completely due to a gem_relude mechanism . This + issue has been fixed. (Closes: #492206) + - debian/patches/201_gem_prelude.dpatch + - debian/rules + + -- Daigo Moriwaki Thu, 31 Jul 2008 00:54:00 +0900 + +ruby1.9 (1.9.0.2-4) unstable; urgency=low + + * Modified computing of arch_name to cope with armel. This was broken + because of the change for lpia. We are now using the same code as + ruby1.8's debian/rules. Closes: #490663. + * Cleaned up debian/rules to use DEB_HOST_* instead of DEB_BUILD_*. + + -- Lucas Nussbaum Sun, 13 Jul 2008 16:30:24 +0200 + +ruby1.9 (1.9.0.2-3) unstable; urgency=low + + * Updated 102_skip_test_copy_stream.dpatch to also ignore + test_copy_stream_socket. + + -- Lucas Nussbaum Sat, 12 Jul 2008 16:12:53 +0200 + +ruby1.9 (1.9.0.2-2) unstable; urgency=low + + * applied debian/patches/103_array_c_r17570_to_r17756.dpatch: + - fixed an integer overflow bug. + + -- Daigo Moriwaki Wed, 09 Jul 2008 00:06:50 +0900 + +ruby1.9 (1.9.0.2-1) unstable; urgency=high + + * New upstream release. + * debian/generated-incs/*.inc: updated. They were created directly from the + source using ruby1.8. + * Fixed vulnerability: arbitrary code execution vulnerability and so on + (Closes: #487239) + * debian/watch: supported the version numbering of the upstream. + * removed patches that the upstream has applied: + - debian/patches/800_parse_shebang_in_usascii.dpatch + - debian/patches/801_too_strict_encoding_check.dpatch + - debian/patches/802_hash_compare_by_identity.dpatch + - debian/patches/803_syntaxerror_irb_bug.dpatch + - debian/patches/804_debug.rb_is_bloken.dpatch + - debian/patches/805_webrick_file_access_vulnerability.dpatch + * removed patches since this package no longer provides rubygems. + - debian/patches/910_gem_prelude.dpatch + - debian/patches/911_default_gem_path.dpatch + - debian/patches/913_disable_update_system.dpatch + - debian/patches/917_avoid_ioseek.dpatch + - debian/patches/918_tighter_search_regex.dpatch + * Added debian/patches/101_parse_rb.dpatch: RDoc might have failed to parse. + * Added debian/patches/102_skip_test_copy_stream.dpatch: skip a test + + -- Daigo Moriwaki Sat, 21 Jun 2008 16:02:58 +0900 + +ruby1.9 (1.9.0.1-5) experimental; urgency=low + + * The gem1.9 package is removed. Use rubygems1.9 instead. + + -- Daigo Moriwaki Sun, 08 Jun 2008 22:58:14 +0900 + +ruby1.9 (1.9.0.1-4) experimental; urgency=low + + * Improved 919_common.mk_tweaks.dpatch: outputs the result of "ps" on a + regular basis, so the build doesn't timeout on slow arches like mips(el). + * Move gem1.9 to a seperate package. This is necessary because gem1.9 + requires rdoc1.9 (see + https://bugs.launchpad.net/ubuntu/+source/ruby1.9/+bug/228345 ), so there + are two solutions: + - keep gem1.9 in ruby1.9, and merge back rdoc1.9. This cause people + interested in running ruby apps (not developing ruby scripts) to install + lots of unnecessary stuff. + - move rubygems to a separate package. + + -- Lucas Nussbaum Sat, 24 May 2008 11:25:34 +0200 + +ruby1.9 (1.9.0.1-3) experimental; urgency=low + + * Add uname and /proc/cpuinfo output to the build log. + * Added 919_common.mk_tweaks.dpatch: build more + verbosely. Needed to avoid a timeout on mips(el). + * Added 904_linux_target_os.dpatch from Ubuntu. Robustifies check for + target_os. + * debian/rules: Improved substitutions in arch_name (also from Ubuntu). + + -- Lucas Nussbaum Sat, 17 May 2008 18:04:13 +0200 + +ruby1.9 (1.9.0.1-2) experimental; urgency=low + + * Build with -O2 everywhere by default. + * Upload to experimental to see how things work out. + + -- Lucas Nussbaum Wed, 07 May 2008 15:45:40 +0200 + +ruby1.9 (1.9.0.1-1) unstable; urgency=low + + [ akira yamada ] + * new upstream snapshot 1.9.0-1. + * debian/generated-incs/*: updated. + * applied some bug fix patches: + - 800_parse_shebang_in_usascii: [ruby-dev:33955] --encoding affects script + encoding + - 801_too_strict_encoding_check: [ruby-dev:33966] remove too strict + encoding check + - 802_hash_compare_by_identity: [ruby-dev:33989] Hash#compare_by_identity + breaks commutativity of Hash#== + - 803_syntaxerror_irb_bug: [ruby-dev:33991] SyntaxError should not be + considered as IRB bug + - 804_debug.rb_is_bloken: [ruby-dev:33992] debug.rb causes NoMethodError + - 805_webrick_file_access_vulnerability: fixes vulnerbility of WEBrick + which is described at + + - 900_ri_pager: updated. + + [ Lucas Nussbaum ] + * debian/control: Added myself to Uploaders:. + * debian/control: Added Homepage and Vcs-* fields. + * added 909_update_lib_README.dpatch, backported from ruby1.8. + * Improved description of ruby1.9-dev. + * No longer build using gcc-4.1 on m68k. Use the default gcc version. + (Closes: #463294) + * debian/control: bumped Standards-Version to 3.7.3. No changes needed. + * added watch file. + + [ Daigo Moriwaki ] + * debian/control: + - imporoved the description for libopenssl-ruby1.8. + - ruby1.9-dev now depends on libc6-dev. + + -- Lucas Nussbaum Fri, 07 Mar 2008 17:35:14 +0100 + +ruby1.9 (1.9.0.0-2) unstable; urgency=low + + * Added debian/patches/910_gem_prelude.dpatch: changed the default + rubygems home directory in prelude as well. (Closes: #458620) + + -- Daigo Moriwaki Wed, 02 Jan 2008 18:09:03 +0900 + +ruby1.9 (1.9.0.0-1) unstable; urgency=low + + [Akira Yamada] + * new upstream version, 1.9.0-0. (closes: #457519, #446220) + * added manpages for gem1.9 and rake1.9. + * debian/generated-incs/*.inc: updated by files in upstream tarball. + * debian/patches/801_update_sample_README.dpatch: removed. + * debian/patches/903_skip_base_ruby_check.dpatch: updated. + * debian/NEWS, debian/README.Debian: updated. + + [Daigo Moriwaki] + * supported rubygems that has been merged with the upstream. + I imported files and changes from libgems-ruby1.8_1.0.1.deb package. + - added debian/patches/911_default_gem_path.dpatch + - added debian/patches/913_disable_update_system.dpatch + - added debian/patches/918_tighter_search_regex.dpatch + - added debian/patches/917_avoid_ioseek.dpatch + - added debian/libruby1.9.postrm.in + - debian/patches/00list: applied above changes. + - debian/README.Debian: added a note for rubygems + - debian/libruby1.9.postinst.in: script to remove a cache file. + - debian/rules: applied above changes. + + -- akira yamada Wed, 26 Dec 2007 12:46:09 +0900 + +ruby1.9 (1.9.0+20071225-1) unstable; urgency=low + + * new upstream snapshot. (r14640) + * updated debian/generated-incs/* files. + + -- akira yamada Tue, 25 Dec 2007 10:49:38 +0900 + +ruby1.9 (1.9.0+20071016-1) unstable; urgency=high + + * new upstream snapshot. (r13713) + - fixed CVE-2007-5162. + - fixed illegal instructions at runtime on sparc. (closes: #366444) + Thanks to Lucas Nussbaum. + * updated debian/generated-incs/* files. + * debian/rules: fixed wrong arch_name for arm-linux-gnueabi. + (closes: #445433) Thanks to Riku Voipio. + * debian/ruby1.9-elisp.emacsen-startup: uses "\\\\'" for ignore newlines in + filenames. (closes: #446180) Thanks to Trent W. Buck. + * debian/control: added Daigo Moriwaki to uploaders and removed Akira Tagoh + from uploaders. + + -- akira yamada Thu, 18 Oct 2007 09:36:36 +0900 + +ruby1.9 (1.9.0+20070910-1) unstable; urgency=low + + * new upstream snapshot. (r13426) + * debian/rules: added -g option to CPPFLAGS and CXXFLAGS. + + -- akira yamada Tue, 11 Sep 2007 10:46:09 +0900 + +ruby1.9 (1.9.0+20070830-2) unstable; urgency=low + + * configure.in: skip host ruby check. + * debian/generated-incs/prelude.c: added. (closes: #440480) + + -- akira yamada Sun, 02 Sep 2007 09:20:54 +0900 + +ruby1.9 (1.9.0+20070830-1) unstable; urgency=low + + * new upstream snapshot. (r13318) (closes: #426134, #426267) + * updated debian/generated-incs/* files. + * added debian/patches/902_define_YAML_in_yaml_stringio.rb.dpatch. + + -- akira yamada Thu, 30 Aug 2007 13:53:44 +0900 + +ruby1.9 (1.9.0+20070606-1) unstable; urgency=low + + * new upstream snapshot. (2006-06-06) + * updated debian/generated-incs/* files. + + -- akira yamada Wed, 06 Jun 2007 11:58:24 +0900 + +ruby1.9 (1.9.0+20070526-1) unstable; urgency=low + + * new upstream snapshot. (2006-05-26) + + -- akira yamada Sat, 26 May 2007 21:02:58 +0900 + +ruby1.9 (1.9.0+20070523-1) unstable; urgency=low + + * new upstream snapshot. (2006-07-23) + * added debian/generated-incs/* files: They are are generated by "make + incs". Updating these files is needed when the source is updated. + (Closes: #425607) + + -- akira yamada Wed, 23 May 2007 13:21:02 +0900 + +ruby1.9 (1.9.0+20070521-1) unstable; urgency=low + + * new upstream snapshot. (2006-07-21) (Closes: #414856, #388344) + + -- akira yamada Mon, 21 May 2007 14:00:19 +0900 + +ruby1.9 (1.9.0+20060609-1) unstable; urgency=low + + * new upstream snapshot. (2006-06-09) + * configure with -fno-strict-aliasing (Bug#370553) + * rdoc1.9 suggests graphviz (Bug#339524) + * debian/copyright: added a note for using libopenssl-ruby1.9. (Bug#367024) + * debian/README.Debian: updated. (Closes: #344294) + * added debian/patches/802_mkconfig.dpatch + + -- akira yamada Thu, 13 Jul 2006 22:43:47 +0900 + +ruby1.9 (1.9.0+20060423-4) unstable; urgency=low + + * reverted to 1.9.0+20060423-3. + - 1.9.0+20060423-3.1 is not enough to fix the probleam and + - 1.9.0+20060423-3.1 ignores dpatch :-< + + -- akira yamada Thu, 7 Jul 2006 22:44:23 +0900 + +ruby1.9 (1.9.0+20060423-3.1) unstable; urgency=low + + * Non-maintainer upload. + * Make mkconfig.rb understand autoconf >2.59a's new way of doing + config.status; it inserts #|_!!_|# into the sed lines temporarily, then + removes them at the end. Since mkconfig.rb only parses these lines instead + of executing the entire sed script, it has to remove #|_!!_|# by itself. + This fixes FTBFS with newer autoconf. (Closes: #373953) + + -- Steinar H. Gunderson Sun, 25 Jun 2006 16:05:24 +0200 + +ruby1.9 (1.9.0+20060423-3) unstable; urgency=low + + * akira yamada + - debian/control, debian/rules: uses gcc-4.1 for m68k. (Closes: #360745) + + -- akira yamada Tue, 25 Apr 2006 23:00:39 +0900 + +ruby1.9 (1.9.0+20060423-2) unstable; urgency=medium + + * akira yamada + - debian/rules: CFLAGS=-O0 for avoiding a bug of gcc-4.0 on m68k. + (Closes: #360745) + + -- akira yamada Tue, 25 Apr 2006 12:46:34 +0900 + +ruby1.9 (1.9.0+20060423-1) unstable; urgency=low + + * akira yamada + - new upstream snapshot. (2006-04-23) + + -- akira yamada Sun, 23 Apr 2006 18:14:31 +0900 + +ruby1.9 (1.9.0+20050921-1) unstable; urgency=high + + * akira yamada + - new upstream snapshot. (2005-09-21) + - [security] JVN#62914675 CVE-2005-2337 + - preserve safe level in the environment where a method is defined. + - prohibit calling tainted method (>2) when $SAFE == 0. + - removed debian/patches/802_workaround_for_send.dpatch: + - the patch is in upstream. + - debian/control: build-depends on libreadline5-dev. (closes: #326333) + + -- akira yamada Wed, 21 Sep 2005 13:16:19 +0900 + +ruby1.9 (1.9.0+20050902-1) unstable; urgency=high + + * akira yamada + - new upstream snapshot. (2005-09-02) + - [security] preserve safe level in the environment where a method is + defined. + - added debian/patches/802_workaround_for_send.dpatch: + - workaround for changed behavior of __send__. [ruby-dev:26935] + + -- akira yamada Fri, 2 Sep 2005 15:21:10 +0900 + +ruby1.9 (1.9.0+20050727-1) unstable; urgency=low + + * akira yamada + - new upstream snapshot. (2005-07-27) + - removed debian/patches/803_runruby.rb_loadpath.dpatch: + - the patch is in upstream source. + + -- akira yamada Wed, 3 Aug 2005 19:56:18 +0900 + +ruby1.9 (1.9.0+20050623-2) unstable; urgency=high + + * akira yamada + - debian/rules: supported to build with dpkg-dev_1.13. + (ref: ) + - changed arch-name for Ruby to i486-linux from i386-linux because + DEB_BUILD_GNU_TYPE is changed to i486-linux-gnu from i386-linux. + - (urgency high) used -linux instead of -linux-gnu for paths + in debian/*.files. (ref: Bug#315566) + - added patches/902_extra_search_path.patch: + - temporally added "/usr/local/lib/site_ruby/1.8/i386-linux" and + "/usr/lib/ruby/1.8/i386-linux" as extra search paths to Ruby on ix86 + arch. + - added debian/NEWS. + + -- akira yamada Wed, 29 Jun 2005 23:53:01 +0900 + +ruby1.9 (1.9.0+20050623-1) unstable; urgency=high + + * akira yamada + - new upstream snapshot. + - (urgency high) fixed arbitrary command execution on XMLRPC server. + [ruby-core:5237] (see: CAN-2005-1992, Bug#315064) + - added debian/patches/803_runruby.rb_loadpath.dpatch: + - runruby.rb should require rbconfig.rb in source directory. + (it is for make install-doc.) + + -- akira yamada Thu, 23 Jun 2005 20:33:03 +0900 + +ruby1.9 (1.9.0+20050412-4) unstable; urgency=low + + * akira yamada + - debian/rules: CFLAGS=-O0 is for ia64 not for i386. + + -- akira yamada Sun, 17 Apr 2005 03:30:22 +0900 + +ruby1.9 (1.9.0+20050412-3) unstable; urgency=high + + * akira yamada + - debian/rules: fixed wrong filename conversion. (closes: #304809) + - debian/libruby1.9.*.in: should not be empty. + + -- akira yamada Sat, 16 Apr 2005 01:44:05 +0900 + +ruby1.9 (1.9.0+20050412-2) unstable; urgency=high + + * akira yamada + - debian/rules: binary-install/ should contain dh_movefiles + only, because "debian/rules binary-arch" cannot create some directories. + + -- akira yamada Fri, 15 Apr 2005 06:47:44 +0900 + +ruby1.9 (1.9.0+20050412-1) unstable; urgency=low + + * akira yamada + - uploaded to Debian. (closes: #256004) + + -- akira yamada Wed, 13 Apr 2005 18:06:34 +0900 + +ruby1.9 (1.9.0+20050412-0+1) unstable; urgency=low + + * akira yamada + - initial packaging. + + -- akira yamada Wed, 13 Apr 2005 07:28:16 +0900 + --- ruby1.9-1.9.0.5.orig/debian/ruby1.9-elisp.emacsen-remove +++ ruby1.9-1.9.0.5/debian/ruby1.9-elisp.emacsen-remove @@ -0,0 +1,15 @@ +#!/bin/sh -e +# /usr/lib/emacsen-common/packages/remove/ruby-beta-elisp + +FLAVOR=$1 +PACKAGE=ruby1.9-elisp + +if [ ${FLAVOR} != emacs ]; then +# if test -x /usr/sbin/install-info-altdir; then +# echo remove/${PACKAGE}: removing Info links for ${FLAVOR} +# install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/ruby.info.gz +# fi + + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi --- ruby1.9-1.9.0.5.orig/debian/irb1.9.menu +++ ruby1.9-1.9.0.5/debian/irb1.9.menu @@ -0,0 +1 @@ +?package(irb1.9):needs="text" section="Applications/Programming" title="Ruby (irb1.9)" command="/usr/bin/irb1.9" --- ruby1.9-1.9.0.5.orig/debian/copyright +++ ruby1.9-1.9.0.5/debian/copyright @@ -0,0 +1,81 @@ +This package was debianized by akira yamada on +Sun, 13 Apr 2003 13:04:13 +0900. + +It was downloaded from + +Upstream Author: Yukihiro Matsumoto + +Copyright: + +Ruby's License: + +Ruby is copyrighted free software by Yukihiro Matsumoto . +You can redistribute it and/or modify it under either the terms of the GPL +(see the file GPL), or the conditions below: + + 1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. + + 2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. + + b) use the modified software only within your corporation or + organization. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 3. You may distribute the software in object code or binary form, + provided that you do at least ONE of the following: + + a) distribute the binaries and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. + + b) accompany the distribution with the machine-readable source of + the software. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 4. You may modify and include the part of the software into any other + software (possibly commercial). But some files in the distribution + are not written by the author, so that they are not under these terms. + + For the list of those files and their copying conditions, see the + file LEGAL. + + 5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. + + 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. + + +GNU General Public License: + +On Debian systems, the complete text of the GNU General Public License can +be found in `/usr/share/common-licenses/GPL'. + + +Note for using libopenssl-ruby1.9 (openssl.so): + +Ruby is distributed under dual-license which is "Ruby's License" or GPL. +libopenssl-ruby1.9 (openssl.so) can link OpenSSL library with ruby1.9 +(libruby1.9). So we cannot use openssl.so together with programs which are +under the standard unmodified GPL. --- ruby1.9-1.9.0.5.orig/debian/rdoc1.9.1 +++ ruby1.9-1.9.0.5/debian/rdoc1.9.1 @@ -0,0 +1,210 @@ +.\" DO NOT MODIFY THIS FILE! it was generated by rd2 +.TH rdoc1.9 1 "May 2007" +.SH NAME +.PP +rdoc1.9 \- Generate documentation from Ruby script files +.SH SYNOPSIS +.nf +\& rdoc1.9 [options] [names...] +.fi +.SH DESCRIPTION +.PP +Files are parsed, and the information they contain collected, before any +output is produced. This allows cross references between all files to be +resolved. If a name is a directory, it is traversed. If no names are +specified, all Ruby files in the current directory (and subdirectories) are +processed. +.PP +Available output formatters: chm, html, ri, xml +.PP +For information on where the output goes, use: +.nf +\& rdoc \-\-help\-output +.fi +.SH OPTIONS +.TP +.fi +.B +\-\-accessor, \-A accessorname[,..] +comma separated list of additional class methods that should be treated +like 'attr_reader' and friends. Option may be repeated. Each accessorname +may have '=text' appended, in which case that text appears where the +r/w/rw appears for normal accessors. +.TP +.fi +.B +\-\-all, \-a +include all methods (not just public) in the output. +.TP +.fi +.B +\-\-charset, \-c charset +specifies HTML character\-set +.TP +.fi +.B +\-\-debug, \-D +displays lots on internal stuff +.TP +.fi +.B +\-\-diagram, \-d +generate diagrams showing modules and classes. You need dot V1.8.6 or +later to use the \-\-diagram option correctly. Dot is available from +. +.TP +.fi +.B +\-\-exclude, \-x pattern +do not process files or directories matching pattern. Files given +explicitly on the command line will never be excluded. +.TP +.fi +.B +\-\-extension, \-E new=old +treat files ending with .new as if they ended with .old. Using '\-E cgi=rb' +will cause xxx.cgi to be parsed as a Ruby file +.TP +.fi +.B +\-\-fileboxes, \-F +classes are put in boxes which represents files, where these classes +reside. Classes shared between more than one file are shown with list of +files that sharing them. Silently discarded if \-\-diagram is not given +Experimental. +.TP +.fi +.B +\-\-fmt, \-f formatname +set the output formatter (see below). +.TP +.fi +.B +\-\-help, \-h +print usage. +.TP +.fi +.B +\-\-help\-output, \-O +explain the various output options. +.TP +.fi +.B +\-\-image\-format, \-I gif|png|jpg|jpeg +sets output image format for diagrams. Can be png, gif, jpeg, jpg. If this +option is omitted, png is used. Requires \-\-diagram. +.TP +.fi +.B +\-\-include, \-i dir[,dir...] +set (or add to) the list of directories to be searched when satisfying +:include: requests. Can be used more than once. +.TP +.fi +.B +\-\-inline\-source, \-S +show method source code inline, rather than via a popup link. +.TP +.fi +.B +\-\-line\-numbers, \-N +include line numbers in the source code +.TP +.fi +.B +\-\-main, \-m name +name will be the initial page displayed. +.TP +.fi +.B +\-\-merge, \-M +when creating ri output, merge processed classes into previously +documented classes of the name name. +.TP +.fi +.B +\-\-one\-file, \-1 +put all the output into a single file. +.TP +.fi +.B +\-\-op, \-o dir +set the output directory. +.TP +.fi +.B +\-\-opname, \-n name +set the name of the output. Has no effect for HTML. +.TP +.fi +.B +\-\-promiscuous, \-p +When documenting a file that contains a module or class also defined in +other files, show all stuff for that module/class in each files page. By +default, only show stuff defined in that particular file. +.TP +.fi +.B +\-\-quiet, \-q +don't show progress as we parse. +.TP +.fi +.B +\-\-ri, \-r +generate output for use by 'ri.' The files are stored in the '.rdoc' +directory under your home directory unless overridden by a subsequent \-\-op +parameter, so no special privileges are needed. +.TP +.fi +.B +\-\-ri\-site, \-R +generate output for use by 'ri.' The files are stored in a site\-wide +directory, making them accessible to others, so special privileges are +needed. +.TP +.fi +.B +\-\-ri\-system, \-Y +generate output for use by 'ri.' The files are stored in a system\-level +directory, making them accessible to others, so special privileges are +needed. This option is intended to be used during Ruby installations. +.TP +.fi +.B +\-\-show\-hash, \-H +a name of the form #name in a comment is a possible hyperlink to an +instance method name. When displayed, the '#' is removed unless this +option is specified. +.TP +.fi +.B +\-\-style, \-s stylesheet\-url +specifies the URL of a separate stylesheet. +.TP +.fi +.B +\-\-tab\-width, \-w n +set the width of tab characters (default 8). +.TP +.fi +.B +\-\-template, \-T template\-name +set the template used when generating output. +.TP +.fi +.B +\-\-title, \-t text +set text as the title for the output. +.TP +.fi +.B +\-\-version, \-v +display RDoc's version. +.TP +.fi +.B +\-\-webcvs, \-W url +specify a URL for linking to a web frontend to CVS. If the URL contains a +'%s', the name of the current file will be substituted; if the URL doesn't +contain a '%s', the filename will be appended to it. + --- ruby1.9-1.9.0.5.orig/debian/rake1.9.1 +++ ruby1.9-1.9.0.5/debian/rake1.9.1 @@ -0,0 +1,24 @@ +.TH RAKE1.9 "1" "July 2006" "ruby 1.9.0" "User Commands" +.SH NAME +rake1.9 \- a ruby build program with capabilities similar to make +.SH SYNOPSIS +.IP +rake1.9 [-f rakefile] [options] targets... +.IP +rake1.9 \-\-help +.IP +rake1.9 \-\-version +.fi +.SH DESCRIPTION +.B rake1.9 +is a simple ruby build program with capabilities similar to make. +This is a basic help message containing pointers to more information. +.PP +Further help: +.TP +rake1.9 --help +list all 'rake1.9' options +.PP +Further information: +.IP +http://rake.rubyforge.org/ --- ruby1.9-1.9.0.5.orig/debian/extfixup_examples.sh +++ ruby1.9-1.9.0.5/debian/extfixup_examples.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +pkg_name="$1" +ext_dir="$2" + +for f in `find "$ext_dir" -name '*.rb' -type f -not -name 'extconf.rb' -not -path ' */lib/*'` +do + dh_installexamples -p"$pkg_name" $f +done + --- ruby1.9-1.9.0.5.orig/debian/rdoc1.9.rd +++ ruby1.9-1.9.0.5/debian/rdoc1.9.rd @@ -0,0 +1,147 @@ +=begin += NAME + +rdoc1.9 - Generate documentation from Ruby script files + += SYNOPSIS + + rdoc1.9 [options] [names...] + += DESCRIPTION + +Files are parsed, and the information they contain collected, before any +output is produced. This allows cross references between all files to be +resolved. If a name is a directory, it is traversed. If no names are +specified, all Ruby files in the current directory (and subdirectories) are +processed. + +Available output formatters: chm, html, ri, xml + +For information on where the output goes, use: + + rdoc --help-output + += OPTIONS + +: --accessor, -A ((|accessorname[,..]|)) + comma separated list of additional class methods that should be treated + like 'attr_reader' and friends. Option may be repeated. Each accessorname + may have '=text' appended, in which case that text appears where the + r/w/rw appears for normal accessors. + +: --all, -a + include all methods (not just public) in the output. + +: --charset, -c ((|charset|)) + specifies HTML character-set + +: --debug, -D + displays lots on internal stuff + +: --diagram, -d + generate diagrams showing modules and classes. You need dot V1.8.6 or + later to use the --diagram option correctly. Dot is available from + (()). + +: --exclude, -x ((|pattern|)) + do not process files or directories matching pattern. Files given + explicitly on the command line will never be excluded. + +: --extension, -E ((|new|))=((|old|)) + treat files ending with .new as if they ended with .old. Using '-E cgi=rb' + will cause xxx.cgi to be parsed as a Ruby file + +: --fileboxes, -F + classes are put in boxes which represents files, where these classes + reside. Classes shared between more than one file are shown with list of + files that sharing them. Silently discarded if --diagram is not given + Experimental. + +: --fmt, -f ((|formatname|)) + set the output formatter (see below). + +: --help, -h + print usage. + +: --help-output, -O + explain the various output options. + +: --image-format, -I ((|(('gif|png|jpg|jpeg'))|)) + sets output image format for diagrams. Can be png, gif, jpeg, jpg. If this + option is omitted, png is used. Requires --diagram. + +: --include, -i ((|dir[,dir...]|)) + set (or add to) the list of directories to be searched when satisfying + ((':include:')) requests. Can be used more than once. + +: --inline-source, -S + show method source code inline, rather than via a popup link. + +: --line-numbers, -N + include line numbers in the source code + +: --main, -m ((|name|)) + ((|name|)) will be the initial page displayed. + +: --merge, -M + when creating ri output, merge processed classes into previously + documented classes of the name name. + +: --one-file, -1 + put all the output into a single file. + +: --op, -o ((|dir|)) + set the output directory. + +: --opname, -n ((|name|)) + set the ((|name|)) of the output. Has no effect for HTML. + +: --promiscuous, -p + When documenting a file that contains a module or class also defined in + other files, show all stuff for that module/class in each files page. By + default, only show stuff defined in that particular file. + +: --quiet, -q + don't show progress as we parse. + +: --ri, -r + generate output for use by 'ri.' The files are stored in the '.rdoc' + directory under your home directory unless overridden by a subsequent --op + parameter, so no special privileges are needed. + +: --ri-site, -R + generate output for use by 'ri.' The files are stored in a site-wide + directory, making them accessible to others, so special privileges are + needed. + +: --ri-system, -Y + generate output for use by 'ri.' The files are stored in a system-level + directory, making them accessible to others, so special privileges are + needed. This option is intended to be used during Ruby installations. + +: --show-hash, -H + a name of the form #name in a comment is a possible hyperlink to an + instance method name. When displayed, the '#' is removed unless this + option is specified. + +: --style, -s ((|stylesheet-url|)) + specifies the URL of a separate stylesheet. + +: --tab-width, -w ((|n|)) + set the width of tab characters (default 8). + +: --template, -T ((|template-name|)) + set the template used when generating output. + +: --title, -t ((|text|)) + set ((|text|)) as the title for the output. + +: --version, -v + display RDoc's version. + +: --webcvs, -W ((|url|)) + specify a URL for linking to a web frontend to CVS. If the URL contains a + '%s', the name of the current file will be substituted; if the URL doesn't + contain a '%s', the filename will be appended to it. + +=end --- ruby1.9-1.9.0.5.orig/debian/libruby1.9.postinst.in +++ ruby1.9-1.9.0.5/debian/libruby1.9.postinst.in @@ -0,0 +1,50 @@ +#! /bin/sh +# postinst script for ruby +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + if [ -w /usr/local/lib -a ! -e /usr/local/lib/site_ruby/@@verdir@@ ] + then + mkdir -p /usr/local/lib/site_ruby/@@verdir@@/@@arch@@ 2>/dev/null || true + chown root:staff /usr/local/lib/site_ruby/@@verdir@@/@@arch@@ 2>/dev/null || true + chmod 2775 /usr/local/lib/site_ruby/@@verdir@@/@@arch@@ 2>/dev/null || true + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- ruby1.9-1.9.0.5.orig/debian/README.Debian +++ ruby1.9-1.9.0.5/debian/README.Debian @@ -0,0 +1,59 @@ +Ruby 1.9 for Debian GNU/Linux +----------------------------- + +This is Ruby 1.9 package for Debian GNU/Linux. + +Ruby is the interpreted scripting language for quick and easy +object-oriented programming. It has many features to process text files and +to do system management tasks (as in perl). It is simple, straight-forward, +and extensible. + +Ruby 1.9.0 is the development version of Ruby. + +Homepage of Ruby is: + + (English and Japanese) + +And you can find helpful library or tools from RAA: + + (English) + + +For Debian users: + + * You can use /usr/bin/ruby1.9. + + * ``sitedir'' is /usr/local/lib/site_ruby, so ``$:'' (or ``$LOAD_PATH'') + contains the following: + + ["/usr/local/lib/site_ruby/1.9.0", + "/usr/local/lib/site_ruby/1.9.0/i486-linux", + "/usr/local/lib/site_ruby/1.9/i386-linux", + "/usr/local/lib/site_ruby", + "/usr/lib/ruby/vendor_ruby/1.9.0", + "/usr/lib/ruby/vendor_ruby/1.9.0/i486-linux", + "/usr/lib/ruby/vendor_ruby", + "/usr/lib/ruby/1.9.0", + "/usr/lib/ruby/1.9.0/i486-linux", + "/usr/lib/ruby/1.9/i386-linux", + "."] + + ("1.9.0" means "#{major}.#{minor}.#{teeny}" and "i486-linux" means "#{arch}-#{os}".) + + * Debian ruby policy is available in /usr/share/doc/ruby/ruby-policy.txt.gz + (ruby package) + + * Some libraries are in sub-packages. + * irb1.9 - irb program and libraries + * ri1.9 - ri program + * rdoc1.9 - rdoc program and libraries + * libdbm-ruby1.9 - dbm.so + * libdbm-gruby1.9 - gdbm.so + * libreadline-ruby1.9 - readline.so + * libtcltk-ruby1.9 - tkutil.so, tcltklib.so and related libraries + * libopenssl-ruby1.9 - openssl.so and libraries which use openssl + * ruby1.9-dev - header files and mkmf.rb. + * ruby1.9-elisp - ruby-mode, etc + * ruby1.9-examples - example programs + + -- akira yamada , Thu, 25 Dec 2007 15:44:00 +0900 --- ruby1.9-1.9.0.5.orig/debian/rmshebang.sh +++ ruby1.9-1.9.0.5/debian/rmshebang.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +target_dir=$1 +for f in `find "$target_dir" -name '*.rb' -type f 2>/dev/null` +do + sed -e '1,1{ + /^#!/d + }' < $f > $f.tmp + if ! cmp $f $f.tmp >/dev/null + then + mv -f $f.tmp $f + else + rm -f $f.tmp + fi +done --- ruby1.9-1.9.0.5.orig/debian/compat +++ ruby1.9-1.9.0.5/debian/compat @@ -0,0 +1 @@ +7 --- ruby1.9-1.9.0.5.orig/debian/ruby1.9-elisp.emacsen-install +++ ruby1.9-1.9.0.5/debian/ruby1.9-elisp.emacsen-install @@ -0,0 +1,45 @@ +#! /bin/sh -e +# /usr/lib/emacsen-common/packages/install/ruby-beta-elisp + +# Written by Jim Van Zandt , borrowing heavily +# from the install scripts for gettext by Santiago Vila +# and octave by Dirk Eddelbuettel . + +FLAVOR=$1 +PACKAGE=ruby1.9-elisp + +if [ ${FLAVOR} = emacs ]; then exit 0; fi + +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} + +FLAVORTEST=`echo $FLAVOR | cut -c-6` +if [ ${FLAVORTEST} = xemacs ] ; then + SITEFLAG="-no-site-file" +else + SITEFLAG="--no-site-file" +fi +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +# Install-info-altdir does not actually exist. +# Maybe somebody will write it. +#if test -x /usr/sbin/install-info-altdir; then +# echo install/${PACKAGE}: install Info links for ${FLAVOR} +# install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz +#fi + +install -m 755 -d ${ELCDIR} +cd ${ELDIR} +FILES=`echo *.el` +cp ${FILES} ${ELCDIR} +cd ${ELCDIR} + +cat << EOF > path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF +${FLAVOR} ${FLAGS} ${FILES} +rm -f *.el path.el + +exit 0 --- ruby1.9-1.9.0.5.orig/debian/watch +++ ruby1.9-1.9.0.5/debian/watch @@ -0,0 +1,5 @@ +version=3 + +opts="pasv,uversionmangle=s/-p/\./" \ +ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-(1\.9\..*)-(\d*)\.tar\.gz debian uupdate + --- ruby1.9-1.9.0.5.orig/debian/ri1.9.rd +++ ruby1.9-1.9.0.5/debian/ri1.9.rd @@ -0,0 +1,68 @@ +=begin += NAME + +ri1.9 - Ruby Information at your fingertips + += SYNOPSIS + +ri1.9 [options] [names...] + += DESCRIPTION + +((*ri1.9*)) displaies information on Ruby classes, modules, and methods. +You can give the names of classes or methods to see their documentation. +Partial names may be given: if the names match more than +one entity, a list will be shown, otherwise details on +that entity will be displayed. + +Nested classes and modules can be specified using the normal +Name::Name notation, and instance methods can be distinguished +from class methods using "." (or "#") instead of "::". + +For example: + + ri1.9 File + ri1.9 File.new + ri1.9 F.n + ri1.9 zip + +Note that shell quoting may be required for method names +containing punctuation: + + ri1.9 'Array.[]' + ri1.9 compact\! + += OPTIONS + +: --classes, -c + Display the names of classes and modules we know about. + +: --doc-dir, -d ((|dirname|)) + A directory to search for documentation. If not specified, we search the + standard rdoc/ri directories. + +: --format, -f ((|name|)) + Format to use when displaying output: ansi, bs, html, plain, simple. Use + 'bs' (backspace) with most pager programs. To use ANSI, either also use + the -T option, or tell your pager to allow control characters. (for + example using the -R option to less.) + +: --list-names, -l + List all the names known to RDoc, one per line. + +: --no-pager, -T + Send output directly to stdout. + +: --width, -w ((|width|)) + Set the width of the output. + +: --version, -v + Display the version of ri1.9. + +: --help, -h + Display help. + +Options may also be passed in the 'RI' environment variable + + +=end --- ruby1.9-1.9.0.5.orig/debian/ruby1.9-elisp.emacsen-startup +++ ruby1.9-1.9.0.5/debian/ruby1.9-elisp.emacsen-startup @@ -0,0 +1,31 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file for the Debian GNU/Linux ruby package +;; +;; Originally contributed by Nils Naumann +;; Modified by Dirk Eddelbuettel +;; Adapted for dh-make by Jim Van Zandt + +;; The ruby package follows the Debian/GNU Linux 'emacsen' policy and +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, +;; xemacs19, emacs20, xemacs20...). The compiled code is then +;; installed in a subdirectory of the respective site-lisp directory. +;; We have to add this to the load-path: +(setq load-path (cons (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/ruby1.9-elisp") load-path)) + +(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t) +(setq auto-mode-alist + (cons '("\\.rb\\'" . ruby-mode) auto-mode-alist)) +(setq interpreter-mode-alist + (cons '("ruby" . ruby-mode) interpreter-mode-alist)) + +(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process") +(autoload 'inf-ruby-keys "inf-ruby" + "Set local key defs for inf-ruby in ruby-mode") + +(add-hook 'ruby-mode-hook + '(lambda () + (inf-ruby-keys) + )) --- ruby1.9-1.9.0.5.orig/debian/ri1.9.1 +++ ruby1.9-1.9.0.5/debian/ri1.9.1 @@ -0,0 +1,82 @@ +.\" DO NOT MODIFY THIS FILE! it was generated by rd2 +.TH ri1.9 1 "April 2005" +.SH NAME +.PP +ri1.9 \- Ruby Information at your fingertips +.SH SYNOPSIS +.PP +ri1.9 [options] [names...] +.SH DESCRIPTION +.PP +\fIri1.9\fP displaies information on Ruby classes, modules, and methods. +You can give the names of classes or methods to see their documentation. +Partial names may be given: if the names match more than +one entity, a list will be shown, otherwise details on +that entity will be displayed. +.PP +Nested classes and modules can be specified using the normal +Name::Name notation, and instance methods can be distinguished +from class methods using "." (or "#") instead of "::". +.PP +For example: +.nf +\& ri1.9 File +\& ri1.9 File.new +\& ri1.9 F.n +\& ri1.9 zip +.fi +.PP +Note that shell quoting may be required for method names +containing punctuation: +.nf +\& ri1.9 'Array.[]' +\& ri1.9 compact\\! +.fi +.SH OPTIONS +.TP +.fi +.B +\-\-classes, \-c +Display the names of classes and modules we know about. +.TP +.fi +.B +\-\-doc\-dir, \-d dirname +A directory to search for documentation. If not specified, we search the +standard rdoc/ri directories. +.TP +.fi +.B +\-\-format, \-f name +Format to use when displaying output: ansi, bs, html, plain, simple. Use +'bs' (backspace) with most pager programs. To use ANSI, either also use +the \-T option, or tell your pager to allow control characters. (for +example using the \-R option to less.) +.TP +.fi +.B +\-\-list\-names, \-l +List all the names known to RDoc, one per line. +.TP +.fi +.B +\-\-no\-pager, \-T +Send output directly to stdout. +.TP +.fi +.B +\-\-width, \-w width +Set the width of the output. +.TP +.fi +.B +\-\-version, \-v +Display the version of ri1.9. +.TP +.fi +.B +\-\-help, \-h +Display help. +.PP +Options may also be passed in the 'RI' environment variable + --- ruby1.9-1.9.0.5.orig/debian/control +++ ruby1.9-1.9.0.5/debian/control @@ -0,0 +1,159 @@ +Source: ruby1.9 +Section: ruby +Priority: optional +Maintainer: akira yamada +Uploaders: Daigo Moriwaki , Lucas Nussbaum +Build-Depends: debhelper (>= 7.0.0), cdbs, dpatch, patch, autoconf, m4, bison, binutils (>= 2.14.90.0.7), libgdbm-dev, libncurses5-dev, libreadline5-dev, tcl8.4-dev, tk8.4-dev, zlib1g-dev, libssl-dev (>= 0.9.6b), procps, file +Build-Conflicts: gcc-3.3 (<< 1:3.3.2-0pre1) +Standards-Version: 3.8.2 +Homepage: http://www.ruby-lang.org/ +Vcs-Browser: http://svn.debian.org/wsvn/pkg-ruby/ruby1.9/trunk/ +Vcs-Svn: svn://svn.debian.org/pkg-ruby/ruby1.9/trunk/ + +Package: ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Suggests: ruby1.9-examples, rdoc1.9, ri1.9, rubygems1.9 +Description: Interpreter of object-oriented scripting language Ruby 1.9 + Ruby is the interpreted scripting language for quick and easy + object-oriented programming. It has many features to process text + files and to do system management tasks (as in perl). It is simple, + straight-forward, and extensible. + . + This package provides version 1.9 series of Ruby. + . + NOTE: Ruby 1.9.0 is the development version. + +Package: libruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Libraries necessary to run Ruby 1.9 + Ruby is the interpreted scripting language for quick and easy + object-oriented programming. It has many features to process text + files and to do system management tasks (as in perl). It is simple, + straight-forward, and extensible. + . + This package includes the libruby, necessary to run Ruby 1.9. + +Package: libruby1.9-dbg +Section: debug +Priority: extra +Architecture: any +Depends: ${misc:Depends}, libruby1.9 (= ${binary:Version}) +Description: Debugging symbols for Ruby 1.9 + Contains debugging symbols for libruby1.9. + . + This package is provided primarily to provide a backtrace with names + in a debugger, this makes it somewhat easier to interpret core + dumps. Most people will not need this package. + +Package: ruby1.9-dev +Architecture: any +Depends: ${misc:Depends}, libruby1.9 (= ${binary:Version}), libc6-dev +Recommends: ruby1.9 (= ${binary:Version}) +Description: Header files for compiling extension modules for the Ruby 1.9 + Ruby is the interpreted scripting language for quick and easy + object-oriented programming. It has many features to process text + files and to do system management tasks (as in perl). It is simple, + straight-forward, and extensible. + . + This package contains the header files and the mkmf library, necessary + to make extension library for Ruby 1.9. + +Package: libdbm-ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: DBM interface for Ruby 1.9 + This package provides an extension library "dbm" for Ruby 1.9. The + library makes Ruby programs to be able to access to a DBM file. + . + On Debian, the extension library is built with GDBM. + +Package: libgdbm-ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: GDBM interface for Ruby 1.9 + This package provides an extension library "gdbm" for Ruby 1.9. The + library makes Ruby 1.9 programs to be able to access to a DBM file. + +Package: libreadline-ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Readline interface for Ruby 1.9 + This package provides an extension library "readline" for Ruby 1.9. + The library makes Ruby programs to be able to use functions (line + editing, history, completion, etc.) of the readline library(3). + +Package: libtcltk-ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Tcl/Tk interface for Ruby 1.9 + tcltklib is an extension library for Ruby 1.9. It makes Ruby 1.9 + programs to be able to use low level interface for the Tcl/Tk. + +Package: libopenssl-ruby1.9 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OpenSSL interface for Ruby 1.9 + This package provides OpenSSL support for Ruby 1.9. It includes SSL and + TLS support for the HTTP and TELNET protocols. + +Package: ruby1.9-examples +Architecture: all +Suggests: ${misc:Depends}, ruby1.9 (>= ${source:Version}) +Description: Examples for Ruby 1.9 + This package provides example programs about Ruby 1.9. + . + Ruby is the interpreted scripting language for quick and easy + object-oriented programming. It has many features to process text + files and to do system management tasks (as in perl). It is simple, + straight-forward, and extensible. + +Package: ruby1.9-elisp +Architecture: all +Depends: ${misc:Depends}, emacs22 | emacsen +Suggests: ruby1.9 (>= ${source:Version}), irb1.9 (>= ${source:Version}) +Conflicts: ruby-elisp (<< 1.8), ruby1.6-elisp, ruby1.7-elisp, ruby-beta-elisp, ruby1.8-elisp +Description: ruby-mode for Emacsen + This package provides major-mode for editing Ruby scripts and some + emacs-lisp programs for Ruby programmers. + +Package: ri1.9 +Priority: optional +Architecture: all +Depends: ${misc:Depends}, ruby1.9, rdoc1.9 (= ${source:Version}) +Description: Ruby Interactive reference (for Ruby 1.9) + ri is a command line tool that displays descriptions of built-in Ruby + methods, classes, and modules. For methods, it shows you the calling + sequence and a description. For classes and modules, it shows a + synopsis along with a list of the methods the class or module + implements. + . + This package provides ri command and descriptions about Ruby 1.9. + +Package: rdoc1.9 +Section: doc +Architecture: all +Depends: ${misc:Depends}, ruby1.9 (>= ${source:Version}), irb1.9 (>= ${source:Version}), libruby1.9 (>= ${source:Version}) +Suggests: graphviz +Description: Generate documentation from Ruby source files (for Ruby 1.9) + RDoc - Documentation from Ruby Source Files: + * Generates structured HTML and XML documentation from Ruby source + and C extensions. + * Automatically extracts class, module, method, and attribute + definitions. These can be annotated using inline comments. + * Analyzes method visibility. + * Handles aliasing. + * Uses non-intrusive and implicit markup in the comments. Readers of + the original source needn't know that it is marked up at all. + . + This package provides the RDoc tool which uses Ruby 1.9. + +Package: irb1.9 +Architecture: all +Depends: ${misc:Depends}, ruby1.9 (>= ${source:Version}), libreadline-ruby1.9 (>= ${source:Version}) +Description: Interactive Ruby (for Ruby 1.9) + The irb is acronym for Interactive RuBy. It evaluates Ruby expression from + the terminal. + . + This package provides the irb which uses Ruby 1.9. --- ruby1.9-1.9.0.5.orig/debian/NEWS +++ ruby1.9-1.9.0.5/debian/NEWS @@ -0,0 +1,43 @@ +ruby1.9 (1.9.0.0-1) unstable; urgency=low + + $LOAD_PATH is changed in Ruby 1.9.0-0 as the following: + + ["/usr/local/lib/site_ruby/1.9.0", + "/usr/local/lib/site_ruby/1.9.0/i486-linux", + "/usr/local/lib/site_ruby/1.9/i386-linux", + "/usr/local/lib/site_ruby", + "/usr/lib/ruby/vendor_ruby/1.9.0", + "/usr/lib/ruby/vendor_ruby/1.9.0/i486-linux", + "/usr/lib/ruby/vendor_ruby", + "/usr/lib/ruby/1.9.0", + "/usr/lib/ruby/1.9.0/i486-linux", + "/usr/lib/ruby/1.9/i386-linux", + "."] + + This changes was introduced because Ruby 1.9.1 (or later version) may be + incompatible with this version of Ruby. If you have libraries in old + $LOAD_PATH, please rebuild it with this version of ruby1.9-dev package. + + -- akira yamada Wed, 26 Dec 2007 10:34:48 +0900 + +ruby1.9 (1.9.0+20050623-2) unstable; urgency=high + + On ix86 architecutre, $LOAD_PATH is changed as follows: + + /usr/local/lib/site_ruby/1.9 + /usr/local/lib/site_ruby/1.9/i486-linux + /usr/local/lib/site_ruby + /usr/lib/ruby/1.9 + /usr/lib/ruby/1.9/i486-linux + . + + This change is brought to follow the change of dpkg 1.13. It changed + architecture name to "i486-linux-gnu" from "i386-linux". + + If you locally build extension libraries, please rebuild it with this + version of ruby1.9-dev package. + + NOTE: In this version, ruby1.9 temporally searches files in + /usr/local/lib/site_ruby/1.9/i386-linux and /usr/lib/ruby/1.9/i386-linux. + + -- akira yamada Wed, 29 Jun 2005 23:50:58 +0900 --- ruby1.9-1.9.0.5.orig/debian/extfixup_rubylibs.sh +++ ruby1.9-1.9.0.5/debian/extfixup_rubylibs.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +ruby_libdir=usr/lib/ruby/"$1" +pkg_name="$2" +ext_dir="$3" + +if [ -d "$ext_dir/lib" ] +then + for f in `find "$ext_dir/lib" -type f -name '*.rb'` + do + dh_movefiles -p"$pkg_name" "$ruby_libdir"/`expr "$f" : "$ext_dir/lib/\(.*\)"` + done +fi + --- ruby1.9-1.9.0.5.orig/debian/irb1.9.1 +++ ruby1.9-1.9.0.5/debian/irb1.9.1 @@ -0,0 +1,506 @@ +.TH IRB1.9 "1" "December 2002" +.SH NAME +irb1.9 \- interactive ruby +.SH SYNOPSIS +.B irb +[\fIoptions\fR] +.SH DESCRIPTION +.PP +irb stands for `interactive ruby'. irb is a tool to execute interactively +ruby expressions read from stdin. +Use of irb is easy if you know ruby. Executing irb, prompts are +displayed as follows. Then, enter expression of ruby. A input is +executed when it is syntacticaly completed. + +.nf +\& $ irb1.9 +\& irb(main):001:0> 1+2 +\& 3 +\& irb(main):002:0> class Foo +\& irb(main):003:1> def foo +\& irb(main):004:2> print 1 +\& irb(main):005:2> end +\& irb(main):006:1> end +\& nil +\& irb(main):007:0> +.fi + +And, Readline extesion module can be used with irb. Using Readline +is the standard default action if Readline is installed. +.SH OPTIONS + +.PP + +.TP +.fi +.B +\-f +suppress read ~/.irbrc +.TP +.fi +.B +\-m +bc mode (fraction or matrix are available) +.TP +.fi +.B +\-d +set $DEBUG to true (same as `ruby \-d') +.TP +.fi +.B +\-r load\-module +same as `ruby \-r' +.TP +.fi +.B +\-\-inspect +uses `inspect' for output (the default except bc mode) +.TP +.fi +.B +\-\-noinspect +doesn't uses inspect for output +.TP +.fi +.B +\-\-readline +uses Readline extension module +.TP +.fi +.B +\-\-noreadline +doesn't use Readline extension module +.TP +.fi +.B +\-\-prompt prompt\-mode +.TP +.fi +.B +\-\-prompt\-mode prompt\-mode +switches prompt mode. Pre\-defined prompt modes are +`default', `simple', `xmp' and `inf\-ruby' +.TP +.fi +.B +\-\-inf\-ruby\-mode +uses prompt appreciate for inf\-ruby\-mode on emacs. +Suppresses \-\-readline. +.TP +.fi +.B +\-\-simple\-prompt +simple prompt mode +.TP +.fi +.B +\-\-noprompt +no prompt +.TP +.fi +.B +\-\-tracer +display trace for each execution of commands. +.TP +.fi +.B +\-\-back\-trace\-limit n +displayes backtrace top n and tail n. The default +value is 16. +.TP +.fi +.B +\-\-irb_debug n +sets internal debug level to n (It shouldn't be used) +.TP +.fi +.B +\-v, \-\-version +prints the version of irb +.SH CONFIGURATIONS + +.PP +irb reads `~/.irbrc' when it is invoked. If `~/.irbrb' doesn't exist +irb try to read in the order `.irbrc', `irb.rc', `_irbrc' then `$irbrc'. +The following is altanative to the command line option. To use them +type as follows in an irb session. + +.nf +\& IRB.conf[:IRB_NAME]="irb" +\& IRB.conf[:MATH_MODE]=false +\& IRB.conf[:USE_TRACER]=false +\& IRB.conf[:USE_LOADER]=false +\& IRB.conf[:IGNORE_SIGINT]=true +\& IRB.conf[:IGNORE_EOF]=false +\& IRB.conf[:INSPECT_MODE]=nil +\& IRB.conf[:IRB_RC] = nil +\& IRB.conf[:BACK_TRACE_LIMIT]=16 +\& IRB.conf[:USE_LOADER] = false +\& IRB.conf[:USE_READLINE] = nil +\& IRB.conf[:USE_TRACER] = false +\& IRB.conf[:IGNORE_SIGINT] = true +\& IRB.conf[:IGNORE_EOF] = false +\& IRB.conf[:PROMPT_MODE] = :DEFALUT +\& IRB.conf[:PROMPT] = {...} +\& IRB.conf[:DEBUG_LEVEL]=0 +\& IRB.conf[:VERBOSE]=true +.fi +.SH Customizing prompt + +.PP +To costomize the prompt you set a variable + +.nf +\& IRB.conf[:PROMPT] +.fi + +For example, describe as follows in `.irbrc'. + +.nf +\& IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode +\& :PROMPT_I => nil, # normal prompt +\& :PROMPT_S => nil, # prompt for continuated strings +\& :PROMPT_C => nil, # prompt for continuated statement +\& :RETURN => " ==>%s\\n" # format to return value +\& } +.fi + +Then, invoke irb with the above prompt mode by + +.nf +\& $ irb1.9 \-\-prompt my\-prompt +.fi + +Or add the following in `.irbrc'. + +.nf +\& IRB.conf[:PROMPT_MODE] = :MY_PROMPT +.fi + +Constants PROMPT_I, PROMPT_S and PROMPT_C specifies the format. +In the prompt specification, some special strings are available. + +.nf +\& %N command name which is running +\& %m to_s of main object (self) +\& %M inspect of main object (self) +\& %l type of string(", ', /, ]), `]' is inner %w[...] +\& %NNi indent level. NN is degits and means as same as printf("%NNd"). +\& It can be ommited +\& %NNn line number. +\& %% % +.fi +For instance, the default prompt mode is defined as follows: +IRB.conf[:PROMPT_MODE][:DEFAULT] = { +.TP +.fi +.B +PROMPT_I => "%N(%m):%03n:%i> ", +.TP +.fi +.B +PROMPT_S => "%N(%m):%03n:%i%l ", +.TP +.fi +.B +PROMPT_C => "%N(%m):%03n:%i* ", +.TP +.fi +.B +RETURN => "%s\\n"} +RETURN is used to printf. +.SH Configurating subirb + +.PP +The command line option or IRB.conf specify the default behavior of +(sub)irb. On the other hand, each conf of in the next sction `6. Command' +is used to individually configurate (sub)irb. +If proc is set to IRB.conf[:IRB_RC], its subirb will be invoked after +execution of that proc under giving the context of irb as its +aregument. By this mechanism each subirb can be configurated. +.SH Command + +.PP +For irb commands, both simple name and `irb_'\-prefixed name are prepared. +.TP +.fi +.B +exit, quit, irb_exit +Quits (sub)irb. +if you've done cb (see below), exit from the binding mode. + +.TP +.fi +.B +conf, irb_context +Displays current configuration. Modifing the configuration is +achieved by sending message to `conf'. +.TP +.fi +.B +conf.back_trace_limit +Sets display lines of backtrace as top n and tail n. +The default value is 16. +.TP +.fi +.B +conf.debug_level = N +Sets debug level of irb. +.TP +.fi +.B +conf.ignore_eof = true/false +Whether ^D (control\-d) will be ignored or not. +If false is set, ^D means quit. +.TP +.fi +.B +conf.ignore_sigint= true/false +Whether ^C (control\-c) will be ignored or not. +If false is set, ^D means quit. If true, +.nf +\& during input: cancel inputing then return to top level. +\& during execute: abondon current execution. +.fi +.TP +.fi +.B +conf.inf_ruby_mode = true/false +Whether inf\-ruby\-mode or not. The default value is false. +.TP +.fi +.B +conf.inspect_mode = true/false/nil +Specifies inspect mode. +true: display inspect +false: display to_s +nil: inspect mode in non math mode, +.nf +\& non inspect mode in math mode. +.fi +.TP +.fi +.B +conf.irb_level +The level of cb. +.TP +.fi +.B +conf.math_mode +Whether bc mode or not. +.TP +.fi +.B +conf.use_loader = true/false +Whether irb's own file reader method is used when load/require or not. +This mode is globaly affected (irb wide). +.TP +.fi +.B +conf.prompt_c +prompt for a continuating statement (e.g, immediately after of `if') +.TP +.fi +.B +conf.prompt_i +standard prompt +.TP +.fi +.B +conf.prompt_s +prompt for a continuating string +.TP +.fi +.B +conf.rc +Whether ~/.irbrc is read or not. +.TP +.fi +.B +conf.use_prompt = true/false +Prompting or not. +.TP +.fi +.B +conf.use_readline = true/false/nil +Whether readline is used or not. +true: uses +false: doen't use +nil: intends to use readline except for inf\-reuby\-mode (default) +.TP +.fi +.B +conf.verbose=T/F +Whether verbose messages are display or not. +.TP +.fi +.B +cb, irb_change_binding [obj] +Enter new binding which has a distinct scope of local variables. +If obj is given, obj will be self. +.TP +.fi +.B +irb [obj] +Invoke subirb. If obj is given, obj will be self. +.TP +.fi +.B +jobs, irb_jobs +List of subirb +.TP +.fi +.B +fg n, irb_fg n +Switch into specified subirb. The following is candidates of n: +.nf +\& irb number +\& thhread +\& irb object +\& self(obj which is specified of irb obj) +.fi +.TP +.fi +.B +kill n, irb_kill n +Kill subirb. The means of n is as same as the case of irb_fg. +.SH System variable + +.PP + +.TP +.fi +.B +_ +The latest value of evaluation (it is local) +.SH Session Example + +.PP +.nf +\& $ irb1.9 +\& irb(main):001:0> irb # invoke subirb +\& irb#1(main):001:0> jobs # list of subirbs +\& #0\->irb on main (# : stop) +\& #1\->irb#1 on main (# : running) +\& nil +\& irb#1(main):002:0> fg 0 # switch job +\& nil +\& irb(main):002:0> class Foo;end +\& nil +\& irb(main):003:0> irb Foo # invoke subirb which has the +.fi +.nf +\& # context of Foo +.fi +.nf +\& irb#2(Foo):001:0> def foo # define Foo#foo +\& irb#2(Foo):002:1> print 1 +\& irb#2(Foo):003:1> end +\& nil +\& irb#2(Foo):004:0> fg 0 # switch job +\& nil +\& irb(main):004:0> jobs # list of job +\& #0\->irb on main (# : running) +\& #1\->irb#1 on main (# : stop) +\& #2\->irb#2 on Foo (# : stop) +\& nil +\& irb(main):005:0> Foo.instance_methods # Foo#foo is defined asurely +\& ["foo"] +\& irb(main):006:0> fg 2 # switch job +\& nil +\& irb#2(Foo):005:0> def bar # define Foo#bar +\& irb#2(Foo):006:1> print "bar" +\& irb#2(Foo):007:1> end +\& nil +\& irb#2(Foo):010:0> Foo.instance_methods +\& ["bar", "foo"] +\& irb#2(Foo):011:0> fg 0 +\& nil +\& irb(main):007:0> f = Foo.new +\& # +\& irb(main):008:0> irb f # invoke subirb which has the +.fi +.nf +\& # context of f (instance of Foo) +.fi +.nf +\& irb#3(#):001:0> jobs +\& #0\->irb on main (# : stop) +\& #1\->irb#1 on main (# : stop) +\& #2\->irb#2 on Foo (# : stop) +\& #3\->irb#3 on # (# : running) +\& nil +\& irb#3(#):002:0> foo # evaluate f.foo +\& 1nil +\& irb#3(#):003:0> bar # evaluate f.bar +\& barnil +\& irb#3(#):004:0> kill 1, 2, 3# kill job +\& nil +\& irb(main):009:0> jobs +\& #0\->irb on main (# : running) +\& nil +\& irb(main):010:0> exit # exit +.fi +.SH Restrictions + +.PP +Because irb evaluates the inputs immediately after the imput is +syntactically completed, irb gives slight different result than +directly use ruby. Known difference is pointed out here. +.SH Declaration of the local variable + +.PP +The following causes an error in ruby: + +.nf +\& eval "foo = 0" +\& foo +\& \-\- +\& \-:2: undefined local variable or method `foo' for # (NameError) +\& \-\-\- +\& NameError +.fi + +Though, the above will successfully done by irb. + +.nf +\& >> eval "foo = 0" +.fi +.nf +\& => 0 +\& >> foo +\& => 0 +.fi + +Ruby evaluates a code after reading entire of code and determination +of the scope of local variables. On the other hand, irb do +immediately. More precisely, irb evaluate at first + +.nf +\& evel "foo = 0" +.fi + +then foo is defined on this timing. It is because of this +incompatibility. +If you'd like to detect those differences, begin...end can be used: + +.nf +\& >> begin +\& ?> eval "foo = 0" +\& >> foo +\& >> end +\& NameError: undefined local variable or method `foo' for # +\& (irb):3 +\& (irb_local_binding):1:in `eval' +.fi +.SH Here\-document + +.PP +Implementation of Here\-document is incomplete. +.SH Symbol + +.PP +Irb can not always recognize a symbol as to be Symbol. Concretely, an +expression have completed, however Irb regard it as continuation line. + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/optinsn.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/optinsn.inc @@ -0,0 +1,30 @@ +/* -*-c-*- *********************************************************/ +/*******************************************************************/ +/*******************************************************************/ +/** + This file is for threaded code. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/optinsn.inc.tmpl' + or rb/insns2vm.rb + */ + +static INSN * +insn_operands_unification(INSN *insnobj){ +#ifdef OPT_OPERANDS_UNIFICATION + /* optimize rule */ + switch(insnobj->insn_id){ + + + + default: + /* do nothing */; + break; + } +#endif + return insnobj; +} + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/node_name.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/node_name.inc @@ -0,0 +1,216 @@ + case NODE_METHOD: + return "NODE_METHOD"; + case NODE_FBODY: + return "NODE_FBODY"; + case NODE_CFUNC: + return "NODE_CFUNC"; + case NODE_SCOPE: + return "NODE_SCOPE"; + case NODE_BLOCK: + return "NODE_BLOCK"; + case NODE_IF: + return "NODE_IF"; + case NODE_CASE: + return "NODE_CASE"; + case NODE_WHEN: + return "NODE_WHEN"; + case NODE_OPT_N: + return "NODE_OPT_N"; + case NODE_WHILE: + return "NODE_WHILE"; + case NODE_UNTIL: + return "NODE_UNTIL"; + case NODE_ITER: + return "NODE_ITER"; + case NODE_FOR: + return "NODE_FOR"; + case NODE_BREAK: + return "NODE_BREAK"; + case NODE_NEXT: + return "NODE_NEXT"; + case NODE_REDO: + return "NODE_REDO"; + case NODE_RETRY: + return "NODE_RETRY"; + case NODE_BEGIN: + return "NODE_BEGIN"; + case NODE_RESCUE: + return "NODE_RESCUE"; + case NODE_RESBODY: + return "NODE_RESBODY"; + case NODE_ENSURE: + return "NODE_ENSURE"; + case NODE_AND: + return "NODE_AND"; + case NODE_OR: + return "NODE_OR"; + case NODE_MASGN: + return "NODE_MASGN"; + case NODE_LASGN: + return "NODE_LASGN"; + case NODE_DASGN: + return "NODE_DASGN"; + case NODE_DASGN_CURR: + return "NODE_DASGN_CURR"; + case NODE_GASGN: + return "NODE_GASGN"; + case NODE_IASGN: + return "NODE_IASGN"; + case NODE_IASGN2: + return "NODE_IASGN2"; + case NODE_CDECL: + return "NODE_CDECL"; + case NODE_CVASGN: + return "NODE_CVASGN"; + case NODE_CVDECL: + return "NODE_CVDECL"; + case NODE_OP_ASGN1: + return "NODE_OP_ASGN1"; + case NODE_OP_ASGN2: + return "NODE_OP_ASGN2"; + case NODE_OP_ASGN_AND: + return "NODE_OP_ASGN_AND"; + case NODE_OP_ASGN_OR: + return "NODE_OP_ASGN_OR"; + case NODE_CALL: + return "NODE_CALL"; + case NODE_FCALL: + return "NODE_FCALL"; + case NODE_VCALL: + return "NODE_VCALL"; + case NODE_SUPER: + return "NODE_SUPER"; + case NODE_ZSUPER: + return "NODE_ZSUPER"; + case NODE_ARRAY: + return "NODE_ARRAY"; + case NODE_ZARRAY: + return "NODE_ZARRAY"; + case NODE_VALUES: + return "NODE_VALUES"; + case NODE_HASH: + return "NODE_HASH"; + case NODE_RETURN: + return "NODE_RETURN"; + case NODE_YIELD: + return "NODE_YIELD"; + case NODE_LVAR: + return "NODE_LVAR"; + case NODE_DVAR: + return "NODE_DVAR"; + case NODE_GVAR: + return "NODE_GVAR"; + case NODE_IVAR: + return "NODE_IVAR"; + case NODE_CONST: + return "NODE_CONST"; + case NODE_CVAR: + return "NODE_CVAR"; + case NODE_NTH_REF: + return "NODE_NTH_REF"; + case NODE_BACK_REF: + return "NODE_BACK_REF"; + case NODE_MATCH: + return "NODE_MATCH"; + case NODE_MATCH2: + return "NODE_MATCH2"; + case NODE_MATCH3: + return "NODE_MATCH3"; + case NODE_LIT: + return "NODE_LIT"; + case NODE_STR: + return "NODE_STR"; + case NODE_DSTR: + return "NODE_DSTR"; + case NODE_XSTR: + return "NODE_XSTR"; + case NODE_DXSTR: + return "NODE_DXSTR"; + case NODE_EVSTR: + return "NODE_EVSTR"; + case NODE_DREGX: + return "NODE_DREGX"; + case NODE_DREGX_ONCE: + return "NODE_DREGX_ONCE"; + case NODE_ARGS: + return "NODE_ARGS"; + case NODE_ARGS_AUX: + return "NODE_ARGS_AUX"; + case NODE_OPT_ARG: + return "NODE_OPT_ARG"; + case NODE_POSTARG: + return "NODE_POSTARG"; + case NODE_ARGSCAT: + return "NODE_ARGSCAT"; + case NODE_ARGSPUSH: + return "NODE_ARGSPUSH"; + case NODE_SPLAT: + return "NODE_SPLAT"; + case NODE_TO_ARY: + return "NODE_TO_ARY"; + case NODE_BLOCK_ARG: + return "NODE_BLOCK_ARG"; + case NODE_BLOCK_PASS: + return "NODE_BLOCK_PASS"; + case NODE_DEFN: + return "NODE_DEFN"; + case NODE_DEFS: + return "NODE_DEFS"; + case NODE_ALIAS: + return "NODE_ALIAS"; + case NODE_VALIAS: + return "NODE_VALIAS"; + case NODE_UNDEF: + return "NODE_UNDEF"; + case NODE_CLASS: + return "NODE_CLASS"; + case NODE_MODULE: + return "NODE_MODULE"; + case NODE_SCLASS: + return "NODE_SCLASS"; + case NODE_COLON2: + return "NODE_COLON2"; + case NODE_COLON3: + return "NODE_COLON3"; + case NODE_DOT2: + return "NODE_DOT2"; + case NODE_DOT3: + return "NODE_DOT3"; + case NODE_FLIP2: + return "NODE_FLIP2"; + case NODE_FLIP3: + return "NODE_FLIP3"; + case NODE_ATTRSET: + return "NODE_ATTRSET"; + case NODE_SELF: + return "NODE_SELF"; + case NODE_NIL: + return "NODE_NIL"; + case NODE_TRUE: + return "NODE_TRUE"; + case NODE_FALSE: + return "NODE_FALSE"; + case NODE_ERRINFO: + return "NODE_ERRINFO"; + case NODE_DEFINED: + return "NODE_DEFINED"; + case NODE_POSTEXE: + return "NODE_POSTEXE"; + case NODE_ALLOCA: + return "NODE_ALLOCA"; + case NODE_BMETHOD: + return "NODE_BMETHOD"; + case NODE_MEMO: + return "NODE_MEMO"; + case NODE_IFUNC: + return "NODE_IFUNC"; + case NODE_DSYM: + return "NODE_DSYM"; + case NODE_ATTRASGN: + return "NODE_ATTRASGN"; + case NODE_PRELUDE: + return "NODE_PRELUDE"; + case NODE_LAMBDA: + return "NODE_LAMBDA"; + case NODE_OPTBLOCK: + return "NODE_OPTBLOCK"; --- ruby1.9-1.9.0.5.orig/debian/generated-incs/vm.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/vm.inc @@ -0,0 +1,2838 @@ +/* -*-c-*- *********************************************************/ +/*******************************************************************/ +/*******************************************************************/ +/** + This file is VM main loop. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'insns.c' + */ + + +INSN_ENTRY(nop){ +{ + + + DEBUG_ENTER_INSN("nop"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_nop 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_nop_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(nop)); +{ +#line 40 "insns.def" + /* none */ + +#line 32 "vm.inc" +#undef CURRENT_INSN_nop +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(nop);}}} +INSN_ENTRY(getlocal){ +{ + VALUE val; + lindex_t idx = (lindex_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getlocal"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getlocal 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getlocal_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getlocal)); + USAGE_ANALYSIS_OPERAND(BIN(getlocal), 0, idx); +{ +#line 58 "insns.def" + val = *(GET_LFP() - idx); + +#line 56 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getlocal +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getlocal);}}} +INSN_ENTRY(setlocal){ +{ + lindex_t idx = (lindex_t)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setlocal"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setlocal 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setlocal_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setlocal)); + USAGE_ANALYSIS_OPERAND(BIN(setlocal), 0, idx); +{ +#line 72 "insns.def" + (*(GET_LFP() - idx)) = val; + +#line 81 "vm.inc" +#undef CURRENT_INSN_setlocal +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setlocal);}}} +INSN_ENTRY(getspecial){ +{ + VALUE val; + rb_num_t type = (rb_num_t)GET_OPERAND(2); + VALUE key = (VALUE)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getspecial"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getspecial 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getspecial_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getspecial)); + USAGE_ANALYSIS_OPERAND(BIN(getspecial), 0, key); + USAGE_ANALYSIS_OPERAND(BIN(getspecial), 1, type); +{ +#line 86 "insns.def" + val = vm_getspecial(th, GET_LFP(), key, type); + +#line 107 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getspecial +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getspecial);}}} +INSN_ENTRY(setspecial){ +{ + VALUE key = (VALUE)GET_OPERAND(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("setspecial"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setspecial 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setspecial_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setspecial)); + USAGE_ANALYSIS_OPERAND(BIN(setspecial), 0, key); +{ +#line 100 "insns.def" + lfp_svar_set(th, GET_LFP(), key, obj); + +#line 132 "vm.inc" +#undef CURRENT_INSN_setspecial +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setspecial);}}} +INSN_ENTRY(getdynamic){ +{ + VALUE val; + rb_num_t level = (rb_num_t)GET_OPERAND(2); + dindex_t idx = (dindex_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getdynamic"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getdynamic 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getdynamic_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getdynamic)); + USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 0, idx); + USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 1, level); +{ +#line 116 "insns.def" + int i; + VALUE *dfp2 = GET_DFP(); + for (i = 0; i < level; i++) { + dfp2 = GET_PREV_DFP(dfp2); + } + val = *(dfp2 - idx); + +#line 163 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getdynamic +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getdynamic);}}} +INSN_ENTRY(setdynamic){ +{ + rb_num_t level = (rb_num_t)GET_OPERAND(2); + dindex_t idx = (dindex_t)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setdynamic"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setdynamic 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setdynamic_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setdynamic)); + USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 0, idx); + USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 1, level); +{ +#line 137 "insns.def" + int i; + VALUE *dfp2 = GET_DFP(); + for (i = 0; i < level; i++) { + dfp2 = GET_PREV_DFP(dfp2); + } + *(dfp2 - idx) = val; + +#line 195 "vm.inc" +#undef CURRENT_INSN_setdynamic +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setdynamic);}}} +INSN_ENTRY(getinstancevariable){ +{ + VALUE val; + ID id = (ID)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getinstancevariable"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getinstancevariable 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getinstancevariable_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getinstancevariable)); + USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 0, id); +{ +#line 157 "insns.def" + val = rb_ivar_get(GET_SELF(), id); + +#line 219 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getinstancevariable +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getinstancevariable);}}} +INSN_ENTRY(setinstancevariable){ +{ + ID id = (ID)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setinstancevariable"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setinstancevariable 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setinstancevariable_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setinstancevariable)); + USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 0, id); +{ +#line 172 "insns.def" + rb_ivar_set(GET_SELF(), id, val); + +#line 244 "vm.inc" +#undef CURRENT_INSN_setinstancevariable +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setinstancevariable);}}} +INSN_ENTRY(getclassvariable){ +{ + VALUE val; + ID id = (ID)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getclassvariable"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getclassvariable 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getclassvariable_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getclassvariable)); + USAGE_ANALYSIS_OPERAND(BIN(getclassvariable), 0, id); +{ +#line 186 "insns.def" + NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP()); + val = rb_cvar_get(vm_get_cvar_base(cref), id); + +#line 269 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getclassvariable +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getclassvariable);}}} +INSN_ENTRY(setclassvariable){ +{ + ID id = (ID)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setclassvariable"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setclassvariable 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setclassvariable_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setclassvariable)); + USAGE_ANALYSIS_OPERAND(BIN(setclassvariable), 0, id); +{ +#line 201 "insns.def" + NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP()); + rb_cvar_set(vm_get_cvar_base(cref), id, val); + +#line 295 "vm.inc" +#undef CURRENT_INSN_setclassvariable +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setclassvariable);}}} +INSN_ENTRY(getconstant){ +{ + VALUE val; + ID id = (ID)GET_OPERAND(1); + VALUE klass = TOPN(0); + DEBUG_ENTER_INSN("getconstant"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_getconstant 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getconstant_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getconstant)); + USAGE_ANALYSIS_OPERAND(BIN(getconstant), 0, id); +{ +#line 223 "insns.def" + val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0); + +#line 320 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getconstant +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getconstant);}}} +INSN_ENTRY(setconstant){ +{ + ID id = (ID)GET_OPERAND(1); + VALUE val = TOPN(1); + VALUE cbase = TOPN(0); + DEBUG_ENTER_INSN("setconstant"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_setconstant 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setconstant_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setconstant)); + USAGE_ANALYSIS_OPERAND(BIN(setconstant), 0, id); +{ +#line 245 "insns.def" + vm_check_if_namespace(cbase); + rb_const_set(cbase, id, val); + INC_VM_STATE_VERSION(); + +#line 348 "vm.inc" +#undef CURRENT_INSN_setconstant +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setconstant);}}} +INSN_ENTRY(getglobal){ +{ + VALUE val; + GENTRY entry = (GENTRY)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getglobal"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getglobal 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getglobal_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getglobal)); + USAGE_ANALYSIS_OPERAND(BIN(getglobal), 0, entry); +{ +#line 261 "insns.def" + val = GET_GLOBAL(entry); + +#line 372 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getglobal +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getglobal);}}} +INSN_ENTRY(setglobal){ +{ + GENTRY entry = (GENTRY)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setglobal"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setglobal 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setglobal_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setglobal)); + USAGE_ANALYSIS_OPERAND(BIN(setglobal), 0, entry); +{ +#line 275 "insns.def" + SET_GLOBAL(entry, val); + +#line 397 "vm.inc" +#undef CURRENT_INSN_setglobal +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setglobal);}}} +INSN_ENTRY(putnil){ +{ + VALUE val; + + + DEBUG_ENTER_INSN("putnil"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putnil 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putnil_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putnil)); +{ +#line 294 "insns.def" + val = Qnil; + +#line 420 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_putnil +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putnil);}}} +INSN_ENTRY(putself){ +{ + VALUE val; + + + DEBUG_ENTER_INSN("putself"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putself 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putself_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putself)); +{ +#line 308 "insns.def" + val = GET_SELF(); + +#line 444 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_putself +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putself);}}} +INSN_ENTRY(putobject){ +{ + VALUE val = (VALUE)GET_OPERAND(1); + + DEBUG_ENTER_INSN("putobject"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putobject 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putobject_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putobject)); + USAGE_ANALYSIS_OPERAND(BIN(putobject), 0, val); +{ +#line 324 "insns.def" + /* */ + +#line 468 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_putobject +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putobject);}}} +INSN_ENTRY(putspecialobject){ +{ + VALUE val; + rb_num_t value_type = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("putspecialobject"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putspecialobject 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putspecialobject_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putspecialobject)); + USAGE_ANALYSIS_OPERAND(BIN(putspecialobject), 0, value_type); +{ +#line 339 "insns.def" + switch (value_type) { + case VM_SPECIAL_OBJECT_VMCORE: + val = rb_mRubyVMFrozenCore; + break; + case VM_SPECIAL_OBJECT_CBASE: + val = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP()); + break; + default: + rb_bug("putspecialobject insn: unknown value_type"); + } + +#line 502 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_putspecialobject +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putspecialobject);}}} +INSN_ENTRY(putiseq){ +{ + VALUE ret; + ISEQ iseq = (ISEQ)GET_OPERAND(1); + + DEBUG_ENTER_INSN("putiseq"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putiseq 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putiseq_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putiseq)); + USAGE_ANALYSIS_OPERAND(BIN(putiseq), 0, iseq); +{ +#line 362 "insns.def" + ret = iseq->self; + +#line 527 "vm.inc" + PUSH(ret); +#undef CURRENT_INSN_putiseq +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putiseq);}}} +INSN_ENTRY(putstring){ +{ + VALUE val; + VALUE str = (VALUE)GET_OPERAND(1); + + DEBUG_ENTER_INSN("putstring"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_putstring 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_putstring_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(putstring)); + USAGE_ANALYSIS_OPERAND(BIN(putstring), 0, str); +{ +#line 376 "insns.def" + val = rb_str_new3(str); + +#line 552 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_putstring +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(putstring);}}} +INSN_ENTRY(concatstrings){ +{ + VALUE val; + rb_num_t num = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("concatstrings"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_concatstrings 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_concatstrings_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(concatstrings)); + USAGE_ANALYSIS_OPERAND(BIN(concatstrings), 0, num); +{ +#line 390 "insns.def" + int i; + + val = rb_str_new(0, 0); + for (i = num - 1; i >= 0; i--) { + const VALUE v = TOPN(i); + rb_str_append(val, v); + } + POPN(num); + +#line 584 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_concatstrings +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(concatstrings);}}} +INSN_ENTRY(tostring){ +{ + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("tostring"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_tostring 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_tostring_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(tostring)); +{ +#line 411 "insns.def" + val = rb_obj_as_string(val); + +#line 608 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_tostring +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(tostring);}}} +INSN_ENTRY(toregexp){ +{ + VALUE val; + rb_num_t cnt = (rb_num_t)GET_OPERAND(2); + rb_num_t opt = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("toregexp"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_toregexp 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_toregexp_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(toregexp)); + USAGE_ANALYSIS_OPERAND(BIN(toregexp), 0, opt); + USAGE_ANALYSIS_OPERAND(BIN(toregexp), 1, cnt); +{ +#line 426 "insns.def" + VALUE rb_reg_new_ary(VALUE ary, int options); + int i; + const VALUE ary = rb_ary_new2(cnt); + RBASIC(ary)->klass = 0; + for (i = 0; i < cnt; i++) { + rb_ary_store(ary, cnt-i-1, TOPN(i)); + } + POPN(cnt); + val = rb_reg_new_ary(ary, opt); + +#line 643 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_toregexp +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(toregexp);}}} +INSN_ENTRY(newarray){ +{ + VALUE val; + rb_num_t num = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("newarray"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_newarray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_newarray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(newarray)); + USAGE_ANALYSIS_OPERAND(BIN(newarray), 0, num); +{ +#line 448 "insns.def" + val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num)); + POPN(num); + +#line 669 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_newarray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(newarray);}}} +INSN_ENTRY(duparray){ +{ + VALUE val; + VALUE ary = (VALUE)GET_OPERAND(1); + + DEBUG_ENTER_INSN("duparray"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_duparray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_duparray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(duparray)); + USAGE_ANALYSIS_OPERAND(BIN(duparray), 0, ary); +{ +#line 463 "insns.def" + val = rb_ary_dup(ary); + +#line 694 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_duparray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(duparray);}}} +INSN_ENTRY(expandarray){ +{ + rb_num_t flag = (rb_num_t)GET_OPERAND(2); + rb_num_t num = (rb_num_t)GET_OPERAND(1); + VALUE ary = TOPN(0); + DEBUG_ENTER_INSN("expandarray"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_expandarray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_expandarray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(expandarray)); + USAGE_ANALYSIS_OPERAND(BIN(expandarray), 0, num); + USAGE_ANALYSIS_OPERAND(BIN(expandarray), 1, flag); +{ +#line 484 "insns.def" + vm_expandarray(GET_CFP(), ary, num, flag); + +#line 721 "vm.inc" +#undef CURRENT_INSN_expandarray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(expandarray);}}} +INSN_ENTRY(concatarray){ +{ + VALUE ary; + + VALUE ary1 = TOPN(1); + VALUE ary2st = TOPN(0); + DEBUG_ENTER_INSN("concatarray"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_concatarray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_concatarray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(concatarray)); +{ +#line 498 "insns.def" + const VALUE ary2 = ary2st; + VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a"); + VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a"); + + if (NIL_P(tmp1)) { + tmp1 = rb_ary_new3(1, ary1); + } + + if (NIL_P(tmp2)) { + tmp2 = rb_ary_new3(1, ary2); + } + + if (tmp1 == ary1) { + tmp1 = rb_ary_dup(ary1); + } + ary = rb_ary_concat(tmp1, tmp2); + +#line 761 "vm.inc" + PUSH(ary); +#undef CURRENT_INSN_concatarray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(concatarray);}}} +INSN_ENTRY(splatarray){ +{ + VALUE obj; + + VALUE ary = TOPN(0); + DEBUG_ENTER_INSN("splatarray"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_splatarray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_splatarray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(splatarray)); + USAGE_ANALYSIS_OPERAND(BIN(splatarray), 0, flag); +{ +#line 527 "insns.def" + VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a"); + if (NIL_P(tmp)) { + tmp = rb_ary_new3(1, ary); + } + obj = tmp; + +#line 791 "vm.inc" + PUSH(obj); +#undef CURRENT_INSN_splatarray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(splatarray);}}} +INSN_ENTRY(checkincludearray){ +{ + VALUE result; + VALUE flag = (VALUE)GET_OPERAND(1); + VALUE obj = TOPN(1); + VALUE ary = TOPN(0); + DEBUG_ENTER_INSN("checkincludearray"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_checkincludearray 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_checkincludearray_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(checkincludearray)); + USAGE_ANALYSIS_OPERAND(BIN(checkincludearray), 0, flag); +{ +#line 545 "insns.def" + int i; + result = Qfalse; + + if (TYPE(ary) != T_ARRAY) { + ary = rb_Array(ary); + } + + if (flag == Qtrue) { + /* NODE_CASE */ + for (i = 0; i < RARRAY_LEN(ary); i++) { + /* TODO: fix me (use another method dispatch) */ + if (RTEST(rb_funcall2(RARRAY_PTR(ary)[i], idEqq, 1, &obj))) { + result = Qtrue; + break; + } + } + } + else { + obj = Qfalse; + /* NODE_WHEN */ + for (i = 0; i < RARRAY_LEN(ary); i++) { + if (RTEST(RARRAY_PTR(ary)[i])) { + obj = result = Qtrue; + break; + } + } + } + +#line 844 "vm.inc" + PUSH(obj); + PUSH(result); +#undef CURRENT_INSN_checkincludearray +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(checkincludearray);}}} +INSN_ENTRY(newhash){ +{ + VALUE val; + rb_num_t num = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("newhash"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_newhash 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_newhash_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(newhash)); + USAGE_ANALYSIS_OPERAND(BIN(newhash), 0, num); +{ +#line 586 "insns.def" + int i; + val = rb_hash_new(); + + for (i = num; i > 0; i -= 2) { + const VALUE v = TOPN(i - 2); + const VALUE k = TOPN(i - 1); + rb_hash_aset(val, k, v); + } + POPN(num); + +#line 878 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_newhash +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(newhash);}}} +INSN_ENTRY(newrange){ +{ + VALUE val; + rb_num_t flag = (rb_num_t)GET_OPERAND(1); + VALUE low = TOPN(1); + VALUE high = TOPN(0); + DEBUG_ENTER_INSN("newrange"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_newrange 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_newrange_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(newrange)); + USAGE_ANALYSIS_OPERAND(BIN(newrange), 0, flag); +{ +#line 608 "insns.def" + val = rb_range_new(low, high, flag); + +#line 905 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_newrange +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(newrange);}}} +INSN_ENTRY(pop){ +{ + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("pop"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_pop 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_pop_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(pop)); +{ +#line 626 "insns.def" + val = val; + /* none */ + +#line 930 "vm.inc" +#undef CURRENT_INSN_pop +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(pop);}}} +INSN_ENTRY(dup){ +{ + VALUE val2; + VALUE val1; + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("dup"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_dup 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_dup_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(dup)); +{ +#line 641 "insns.def" + val1 = val2 = val; + +#line 955 "vm.inc" + PUSH(val1); + PUSH(val2); +#undef CURRENT_INSN_dup +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(dup);}}} +INSN_ENTRY(dupn){ +{ + rb_num_t n = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("dupn"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_dupn 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_dupn_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(dupn)); + USAGE_ANALYSIS_OPERAND(BIN(dupn), 0, n); +{ +#line 655 "insns.def" + int i; + VALUE *sp = STACK_ADDR_FROM_TOP(n); + for (i = 0; i < n; i++) { + GET_SP()[i] = sp[i]; + } + INC_SP(n); + +#line 985 "vm.inc" +#undef CURRENT_INSN_dupn +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(dupn);}}} +INSN_ENTRY(swap){ +{ + + VALUE val = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("swap"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_swap 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_swap_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(swap)); +{ +#line 675 "insns.def" + /* none */ + +#line 1009 "vm.inc" + PUSH(obj); + PUSH(val); +#undef CURRENT_INSN_swap +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(swap);}}} +INSN_ENTRY(reput){ +{ + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("reput"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_reput 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_reput_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(reput)); +{ +#line 689 "insns.def" + /* none */ + +#line 1034 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_reput +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(reput);}}} +INSN_ENTRY(topn){ +{ + VALUE val; + rb_num_t n = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("topn"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_topn 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_topn_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(topn)); + USAGE_ANALYSIS_OPERAND(BIN(topn), 0, n); +{ +#line 703 "insns.def" + val = TOPN(n); + +#line 1059 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_topn +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(topn);}}} +INSN_ENTRY(setn){ +{ + rb_num_t n = (rb_num_t)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setn"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setn 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setn_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setn)); + USAGE_ANALYSIS_OPERAND(BIN(setn), 0, n); +{ +#line 717 "insns.def" + TOPN(n-1) = val; + +#line 1084 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_setn +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setn);}}} +INSN_ENTRY(adjuststack){ +{ + rb_num_t n = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("adjuststack"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_adjuststack 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_adjuststack_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(adjuststack)); + USAGE_ANALYSIS_OPERAND(BIN(adjuststack), 0, n); +{ +#line 731 "insns.def" + DEC_SP(n); + +#line 1108 "vm.inc" +#undef CURRENT_INSN_adjuststack +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(adjuststack);}}} +INSN_ENTRY(defined){ +{ + VALUE val; + VALUE needstr = (VALUE)GET_OPERAND(3); + VALUE obj = (VALUE)GET_OPERAND(2); + rb_num_t type = (rb_num_t)GET_OPERAND(1); + VALUE v = TOPN(0); + DEBUG_ENTER_INSN("defined"); + ADD_PC(1+3); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_defined 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_defined_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(defined)); + USAGE_ANALYSIS_OPERAND(BIN(defined), 0, type); + USAGE_ANALYSIS_OPERAND(BIN(defined), 1, obj); + USAGE_ANALYSIS_OPERAND(BIN(defined), 2, needstr); +{ +#line 750 "insns.def" + VALUE klass; + const char *expr_type = 0; + val = Qnil; + + switch (type) { + case DEFINED_IVAR: + if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) { + expr_type = "instance-variable"; + } + break; + case DEFINED_IVAR2: + klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP()); + break; + case DEFINED_GVAR: + if (rb_gvar_defined((struct global_entry *)(obj & ~1))) { + expr_type = "global-variable"; + } + break; + case DEFINED_CVAR: + klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP()); + if (rb_cvar_defined(klass, SYM2ID(obj))) { + expr_type = "class variable"; + } + break; + case DEFINED_CONST: + klass = v; + if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) { + expr_type = "constant"; + } + break; + case DEFINED_FUNC: + klass = CLASS_OF(v); + if (rb_method_boundp(klass, SYM2ID(obj), 0)) { + expr_type = "method"; + } + break; + case DEFINED_METHOD:{ + VALUE klass = CLASS_OF(v); + NODE *method = (NODE *) rb_method_node(klass, SYM2ID(obj)); + + if (method) { + if (!(method->nd_noex & NOEX_PRIVATE)) { + if (!((method->nd_noex & NOEX_PROTECTED) && + !rb_obj_is_kind_of(GET_SELF(), + rb_class_real(klass)))) { + expr_type = "method"; + } + } + } + break; + } + case DEFINED_YIELD: + if (GET_BLOCK_PTR()) { + expr_type = "yield"; + } + break; + case DEFINED_ZSUPER:{ + rb_iseq_t *ip = GET_ISEQ(); + while (ip) { + if (ip->defined_method_id) { + break; + } + ip = ip->parent_iseq; + } + if (ip) { + VALUE klass = vm_search_normal_superclass(ip->klass, GET_SELF()); + if (rb_method_boundp(klass, ip->defined_method_id, 0)) { + expr_type = "super"; + } + } + break; + } + case DEFINED_REF:{ + val = vm_getspecial(th, GET_LFP(), Qfalse, FIX2INT(obj)); + if (val != Qnil) { + expr_type = "global-variable"; + } + break; + } + default: + rb_bug("unimplemented defined? type (VM)"); + break; + } + if (expr_type != 0) { + if (needstr != Qfalse) { + val = rb_str_new2(expr_type); + } + else { + val = Qtrue; + } + } + +#line 1227 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_defined +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(defined);}}} +INSN_ENTRY(trace){ +{ + rb_num_t nf = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("trace"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_trace 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_trace_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(trace)); + USAGE_ANALYSIS_OPERAND(BIN(trace), 0, nf); +{ +#line 854 "insns.def" + rb_event_flag_t flag = nf; + + EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); + +#line 1253 "vm.inc" +#undef CURRENT_INSN_trace +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(trace);}}} +INSN_ENTRY(defineclass){ +{ + VALUE val; + rb_num_t define_type = (rb_num_t)GET_OPERAND(3); + ISEQ class_iseq = (ISEQ)GET_OPERAND(2); + ID id = (ID)GET_OPERAND(1); + VALUE cbase = TOPN(1); + VALUE super = TOPN(0); + DEBUG_ENTER_INSN("defineclass"); + ADD_PC(1+3); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_defineclass 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_defineclass_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(defineclass)); + USAGE_ANALYSIS_OPERAND(BIN(defineclass), 0, id); + USAGE_ANALYSIS_OPERAND(BIN(defineclass), 1, class_iseq); + USAGE_ANALYSIS_OPERAND(BIN(defineclass), 2, define_type); +{ +#line 878 "insns.def" + VALUE klass; + + switch ((int)define_type) { + case 0: + /* val is dummy. classdef returns class scope value */ + + if (super == Qnil) { + super = rb_cObject; + } + + vm_check_if_namespace(cbase); + + /* find klass */ + if (rb_const_defined_at(cbase, id)) { + /* already exist */ + klass = rb_const_get_at(cbase, id); + if (TYPE(klass) != T_CLASS) { + rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id)); + } + + if (super != rb_cObject) { + VALUE tmp; + tmp = rb_class_real(RCLASS_SUPER(klass)); + + if (tmp != super) { + rb_raise(rb_eTypeError, "superclass mismatch for class %s", + rb_id2name(id)); + } + } + } + else { + /* new class declaration */ + klass = rb_define_class_id(id, super); + rb_set_class_path(klass, cbase, rb_id2name(id)); + rb_const_set(cbase, id, klass); + rb_class_inherited(super, klass); + } + break; + case 1: + /* val is dummy. classdef returns class scope value */ + /* super is dummy */ + klass = rb_singleton_class(cbase); + break; + case 2: + /* val is dummy. classdef returns class scope value */ + /* super is dummy */ + + vm_check_if_namespace(cbase); + + /* find klass */ + if (rb_const_defined_at(cbase, id)) { + klass = rb_const_get_at(cbase, id); + /* already exist */ + if (TYPE(klass) != T_MODULE) { + rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id)); + } + } + else { + /* new module declaration */ + klass = rb_define_module_id(id); + rb_set_class_path(klass, cbase, rb_id2name(id)); + rb_const_set(cbase, id, klass); + } + break; + default: + rb_bug("unknown defineclass type: %d", (int)define_type); + } + + COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC)); + + /* enter scope */ + vm_push_frame(th, class_iseq, + VM_FRAME_MAGIC_CLASS, klass, (VALUE) GET_DFP() | 0x02, + class_iseq->iseq_encoded, GET_SP(), 0, + class_iseq->local_size); + RESTORE_REGS(); + + INC_VM_STATE_VERSION(); + NEXT_INSN(); + +#line 1361 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_defineclass +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(defineclass);}}} +INSN_ENTRY(send){ +{ + VALUE val; + IC ic = (IC)GET_OPERAND(5); + rb_num_t op_flag = (rb_num_t)GET_OPERAND(4); + ISEQ blockiseq = (ISEQ)GET_OPERAND(3); + rb_num_t op_argc = (rb_num_t)GET_OPERAND(2); + ID op_id = (ID)GET_OPERAND(1); + + DEBUG_ENTER_INSN("send"); + ADD_PC(1+5); + PREFETCH(GET_PC()); + #define CURRENT_INSN_send 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_send_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(send)); + USAGE_ANALYSIS_OPERAND(BIN(send), 0, op_id); + USAGE_ANALYSIS_OPERAND(BIN(send), 1, op_argc); + USAGE_ANALYSIS_OPERAND(BIN(send), 2, blockiseq); + USAGE_ANALYSIS_OPERAND(BIN(send), 3, op_flag); + USAGE_ANALYSIS_OPERAND(BIN(send), 4, ic); +{ +#line 981 "insns.def" + NODE *mn; + VALUE recv, klass; + rb_block_t *blockptr = 0; + rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, + (rb_iseq_t *)blockiseq, &blockptr); + rb_num_t flag = op_flag; + ID id = op_id; + + /* get receiver */ + recv = (flag & VM_CALL_FCALL_BIT) ? GET_SELF() : TOPN(num); + klass = CLASS_OF(recv); + mn = vm_method_search(id, klass, ic); + + /* send/funcall optimization */ + if (flag & VM_CALL_SEND_BIT) { + vm_send_optimize(GET_CFP(), &mn, &flag, &num, &id, klass); + } + + CALL_METHOD(num, blockptr, flag, id, mn, recv, klass); + +#line 1412 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_send +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(send);}}} +INSN_ENTRY(invokesuper){ +{ + VALUE val; + rb_num_t op_flag = (rb_num_t)GET_OPERAND(3); + ISEQ blockiseq = (ISEQ)GET_OPERAND(2); + rb_num_t op_argc = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("invokesuper"); + ADD_PC(1+3); + PREFETCH(GET_PC()); + #define CURRENT_INSN_invokesuper 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_invokesuper_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(invokesuper)); + USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 0, op_argc); + USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 1, blockiseq); + USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 2, op_flag); +{ +#line 1015 "insns.def" + rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0; + int num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, blockiseq, &blockptr); + VALUE recv, klass; + NODE *mn; + ID id; + const VALUE flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT; + + recv = GET_SELF(); + vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass); + mn = rb_method_node(klass, id); + + CALL_METHOD(num, blockptr, flag, id, mn, recv, klass); + +#line 1452 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_invokesuper +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(invokesuper);}}} +INSN_ENTRY(invokeblock){ +{ + VALUE val; + rb_num_t flag = (rb_num_t)GET_OPERAND(2); + rb_num_t num = (rb_num_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("invokeblock"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_invokeblock 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_invokeblock_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(invokeblock)); + USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 0, num); + USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 1, flag); +{ +#line 1041 "insns.def" + val = vm_invoke_block(th, GET_CFP(), num, flag); + if (val == Qundef) { + RESTORE_REGS(); + NEXT_INSN(); + } + +#line 1483 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_invokeblock +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(invokeblock);}}} +INSN_ENTRY(leave){ +{ + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("leave"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_leave 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_leave_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(leave)); +{ +#line 1059 "insns.def" + if (OPT_CHECKED_RUN) { + if (reg_cfp->sp != reg_cfp->bp) { + rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")", + VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, reg_cfp->bp)); + } + } + + RUBY_VM_CHECK_INTS(); + vm_pop_frame(th); + RESTORE_REGS(); + +#line 1516 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_leave +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(leave);}}} +INSN_ENTRY(finish){ +{ + + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("finish"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_finish 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_finish_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(finish)); +{ +#line 1082 "insns.def" +#if OPT_CALL_THREADED_CODE + rb_bug("unused instruction on OPT_CALL_THREADED_CODE"); +#else + th->cfp++; + return val; +#endif + +#line 1545 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_finish +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(finish);}}} +INSN_ENTRY(throw){ +{ + VALUE val; + rb_num_t throw_state = (rb_num_t)GET_OPERAND(1); + VALUE throwobj = TOPN(0); + DEBUG_ENTER_INSN("throw"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_throw 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_throw_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(throw)); + USAGE_ANALYSIS_OPERAND(BIN(throw), 0, throw_state); +{ +#line 1105 "insns.def" + RUBY_VM_CHECK_INTS(); + val = vm_throw(th, GET_CFP(), throw_state, throwobj); + THROW_EXCEPTION(val); + /* unreachable */ + +#line 1574 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_throw +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(throw);}}} +INSN_ENTRY(jump){ +{ + OFFSET dst = (OFFSET)GET_OPERAND(1); + + DEBUG_ENTER_INSN("jump"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_jump 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_jump_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(jump)); + USAGE_ANALYSIS_OPERAND(BIN(jump), 0, dst); +{ +#line 1126 "insns.def" + RUBY_VM_CHECK_INTS(); + JUMP(dst); + +#line 1599 "vm.inc" +#undef CURRENT_INSN_jump +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(jump);}}} +INSN_ENTRY(branchif){ +{ + OFFSET dst = (OFFSET)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("branchif"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_branchif 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_branchif_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(branchif)); + USAGE_ANALYSIS_OPERAND(BIN(branchif), 0, dst); +{ +#line 1141 "insns.def" + if (RTEST(val)) { + RUBY_VM_CHECK_INTS(); + JUMP(dst); + } + +#line 1626 "vm.inc" +#undef CURRENT_INSN_branchif +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(branchif);}}} +INSN_ENTRY(branchunless){ +{ + OFFSET dst = (OFFSET)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("branchunless"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_branchunless 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_branchunless_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(branchunless)); + USAGE_ANALYSIS_OPERAND(BIN(branchunless), 0, dst); +{ +#line 1158 "insns.def" + if (!RTEST(val)) { + RUBY_VM_CHECK_INTS(); + JUMP(dst); + } + +#line 1653 "vm.inc" +#undef CURRENT_INSN_branchunless +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(branchunless);}}} +INSN_ENTRY(getinlinecache){ +{ + VALUE val; + OFFSET dst = (OFFSET)GET_OPERAND(2); + IC ic = (IC)GET_OPERAND(1); + + DEBUG_ENTER_INSN("getinlinecache"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_getinlinecache 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_getinlinecache_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(getinlinecache)); + USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 0, ic); + USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 1, dst); +{ +#line 1180 "insns.def" + if (ic->ic_vmstat == GET_VM_STATE_VERSION()) { + val = ic->ic_value; + JUMP(dst); + } + else { + /* none */ + val = Qnil; + } + +#line 1686 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_getinlinecache +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(getinlinecache);}}} +INSN_ENTRY(onceinlinecache){ +{ + VALUE val; + OFFSET dst = (OFFSET)GET_OPERAND(2); + IC ic = (IC)GET_OPERAND(1); + + DEBUG_ENTER_INSN("onceinlinecache"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + #define CURRENT_INSN_onceinlinecache 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_onceinlinecache_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(onceinlinecache)); + USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 0, ic); + USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 1, dst); +{ +#line 1201 "insns.def" + if (ic->ic_vmstat) { + val = ic->ic_value; + JUMP(dst); + } + else { + /* none */ + val = Qnil; + } + +#line 1720 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_onceinlinecache +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(onceinlinecache);}}} +INSN_ENTRY(setinlinecache){ +{ + OFFSET dst = (OFFSET)GET_OPERAND(1); + VALUE val = TOPN(0); + DEBUG_ENTER_INSN("setinlinecache"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_setinlinecache 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_setinlinecache_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(setinlinecache)); + USAGE_ANALYSIS_OPERAND(BIN(setinlinecache), 0, dst); +{ +#line 1222 "insns.def" + IC ic = GET_CONST_INLINE_CACHE(dst); + + ic->ic_value = val; + ic->ic_vmstat = GET_VM_STATE_VERSION(); + +#line 1748 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_setinlinecache +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(setinlinecache);}}} +INSN_ENTRY(opt_case_dispatch){ +{ + OFFSET else_offset = (OFFSET)GET_OPERAND(2); + CDHASH hash = (CDHASH)GET_OPERAND(1); + VALUE key = TOPN(0); + DEBUG_ENTER_INSN("opt_case_dispatch"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_opt_case_dispatch 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_case_dispatch_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_case_dispatch)); + USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 0, hash); + USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 1, else_offset); +{ +#line 1239 "insns.def" + if (0) { + /* TODO: if some === method is overrided */ + } + else { + VALUE val; + if (st_lookup(RHASH_TBL(hash), key, &val)) { + JUMP(FIX2INT(val)); + } + else { + JUMP(else_offset); + } + } + +#line 1786 "vm.inc" +#undef CURRENT_INSN_opt_case_dispatch +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_case_dispatch);}}} +INSN_ENTRY(opt_checkenv){ +{ + + + DEBUG_ENTER_INSN("opt_checkenv"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_opt_checkenv 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_checkenv_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_checkenv)); +{ +#line 1264 "insns.def" + if (GET_CFP()->bp != GET_DFP() + 1) { + VALUE *new_dfp = GET_CFP()->bp - 1; + /* TODO: copy env and clean stack at creating env? */ + *new_dfp = *GET_DFP(); + SET_DFP(new_dfp); + } + +#line 1813 "vm.inc" +#undef CURRENT_INSN_opt_checkenv +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_checkenv);}}} +INSN_ENTRY(opt_plus){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_plus"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_plus 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_plus_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_plus)); +{ +#line 1286 "insns.def" + if (0) { + + } +#if 1 + else if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_PLUS)) { + /* fixnum + fixnum */ +#ifndef LONG_LONG_VALUE + val = (recv + (obj & (~1))); + if ((~(recv ^ obj) & (recv ^ val)) & + ((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) { + val = rb_big_plus(rb_int2big(FIX2LONG(recv)), + rb_int2big(FIX2LONG(obj))); + } +#else + long a, b, c; + a = FIX2LONG(recv); + b = FIX2LONG(obj); + c = a + b; + if (FIXABLE(c)) { + val = LONG2FIX(c); + } + else { + val = rb_big_plus(rb_int2big(a), rb_int2big(b)); + } +#endif + } +#endif + + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_PLUS)) { + val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj)); + } +#endif + +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cString && + HEAP_CLASS_OF(obj) == rb_cString && + BASIC_OP_UNREDEFINED_P(BOP_PLUS)) { + val = rb_str_plus(recv, obj); + } +#endif +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cArray && + BASIC_OP_UNREDEFINED_P(BOP_PLUS)) { + val = rb_ary_plus(recv, obj); + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idPLUS, recv); + } + +#line 1900 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_plus +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_plus);}}} +INSN_ENTRY(opt_minus){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_minus"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_minus 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_minus_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_minus)); +{ +#line 1362 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_MINUS)) { + long a, b, c; + + a = FIX2LONG(recv); + b = FIX2LONG(obj); + c = a - b; + + if (FIXABLE(c)) { + val = LONG2FIX(c); + } + else { + val = rb_big_minus(rb_int2big(a), rb_int2big(b)); + } + } + else { + /* other */ + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idMINUS, recv); + } + +#line 1946 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_minus +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_minus);}}} +INSN_ENTRY(opt_mult){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_mult"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_mult 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_mult_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_mult)); +{ +#line 1396 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_MULT)) { + long a, b, c; + + a = FIX2LONG(recv); + if (a == 0) { + val = recv; + } + else { + b = FIX2LONG(obj); + c = a * b; + + if (FIXABLE(c) && c / a == b) { + val = LONG2FIX(c); + } + else { + val = rb_big_mul(rb_int2big(a), rb_int2big(b)); + } + } + } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_MULT)) { + val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj)); + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idMULT, recv); + } + +#line 2011 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_mult +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_mult);}}} +INSN_ENTRY(opt_div){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_div"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_div 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_div_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_div)); +{ +#line 1449 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_DIV)) { + long x, y, div; + + x = FIX2LONG(recv); + y = FIX2LONG(obj); + { + /* copied from numeric.c#fixdivmod */ + long mod; + if (y == 0) + goto INSN_LABEL(normal_dispatch); + if (y < 0) { + if (x < 0) + div = -x / -y; + else + div = -(x / -y); + } + else { + if (x < 0) + div = -(-x / y); + else + div = x / y; + } + mod = x - div * y; + if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { + mod += y; + div -= 1; + } + } + val = LONG2NUM(div); + } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_DIV)) { + val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj)); + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idDIV, recv); + } + +#line 2087 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_div +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_div);}}} +INSN_ENTRY(opt_mod){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_mod"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_mod 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_mod_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_mod)); +{ +#line 1513 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_MOD)) { + long x, y, mod; + + x = FIX2LONG(recv); + y = FIX2LONG(obj); + { + /* copied from numeric.c#fixdivmod */ + long div; + + if (y == 0) + rb_num_zerodiv(); + if (y < 0) { + if (x < 0) + div = -x / -y; + else + div = -(x / -y); + } + else { + if (x < 0) + div = -(-x / y); + else + div = x / y; + } + mod = x - div * y; + if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { + mod += y; + div -= 1; + } + } + val = LONG2FIX(mod); + } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_MOD)) { + double x = RFLOAT_VALUE(recv); + double y = RFLOAT_VALUE(obj); + double div, mod; + + { + double z; + + modf(x / y, &z); + mod = x - z * y; + } + + div = (x - mod) / y; + if (y * mod < 0) { + mod += y; + div -= 1.0; + } + val = DBL2NUM(mod); + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idMOD, recv); + } + +#line 2178 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_mod +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_mod);}}} +INSN_ENTRY(opt_eq){ +{ + VALUE val; + IC ic = (IC)GET_OPERAND(1); + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_eq"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_eq 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_eq_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_eq)); + USAGE_ANALYSIS_OPERAND(BIN(opt_eq), 0, ic); +{ +#line 1592 "insns.def" + val = opt_eq_func(recv, obj, ic); + + if (val == Qundef) { + /* other */ + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idEq, recv); + } + +#line 2212 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_eq +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_eq);}}} +INSN_ENTRY(opt_neq){ +{ + VALUE val; + IC ic2 = (IC)GET_OPERAND(2); + IC ic1 = (IC)GET_OPERAND(1); + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_neq"); + ADD_PC(1+2); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_neq 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_neq_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_neq)); + USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 0, ic1); + USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 1, ic2); +{ +#line 1613 "insns.def" + extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2); + NODE *mn = vm_method_search(idNeq, CLASS_OF(recv), ic1); + val = Qundef; + + if (check_cfunc(mn, rb_obj_not_equal)) { + val = opt_eq_func(recv, obj, ic2); + + if (val != Qundef) { + val = RTEST(val) ? Qfalse : Qtrue; + } + } + + if (val == Qundef) { + /* other */ + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idNeq, recv); + } + +#line 2258 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_neq +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_neq);}}} +INSN_ENTRY(opt_lt){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_lt"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_lt 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_lt_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_lt)); +{ +#line 1644 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_LT)) { + SIGNED_VALUE a = recv, b = obj; + + if (a < b) { + val = Qtrue; + } + else { + val = Qfalse; + } + } + else { + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idLT, recv); + } + +#line 2299 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_lt +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_lt);}}} +INSN_ENTRY(opt_le){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_le"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_le 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_le_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_le)); +{ +#line 1673 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_LE)) { + SIGNED_VALUE a = recv, b = obj; + + if (a <= b) { + val = Qtrue; + } + else { + val = Qfalse; + } + } + else { + /* other */ + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idLE, recv); + } + +#line 2341 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_le +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_le);}}} +INSN_ENTRY(opt_gt){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_gt"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_gt 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_gt_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_gt)); +{ +#line 1703 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_GT)) { + SIGNED_VALUE a = recv, b = obj; + + if (a > b) { + val = Qtrue; + } + else { + val = Qfalse; + } + } + else { + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idGT, recv); + } + +#line 2382 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_gt +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_gt);}}} +INSN_ENTRY(opt_ge){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_ge"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_ge 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_ge_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_ge)); +{ +#line 1732 "insns.def" + if (FIXNUM_2_P(recv, obj) && + BASIC_OP_UNREDEFINED_P(BOP_GE)) { + SIGNED_VALUE a = recv, b = obj; + + if (a >= b) { + val = Qtrue; + } + else { + val = Qfalse; + } + } + else { + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idGE, recv); + } + +#line 2423 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_ge +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_ge);}}} +INSN_ENTRY(opt_ltlt){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_ltlt"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_ltlt 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_ltlt_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_ltlt)); +{ +#line 1761 "insns.def" + if (!SPECIAL_CONST_P(recv)) { + if (0) { + } + else if (HEAP_CLASS_OF(recv) == rb_cString && + BASIC_OP_UNREDEFINED_P(BOP_LTLT)) { + val = rb_str_concat(recv, obj); + } + else if (HEAP_CLASS_OF(recv) == rb_cArray && + BASIC_OP_UNREDEFINED_P(BOP_LTLT)) { + val = rb_ary_push(recv, obj); + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idLTLT, recv); + } + +#line 2469 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_ltlt +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_ltlt);}}} +INSN_ENTRY(opt_aref){ +{ + VALUE val; + + VALUE recv = TOPN(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_aref"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_aref 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_aref_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_aref)); +{ +#line 1795 "insns.def" + if (!SPECIAL_CONST_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_AREF)) { + if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) { + val = rb_ary_entry(recv, FIX2LONG(obj)); + } + else if (HEAP_CLASS_OF(recv) == rb_cHash) { + val = rb_hash_aref(recv, obj); + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + CALL_SIMPLE_METHOD(1, idAREF, recv); + } + +#line 2511 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_aref +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_aref);}}} +INSN_ENTRY(opt_aset){ +{ + VALUE val; + + VALUE recv = TOPN(2); + VALUE obj = TOPN(1); + VALUE set = TOPN(0); + DEBUG_ENTER_INSN("opt_aset"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(3); + #define CURRENT_INSN_opt_aset 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_aset_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_aset)); +{ +#line 1825 "insns.def" + if (!SPECIAL_CONST_P(recv) && + BASIC_OP_UNREDEFINED_P(BOP_ASET)) { + if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) { + rb_ary_store(recv, FIX2LONG(obj), set); + val = set; + } + else if (HEAP_CLASS_OF(recv) == rb_cHash) { + rb_hash_aset(recv, obj, set); + val = set; + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + PUSH(obj); + PUSH(set); + CALL_SIMPLE_METHOD(2, idASET, recv); + } + +#line 2558 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_aset +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_aset);}}} +INSN_ENTRY(opt_length){ +{ + VALUE val; + + VALUE recv = TOPN(0); + DEBUG_ENTER_INSN("opt_length"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_opt_length 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_length_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_length)); +{ +#line 1859 "insns.def" + if (!SPECIAL_CONST_P(recv) && + BASIC_OP_UNREDEFINED_P(BOP_LENGTH)) { + if (HEAP_CLASS_OF(recv) == rb_cString) { + val = rb_str_length(recv); + } + else if (HEAP_CLASS_OF(recv) == rb_cArray) { + val = LONG2NUM(RARRAY_LEN(recv)); + } + else if (HEAP_CLASS_OF(recv) == rb_cHash) { + val = INT2FIX(RHASH_SIZE(recv)); + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + INSN_LABEL(normal_dispatch): + PUSH(recv); + CALL_SIMPLE_METHOD(0, idLength, recv); + } + +#line 2602 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_length +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_length);}}} +INSN_ENTRY(opt_succ){ +{ + VALUE val; + + VALUE recv = TOPN(0); + DEBUG_ENTER_INSN("opt_succ"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_opt_succ 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_succ_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_succ)); +{ +#line 1892 "insns.def" + if (SPECIAL_CONST_P(recv)) { + if (FIXNUM_P(recv) && + BASIC_OP_UNREDEFINED_P(BOP_SUCC)) { + const VALUE obj = INT2FIX(1); + /* fixnum + INT2FIX(1) */ + val = (recv + (obj & (~1))); + if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) { + val = rb_big_plus(rb_int2big(FIX2LONG(recv)), + rb_int2big(FIX2LONG(obj))); + } + } + else { + goto INSN_LABEL(normal_dispatch); + } + } + else { + if (HEAP_CLASS_OF(recv) == rb_cString && + BASIC_OP_UNREDEFINED_P(BOP_SUCC)) { + val = rb_str_succ(recv); + } + else if (HEAP_CLASS_OF(recv) == rb_cTime && + BASIC_OP_UNREDEFINED_P(BOP_SUCC)) { + val = rb_time_succ(recv); + } + else + { + goto INSN_LABEL(normal_dispatch); + } + } + if (0) { + INSN_LABEL(normal_dispatch): + PUSH(recv); + CALL_SIMPLE_METHOD(0, idSucc, recv); + } + +#line 2660 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_succ +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_succ);}}} +INSN_ENTRY(opt_not){ +{ + VALUE val; + IC ic = (IC)GET_OPERAND(1); + VALUE recv = TOPN(0); + DEBUG_ENTER_INSN("opt_not"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_opt_not 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_not_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_not)); + USAGE_ANALYSIS_OPERAND(BIN(opt_not), 0, ic); +{ +#line 1939 "insns.def" + extern VALUE rb_obj_not(VALUE obj); + NODE *mn = vm_method_search(idNot, CLASS_OF(recv), ic); + + if (check_cfunc(mn, rb_obj_not)) { + val = RTEST(recv) ? Qfalse : Qtrue; + } + else { + PUSH(recv); + CALL_SIMPLE_METHOD(0, idNot, recv); + } + +#line 2695 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_not +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_not);}}} +INSN_ENTRY(opt_regexpmatch1){ +{ + VALUE val; + VALUE r = (VALUE)GET_OPERAND(1); + VALUE obj = TOPN(0); + DEBUG_ENTER_INSN("opt_regexpmatch1"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + POPN(1); + #define CURRENT_INSN_opt_regexpmatch1 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_regexpmatch1_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch1)); + USAGE_ANALYSIS_OPERAND(BIN(opt_regexpmatch1), 0, r); +{ +#line 1963 "insns.def" + val = rb_reg_match(r, obj); + +#line 2721 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_regexpmatch1 +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_regexpmatch1);}}} +INSN_ENTRY(opt_regexpmatch2){ +{ + VALUE val; + + VALUE obj2 = TOPN(1); + VALUE obj1 = TOPN(0); + DEBUG_ENTER_INSN("opt_regexpmatch2"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + POPN(2); + #define CURRENT_INSN_opt_regexpmatch2 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_regexpmatch2_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch2)); +{ +#line 1977 "insns.def" + if (TYPE(obj2) == T_STRING) { + val = rb_reg_match(obj1, obj2); + } + else { + val = rb_funcall(obj2, idEqTilde, 1, obj1); + } + +#line 2752 "vm.inc" + PUSH(val); +#undef CURRENT_INSN_opt_regexpmatch2 +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_regexpmatch2);}}} +INSN_ENTRY(opt_call_c_function){ +{ + rb_insn_func_t funcptr = (rb_insn_func_t)GET_OPERAND(1); + + DEBUG_ENTER_INSN("opt_call_c_function"); + ADD_PC(1+1); + PREFETCH(GET_PC()); + #define CURRENT_INSN_opt_call_c_function 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_opt_call_c_function_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(opt_call_c_function)); + USAGE_ANALYSIS_OPERAND(BIN(opt_call_c_function), 0, funcptr); +{ +#line 1996 "insns.def" + reg_cfp = (funcptr)(th, reg_cfp); + + if (reg_cfp == 0) { + VALUE err = th->errinfo; + th->errinfo = Qnil; + THROW_EXCEPTION(err); + } + + RESTORE_REGS(); + NEXT_INSN(); + +#line 2785 "vm.inc" +#undef CURRENT_INSN_opt_call_c_function +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(opt_call_c_function);}}} +INSN_ENTRY(bitblt){ +{ + VALUE ret; + + + DEBUG_ENTER_INSN("bitblt"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_bitblt 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_bitblt_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(bitblt)); +{ +#line 2019 "insns.def" + ret = rb_str_new2("a bit of bacon, lettuce and tomato"); + +#line 2808 "vm.inc" + PUSH(ret); +#undef CURRENT_INSN_bitblt +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(bitblt);}}} +INSN_ENTRY(answer){ +{ + VALUE ret; + + + DEBUG_ENTER_INSN("answer"); + ADD_PC(1+0); + PREFETCH(GET_PC()); + #define CURRENT_INSN_answer 1 + #define INSN_IS_SC() 0 + #define INSN_LABEL(lab) LABEL_answer_##lab + #define LABEL_IS_SC(lab) LABEL_##lab##_##t + USAGE_ANALYSIS_INSN(BIN(answer)); +{ +#line 2033 "insns.def" + ret = INT2FIX(42); + +#line 2832 "vm.inc" + PUSH(ret); +#undef CURRENT_INSN_answer +#undef INSN_IS_SC +#undef INSN_LABEL +#undef LABEL_IS_SC + END_INSN(answer);}}} + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/opt_sc.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/opt_sc.inc @@ -0,0 +1,662 @@ +/* -*-c-*- *********************************************************/ +/*******************************************************************/ +/*******************************************************************/ +/** + This file is for threaded code. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/opt_sc.inc.tmpl' + or rb/insns2vm.rb + */ + +#define SC_STATE_SIZE 6 + +#define SCS_XX 1 +#define SCS_AX 2 +#define SCS_BX 3 +#define SCS_AB 4 +#define SCS_BA 5 + +#define SC_ERROR 0xffffffff + +static const VALUE sc_insn_info[][SC_STATE_SIZE] = { + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR}, + { +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR, +SC_ERROR} +}; + +static const VALUE sc_insn_next[] = { + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX, + SCS_XX +}; + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/insns.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/insns.inc @@ -0,0 +1,178 @@ +/** -*-c-*- + This file contains YARV instructions list. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/insns.inc.tmpl' + or insns2vm.rb + */ + + +/* BIN : Basic Instruction Name */ +#define BIN(n) YARVINSN_##n + +enum ruby_vminsn_type { + BIN(nop) = 0, + + BIN(getlocal) = 1, + + BIN(setlocal) = 2, + + BIN(getspecial) = 3, + + BIN(setspecial) = 4, + + BIN(getdynamic) = 5, + + BIN(setdynamic) = 6, + + BIN(getinstancevariable) = 7, + + BIN(setinstancevariable) = 8, + + BIN(getclassvariable) = 9, + + BIN(setclassvariable) = 10, + + BIN(getconstant) = 11, + + BIN(setconstant) = 12, + + BIN(getglobal) = 13, + + BIN(setglobal) = 14, + + BIN(putnil) = 15, + + BIN(putself) = 16, + + BIN(putobject) = 17, + + BIN(putspecialobject) = 18, + + BIN(putiseq) = 19, + + BIN(putstring) = 20, + + BIN(concatstrings) = 21, + + BIN(tostring) = 22, + + BIN(toregexp) = 23, + + BIN(newarray) = 24, + + BIN(duparray) = 25, + + BIN(expandarray) = 26, + + BIN(concatarray) = 27, + + BIN(splatarray) = 28, + + BIN(checkincludearray) = 29, + + BIN(newhash) = 30, + + BIN(newrange) = 31, + + BIN(pop) = 32, + + BIN(dup) = 33, + + BIN(dupn) = 34, + + BIN(swap) = 35, + + BIN(reput) = 36, + + BIN(topn) = 37, + + BIN(setn) = 38, + + BIN(adjuststack) = 39, + + BIN(defined) = 40, + + BIN(trace) = 41, + + BIN(defineclass) = 42, + + BIN(send) = 43, + + BIN(invokesuper) = 44, + + BIN(invokeblock) = 45, + + BIN(leave) = 46, + + BIN(finish) = 47, + + BIN(throw) = 48, + + BIN(jump) = 49, + + BIN(branchif) = 50, + + BIN(branchunless) = 51, + + BIN(getinlinecache) = 52, + + BIN(onceinlinecache) = 53, + + BIN(setinlinecache) = 54, + + BIN(opt_case_dispatch) = 55, + + BIN(opt_checkenv) = 56, + + BIN(opt_plus) = 57, + + BIN(opt_minus) = 58, + + BIN(opt_mult) = 59, + + BIN(opt_div) = 60, + + BIN(opt_mod) = 61, + + BIN(opt_eq) = 62, + + BIN(opt_neq) = 63, + + BIN(opt_lt) = 64, + + BIN(opt_le) = 65, + + BIN(opt_gt) = 66, + + BIN(opt_ge) = 67, + + BIN(opt_ltlt) = 68, + + BIN(opt_aref) = 69, + + BIN(opt_aset) = 70, + + BIN(opt_length) = 71, + + BIN(opt_succ) = 72, + + BIN(opt_not) = 73, + + BIN(opt_regexpmatch1) = 74, + + BIN(opt_regexpmatch2) = 75, + + BIN(opt_call_c_function) = 76, + + BIN(bitblt) = 77, + + BIN(answer) = 78, + +}; + +#define VM_INSTRUCTION_SIZE 79 + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/vmtc.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/vmtc.inc @@ -0,0 +1,96 @@ +/* -*-c-*- *********************************************************/ +/*******************************************************************/ +/*******************************************************************/ +/** + This file is for threaded code. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/vmtc.inc.tmpl' + or insns2vm.rb + */ + +static const void *const insns_address_table[] = { + LABEL_PTR(nop), + LABEL_PTR(getlocal), + LABEL_PTR(setlocal), + LABEL_PTR(getspecial), + LABEL_PTR(setspecial), + LABEL_PTR(getdynamic), + LABEL_PTR(setdynamic), + LABEL_PTR(getinstancevariable), + LABEL_PTR(setinstancevariable), + LABEL_PTR(getclassvariable), + LABEL_PTR(setclassvariable), + LABEL_PTR(getconstant), + LABEL_PTR(setconstant), + LABEL_PTR(getglobal), + LABEL_PTR(setglobal), + LABEL_PTR(putnil), + LABEL_PTR(putself), + LABEL_PTR(putobject), + LABEL_PTR(putspecialobject), + LABEL_PTR(putiseq), + LABEL_PTR(putstring), + LABEL_PTR(concatstrings), + LABEL_PTR(tostring), + LABEL_PTR(toregexp), + LABEL_PTR(newarray), + LABEL_PTR(duparray), + LABEL_PTR(expandarray), + LABEL_PTR(concatarray), + LABEL_PTR(splatarray), + LABEL_PTR(checkincludearray), + LABEL_PTR(newhash), + LABEL_PTR(newrange), + LABEL_PTR(pop), + LABEL_PTR(dup), + LABEL_PTR(dupn), + LABEL_PTR(swap), + LABEL_PTR(reput), + LABEL_PTR(topn), + LABEL_PTR(setn), + LABEL_PTR(adjuststack), + LABEL_PTR(defined), + LABEL_PTR(trace), + LABEL_PTR(defineclass), + LABEL_PTR(send), + LABEL_PTR(invokesuper), + LABEL_PTR(invokeblock), + LABEL_PTR(leave), + LABEL_PTR(finish), + LABEL_PTR(throw), + LABEL_PTR(jump), + LABEL_PTR(branchif), + LABEL_PTR(branchunless), + LABEL_PTR(getinlinecache), + LABEL_PTR(onceinlinecache), + LABEL_PTR(setinlinecache), + LABEL_PTR(opt_case_dispatch), + LABEL_PTR(opt_checkenv), + LABEL_PTR(opt_plus), + LABEL_PTR(opt_minus), + LABEL_PTR(opt_mult), + LABEL_PTR(opt_div), + LABEL_PTR(opt_mod), + LABEL_PTR(opt_eq), + LABEL_PTR(opt_neq), + LABEL_PTR(opt_lt), + LABEL_PTR(opt_le), + LABEL_PTR(opt_gt), + LABEL_PTR(opt_ge), + LABEL_PTR(opt_ltlt), + LABEL_PTR(opt_aref), + LABEL_PTR(opt_aset), + LABEL_PTR(opt_length), + LABEL_PTR(opt_succ), + LABEL_PTR(opt_not), + LABEL_PTR(opt_regexpmatch1), + LABEL_PTR(opt_regexpmatch2), + LABEL_PTR(opt_call_c_function), + LABEL_PTR(bitblt), + LABEL_PTR(answer), +}; + --- ruby1.9-1.9.0.5.orig/debian/generated-incs/insns_info.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/insns_info.inc @@ -0,0 +1,688 @@ +/** -*-c-*- + This file contains instruction information for yarv instruction sequence. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/insns_info.inc.tmpl' + or insns2vm.rb + */ + +#define TS_ISEQ 'S' +#define TS_OFFSET 'O' +#define TS_GENTRY 'G' +#define TS_DINDEX 'D' +#define TS_VARIABLE '.' +#define TS_CDHASH 'H' +#define TS_IC 'C' +#define TS_ID 'I' +#define TS_NUM 'N' +#define TS_FUNCPTR 'F' +#define TS_VALUE 'V' +#define TS_LINDEX 'L' + +static const char *const insn_name_info[] = { + "nop", + "getlocal", + "setlocal", + "getspecial", + "setspecial", + "getdynamic", + "setdynamic", + "getinstancevariable", + "setinstancevariable", + "getclassvariable", + "setclassvariable", + "getconstant", + "setconstant", + "getglobal", + "setglobal", + "putnil", + "putself", + "putobject", + "putspecialobject", + "putiseq", + "putstring", + "concatstrings", + "tostring", + "toregexp", + "newarray", + "duparray", + "expandarray", + "concatarray", + "splatarray", + "checkincludearray", + "newhash", + "newrange", + "pop", + "dup", + "dupn", + "swap", + "reput", + "topn", + "setn", + "adjuststack", + "defined", + "trace", + "defineclass", + "send", + "invokesuper", + "invokeblock", + "leave", + "finish", + "throw", + "jump", + "branchif", + "branchunless", + "getinlinecache", + "onceinlinecache", + "setinlinecache", + "opt_case_dispatch", + "opt_checkenv", + "opt_plus", + "opt_minus", + "opt_mult", + "opt_div", + "opt_mod", + "opt_eq", + "opt_neq", + "opt_lt", + "opt_le", + "opt_gt", + "opt_ge", + "opt_ltlt", + "opt_aref", + "opt_aset", + "opt_length", + "opt_succ", + "opt_not", + "opt_regexpmatch1", + "opt_regexpmatch2", + "opt_call_c_function", + "bitblt", + "answer", + +}; + +static const char *const insn_operand_info[] = { + "", + "L", + "L", + "VN", + "V", + "DN", + "DN", + "I", + "I", + "I", + "I", + "I", + "I", + "G", + "G", + "", + "", + "V", + "N", + "S", + "V", + "N", + "", + "NN", + "N", + "V", + "NN", + "", + "V", + "V", + "N", + "N", + "", + "", + "N", + "", + "", + "N", + "N", + "N", + "NVV", + "N", + "ISN", + "INSNC", + "NSN", + "NN", + "", + "", + "N", + "O", + "O", + "O", + "CO", + "CO", + "O", + "HO", + "", + "", + "", + "", + "", + "", + "C", + "CC", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "C", + "V", + "", + "F", + "", + "", + +}; + +static const int insn_len_info[] = { + 1, + 2, + 2, + 3, + 2, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 1, + 3, + 2, + 2, + 3, + 1, + 2, + 2, + 2, + 2, + 1, + 1, + 2, + 1, + 1, + 2, + 2, + 2, + 4, + 2, + 4, + 6, + 4, + 3, + 1, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 2, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 1, + 2, + 1, + 1, + +}; + +#ifdef USE_INSN_RET_NUM +static const int insn_stack_push_num_info[] = { + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 0, + 2, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + +}; +#endif + +#ifdef USE_INSN_STACK_INCREASE +static int +insn_stack_increase(int depth, int insn, VALUE *opes) +{ + switch(insn){ + case BIN(nop):{ + return depth + 0; + } + case BIN(getlocal):{ + return depth + 1; + } + case BIN(setlocal):{ + return depth + -1; + } + case BIN(getspecial):{ + return depth + 1; + } + case BIN(setspecial):{ + return depth + -1; + } + case BIN(getdynamic):{ + return depth + 1; + } + case BIN(setdynamic):{ + return depth + -1; + } + case BIN(getinstancevariable):{ + return depth + 1; + } + case BIN(setinstancevariable):{ + return depth + -1; + } + case BIN(getclassvariable):{ + return depth + 1; + } + case BIN(setclassvariable):{ + return depth + -1; + } + case BIN(getconstant):{ + return depth + 0; + } + case BIN(setconstant):{ + return depth + -2; + } + case BIN(getglobal):{ + return depth + 1; + } + case BIN(setglobal):{ + return depth + -1; + } + case BIN(putnil):{ + return depth + 1; + } + case BIN(putself):{ + return depth + 1; + } + case BIN(putobject):{ + return depth + 1; + } + case BIN(putspecialobject):{ + return depth + 1; + } + case BIN(putiseq):{ + return depth + 1; + } + case BIN(putstring):{ + return depth + 1; + } + case BIN(concatstrings):{ + int inc = 0; + rb_num_t num = FIX2INT(opes[0]); + inc += 1 - num;; + return depth + inc; + } + case BIN(tostring):{ + return depth + 0; + } + case BIN(toregexp):{ + int inc = 0; + rb_num_t cnt = FIX2INT(opes[1]); + inc += 1 - cnt;; + return depth + inc; + } + case BIN(newarray):{ + int inc = 0; + rb_num_t num = FIX2INT(opes[0]); + inc += 1 - num;; + return depth + inc; + } + case BIN(duparray):{ + return depth + 1; + } + case BIN(expandarray):{ + int inc = 0; + rb_num_t num = FIX2INT(opes[0]); + rb_num_t flag = FIX2INT(opes[1]); + inc += num - 1 + (flag & 1 ? 1 : 0);; + return depth + inc; + } + case BIN(concatarray):{ + return depth + -1; + } + case BIN(splatarray):{ + return depth + 0; + } + case BIN(checkincludearray):{ + return depth + 0; + } + case BIN(newhash):{ + int inc = 0; + rb_num_t num = FIX2INT(opes[0]); + inc += 1 - num;; + return depth + inc; + } + case BIN(newrange):{ + return depth + -1; + } + case BIN(pop):{ + return depth + -1; + } + case BIN(dup):{ + return depth + 1; + } + case BIN(dupn):{ + int inc = 0; + rb_num_t n = FIX2INT(opes[0]); + inc += n;; + return depth + inc; + } + case BIN(swap):{ + return depth + 0; + } + case BIN(reput):{ + int inc = 0; + inc += 0;; + return depth + inc; + } + case BIN(topn):{ + int inc = 0; + inc += 1;; + return depth + inc; + } + case BIN(setn):{ + int inc = 0; + inc += 0; + return depth + inc; + } + case BIN(adjuststack):{ + int inc = 0; + rb_num_t n = FIX2INT(opes[0]); + inc -= n; + return depth + inc; + } + case BIN(defined):{ + return depth + 0; + } + case BIN(trace):{ + return depth + 0; + } + case BIN(defineclass):{ + return depth + -1; + } + case BIN(send):{ + int inc = 0; + rb_num_t op_argc = FIX2INT(opes[1]); + rb_num_t op_flag = FIX2INT(opes[3]); + inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));; + return depth + inc; + } + case BIN(invokesuper):{ + int inc = 0; + rb_num_t op_argc = FIX2INT(opes[0]); + rb_num_t op_flag = FIX2INT(opes[2]); + inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));; + return depth + inc; + } + case BIN(invokeblock):{ + int inc = 0; + rb_num_t num = FIX2INT(opes[0]); + inc += 1 - num;; + return depth + inc; + } + case BIN(leave):{ + return depth + 0; + } + case BIN(finish):{ + return depth + 0; + } + case BIN(throw):{ + return depth + 0; + } + case BIN(jump):{ + return depth + 0; + } + case BIN(branchif):{ + return depth + -1; + } + case BIN(branchunless):{ + return depth + -1; + } + case BIN(getinlinecache):{ + return depth + 1; + } + case BIN(onceinlinecache):{ + return depth + 1; + } + case BIN(setinlinecache):{ + return depth + 0; + } + case BIN(opt_case_dispatch):{ + int inc = 0; + inc += -1;; + return depth + inc; + } + case BIN(opt_checkenv):{ + return depth + 0; + } + case BIN(opt_plus):{ + return depth + -1; + } + case BIN(opt_minus):{ + return depth + -1; + } + case BIN(opt_mult):{ + return depth + -1; + } + case BIN(opt_div):{ + return depth + -1; + } + case BIN(opt_mod):{ + return depth + -1; + } + case BIN(opt_eq):{ + return depth + -1; + } + case BIN(opt_neq):{ + return depth + -1; + } + case BIN(opt_lt):{ + return depth + -1; + } + case BIN(opt_le):{ + return depth + -1; + } + case BIN(opt_gt):{ + return depth + -1; + } + case BIN(opt_ge):{ + return depth + -1; + } + case BIN(opt_ltlt):{ + return depth + -1; + } + case BIN(opt_aref):{ + return depth + -1; + } + case BIN(opt_aset):{ + return depth + -2; + } + case BIN(opt_length):{ + return depth + 0; + } + case BIN(opt_succ):{ + return depth + 0; + } + case BIN(opt_not):{ + return depth + 0; + } + case BIN(opt_regexpmatch1):{ + return depth + 0; + } + case BIN(opt_regexpmatch2):{ + return depth + -1; + } + case BIN(opt_call_c_function):{ + return depth + 0; + } + case BIN(bitblt):{ + return depth + 1; + } + case BIN(answer):{ + return depth + 1; + } + + default: + rb_bug("insn_sp_increase: unreachable"); + } + return 0; +} +#endif + +/* some utilities */ + +static int +insn_len(int insn) +{ + return insn_len_info[insn]; +} + +static const char * +insn_name(int insn) +{ + return insn_name_info[insn]; +} + +static const char * +insn_op_types(int insn) +{ + return insn_operand_info[insn]; +} + +static int +insn_op_type(int insn, int pos) +{ + int len = insn_len(insn) - 1; + if(pos < len){ + return insn_operand_info[insn][pos]; + } + else{ + return 0; + } +} + +#ifdef USE_INSN_RET_NUM +static int +insn_ret_num(int insn) +{ + return insn_stack_push_num_info[insn]; +} +#endif --- ruby1.9-1.9.0.5.orig/debian/generated-incs/known_errors.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/known_errors.inc @@ -0,0 +1,619 @@ +/** -*-c-*- + * DO NOT EDIT + * This file is automatically generated by tools/generic_erb.rb from + * template/known_errors.inc.tmpl and defs/known_errors.def. + */ + +void Init_syserr(void) { + rb_eNOERROR = set_syserr(0, "NOERROR"); +#ifdef EPERM + set_syserr(EPERM, "EPERM"); +#else + set_syserr(0, "EPERM"); +#endif +#ifdef ENOENT + set_syserr(ENOENT, "ENOENT"); +#else + set_syserr(0, "ENOENT"); +#endif +#ifdef ESRCH + set_syserr(ESRCH, "ESRCH"); +#else + set_syserr(0, "ESRCH"); +#endif +#ifdef EINTR + set_syserr(EINTR, "EINTR"); +#else + set_syserr(0, "EINTR"); +#endif +#ifdef EIO + set_syserr(EIO, "EIO"); +#else + set_syserr(0, "EIO"); +#endif +#ifdef ENXIO + set_syserr(ENXIO, "ENXIO"); +#else + set_syserr(0, "ENXIO"); +#endif +#ifdef E2BIG + set_syserr(E2BIG, "E2BIG"); +#else + set_syserr(0, "E2BIG"); +#endif +#ifdef ENOEXEC + set_syserr(ENOEXEC, "ENOEXEC"); +#else + set_syserr(0, "ENOEXEC"); +#endif +#ifdef EBADF + set_syserr(EBADF, "EBADF"); +#else + set_syserr(0, "EBADF"); +#endif +#ifdef ECHILD + set_syserr(ECHILD, "ECHILD"); +#else + set_syserr(0, "ECHILD"); +#endif +#ifdef EAGAIN + set_syserr(EAGAIN, "EAGAIN"); +#else + set_syserr(0, "EAGAIN"); +#endif +#ifdef ENOMEM + set_syserr(ENOMEM, "ENOMEM"); +#else + set_syserr(0, "ENOMEM"); +#endif +#ifdef EACCES + set_syserr(EACCES, "EACCES"); +#else + set_syserr(0, "EACCES"); +#endif +#ifdef EFAULT + set_syserr(EFAULT, "EFAULT"); +#else + set_syserr(0, "EFAULT"); +#endif +#ifdef ENOTBLK + set_syserr(ENOTBLK, "ENOTBLK"); +#else + set_syserr(0, "ENOTBLK"); +#endif +#ifdef EBUSY + set_syserr(EBUSY, "EBUSY"); +#else + set_syserr(0, "EBUSY"); +#endif +#ifdef EEXIST + set_syserr(EEXIST, "EEXIST"); +#else + set_syserr(0, "EEXIST"); +#endif +#ifdef EXDEV + set_syserr(EXDEV, "EXDEV"); +#else + set_syserr(0, "EXDEV"); +#endif +#ifdef ENODEV + set_syserr(ENODEV, "ENODEV"); +#else + set_syserr(0, "ENODEV"); +#endif +#ifdef ENOTDIR + set_syserr(ENOTDIR, "ENOTDIR"); +#else + set_syserr(0, "ENOTDIR"); +#endif +#ifdef EISDIR + set_syserr(EISDIR, "EISDIR"); +#else + set_syserr(0, "EISDIR"); +#endif +#ifdef EINVAL + set_syserr(EINVAL, "EINVAL"); +#else + set_syserr(0, "EINVAL"); +#endif +#ifdef ENFILE + set_syserr(ENFILE, "ENFILE"); +#else + set_syserr(0, "ENFILE"); +#endif +#ifdef EMFILE + set_syserr(EMFILE, "EMFILE"); +#else + set_syserr(0, "EMFILE"); +#endif +#ifdef ENOTTY + set_syserr(ENOTTY, "ENOTTY"); +#else + set_syserr(0, "ENOTTY"); +#endif +#ifdef ETXTBSY + set_syserr(ETXTBSY, "ETXTBSY"); +#else + set_syserr(0, "ETXTBSY"); +#endif +#ifdef EFBIG + set_syserr(EFBIG, "EFBIG"); +#else + set_syserr(0, "EFBIG"); +#endif +#ifdef ENOSPC + set_syserr(ENOSPC, "ENOSPC"); +#else + set_syserr(0, "ENOSPC"); +#endif +#ifdef ESPIPE + set_syserr(ESPIPE, "ESPIPE"); +#else + set_syserr(0, "ESPIPE"); +#endif +#ifdef EROFS + set_syserr(EROFS, "EROFS"); +#else + set_syserr(0, "EROFS"); +#endif +#ifdef EMLINK + set_syserr(EMLINK, "EMLINK"); +#else + set_syserr(0, "EMLINK"); +#endif +#ifdef EPIPE + set_syserr(EPIPE, "EPIPE"); +#else + set_syserr(0, "EPIPE"); +#endif +#ifdef EDOM + set_syserr(EDOM, "EDOM"); +#else + set_syserr(0, "EDOM"); +#endif +#ifdef ERANGE + set_syserr(ERANGE, "ERANGE"); +#else + set_syserr(0, "ERANGE"); +#endif +#ifdef EDEADLK + set_syserr(EDEADLK, "EDEADLK"); +#else + set_syserr(0, "EDEADLK"); +#endif +#ifdef ENAMETOOLONG + set_syserr(ENAMETOOLONG, "ENAMETOOLONG"); +#else + set_syserr(0, "ENAMETOOLONG"); +#endif +#ifdef ENOLCK + set_syserr(ENOLCK, "ENOLCK"); +#else + set_syserr(0, "ENOLCK"); +#endif +#ifdef ENOSYS + set_syserr(ENOSYS, "ENOSYS"); +#else + set_syserr(0, "ENOSYS"); +#endif +#ifdef ENOTEMPTY + set_syserr(ENOTEMPTY, "ENOTEMPTY"); +#else + set_syserr(0, "ENOTEMPTY"); +#endif +#ifdef ELOOP + set_syserr(ELOOP, "ELOOP"); +#else + set_syserr(0, "ELOOP"); +#endif +#ifdef EWOULDBLOCK + set_syserr(EWOULDBLOCK, "EWOULDBLOCK"); +#else + set_syserr(0, "EWOULDBLOCK"); +#endif +#ifdef ENOMSG + set_syserr(ENOMSG, "ENOMSG"); +#else + set_syserr(0, "ENOMSG"); +#endif +#ifdef EIDRM + set_syserr(EIDRM, "EIDRM"); +#else + set_syserr(0, "EIDRM"); +#endif +#ifdef ECHRNG + set_syserr(ECHRNG, "ECHRNG"); +#else + set_syserr(0, "ECHRNG"); +#endif +#ifdef EL2NSYNC + set_syserr(EL2NSYNC, "EL2NSYNC"); +#else + set_syserr(0, "EL2NSYNC"); +#endif +#ifdef EL3HLT + set_syserr(EL3HLT, "EL3HLT"); +#else + set_syserr(0, "EL3HLT"); +#endif +#ifdef EL3RST + set_syserr(EL3RST, "EL3RST"); +#else + set_syserr(0, "EL3RST"); +#endif +#ifdef ELNRNG + set_syserr(ELNRNG, "ELNRNG"); +#else + set_syserr(0, "ELNRNG"); +#endif +#ifdef EUNATCH + set_syserr(EUNATCH, "EUNATCH"); +#else + set_syserr(0, "EUNATCH"); +#endif +#ifdef ENOCSI + set_syserr(ENOCSI, "ENOCSI"); +#else + set_syserr(0, "ENOCSI"); +#endif +#ifdef EL2HLT + set_syserr(EL2HLT, "EL2HLT"); +#else + set_syserr(0, "EL2HLT"); +#endif +#ifdef EBADE + set_syserr(EBADE, "EBADE"); +#else + set_syserr(0, "EBADE"); +#endif +#ifdef EBADR + set_syserr(EBADR, "EBADR"); +#else + set_syserr(0, "EBADR"); +#endif +#ifdef EXFULL + set_syserr(EXFULL, "EXFULL"); +#else + set_syserr(0, "EXFULL"); +#endif +#ifdef ENOANO + set_syserr(ENOANO, "ENOANO"); +#else + set_syserr(0, "ENOANO"); +#endif +#ifdef EBADRQC + set_syserr(EBADRQC, "EBADRQC"); +#else + set_syserr(0, "EBADRQC"); +#endif +#ifdef EBADSLT + set_syserr(EBADSLT, "EBADSLT"); +#else + set_syserr(0, "EBADSLT"); +#endif +#ifdef EDEADLOCK + set_syserr(EDEADLOCK, "EDEADLOCK"); +#else + set_syserr(0, "EDEADLOCK"); +#endif +#ifdef EBFONT + set_syserr(EBFONT, "EBFONT"); +#else + set_syserr(0, "EBFONT"); +#endif +#ifdef ENOSTR + set_syserr(ENOSTR, "ENOSTR"); +#else + set_syserr(0, "ENOSTR"); +#endif +#ifdef ENODATA + set_syserr(ENODATA, "ENODATA"); +#else + set_syserr(0, "ENODATA"); +#endif +#ifdef ETIME + set_syserr(ETIME, "ETIME"); +#else + set_syserr(0, "ETIME"); +#endif +#ifdef ENOSR + set_syserr(ENOSR, "ENOSR"); +#else + set_syserr(0, "ENOSR"); +#endif +#ifdef ENONET + set_syserr(ENONET, "ENONET"); +#else + set_syserr(0, "ENONET"); +#endif +#ifdef ENOPKG + set_syserr(ENOPKG, "ENOPKG"); +#else + set_syserr(0, "ENOPKG"); +#endif +#ifdef EREMOTE + set_syserr(EREMOTE, "EREMOTE"); +#else + set_syserr(0, "EREMOTE"); +#endif +#ifdef ENOLINK + set_syserr(ENOLINK, "ENOLINK"); +#else + set_syserr(0, "ENOLINK"); +#endif +#ifdef EADV + set_syserr(EADV, "EADV"); +#else + set_syserr(0, "EADV"); +#endif +#ifdef ESRMNT + set_syserr(ESRMNT, "ESRMNT"); +#else + set_syserr(0, "ESRMNT"); +#endif +#ifdef ECOMM + set_syserr(ECOMM, "ECOMM"); +#else + set_syserr(0, "ECOMM"); +#endif +#ifdef EPROTO + set_syserr(EPROTO, "EPROTO"); +#else + set_syserr(0, "EPROTO"); +#endif +#ifdef EMULTIHOP + set_syserr(EMULTIHOP, "EMULTIHOP"); +#else + set_syserr(0, "EMULTIHOP"); +#endif +#ifdef EDOTDOT + set_syserr(EDOTDOT, "EDOTDOT"); +#else + set_syserr(0, "EDOTDOT"); +#endif +#ifdef EBADMSG + set_syserr(EBADMSG, "EBADMSG"); +#else + set_syserr(0, "EBADMSG"); +#endif +#ifdef EOVERFLOW + set_syserr(EOVERFLOW, "EOVERFLOW"); +#else + set_syserr(0, "EOVERFLOW"); +#endif +#ifdef ENOTUNIQ + set_syserr(ENOTUNIQ, "ENOTUNIQ"); +#else + set_syserr(0, "ENOTUNIQ"); +#endif +#ifdef EBADFD + set_syserr(EBADFD, "EBADFD"); +#else + set_syserr(0, "EBADFD"); +#endif +#ifdef EREMCHG + set_syserr(EREMCHG, "EREMCHG"); +#else + set_syserr(0, "EREMCHG"); +#endif +#ifdef ELIBACC + set_syserr(ELIBACC, "ELIBACC"); +#else + set_syserr(0, "ELIBACC"); +#endif +#ifdef ELIBBAD + set_syserr(ELIBBAD, "ELIBBAD"); +#else + set_syserr(0, "ELIBBAD"); +#endif +#ifdef ELIBSCN + set_syserr(ELIBSCN, "ELIBSCN"); +#else + set_syserr(0, "ELIBSCN"); +#endif +#ifdef ELIBMAX + set_syserr(ELIBMAX, "ELIBMAX"); +#else + set_syserr(0, "ELIBMAX"); +#endif +#ifdef ELIBEXEC + set_syserr(ELIBEXEC, "ELIBEXEC"); +#else + set_syserr(0, "ELIBEXEC"); +#endif +#ifdef EILSEQ + set_syserr(EILSEQ, "EILSEQ"); +#else + set_syserr(0, "EILSEQ"); +#endif +#ifdef ERESTART + set_syserr(ERESTART, "ERESTART"); +#else + set_syserr(0, "ERESTART"); +#endif +#ifdef ESTRPIPE + set_syserr(ESTRPIPE, "ESTRPIPE"); +#else + set_syserr(0, "ESTRPIPE"); +#endif +#ifdef EUSERS + set_syserr(EUSERS, "EUSERS"); +#else + set_syserr(0, "EUSERS"); +#endif +#ifdef ENOTSOCK + set_syserr(ENOTSOCK, "ENOTSOCK"); +#else + set_syserr(0, "ENOTSOCK"); +#endif +#ifdef EDESTADDRREQ + set_syserr(EDESTADDRREQ, "EDESTADDRREQ"); +#else + set_syserr(0, "EDESTADDRREQ"); +#endif +#ifdef EMSGSIZE + set_syserr(EMSGSIZE, "EMSGSIZE"); +#else + set_syserr(0, "EMSGSIZE"); +#endif +#ifdef EPROTOTYPE + set_syserr(EPROTOTYPE, "EPROTOTYPE"); +#else + set_syserr(0, "EPROTOTYPE"); +#endif +#ifdef ENOPROTOOPT + set_syserr(ENOPROTOOPT, "ENOPROTOOPT"); +#else + set_syserr(0, "ENOPROTOOPT"); +#endif +#ifdef EPROTONOSUPPORT + set_syserr(EPROTONOSUPPORT, "EPROTONOSUPPORT"); +#else + set_syserr(0, "EPROTONOSUPPORT"); +#endif +#ifdef ESOCKTNOSUPPORT + set_syserr(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT"); +#else + set_syserr(0, "ESOCKTNOSUPPORT"); +#endif +#ifdef EOPNOTSUPP + set_syserr(EOPNOTSUPP, "EOPNOTSUPP"); +#else + set_syserr(0, "EOPNOTSUPP"); +#endif +#ifdef EPFNOSUPPORT + set_syserr(EPFNOSUPPORT, "EPFNOSUPPORT"); +#else + set_syserr(0, "EPFNOSUPPORT"); +#endif +#ifdef EAFNOSUPPORT + set_syserr(EAFNOSUPPORT, "EAFNOSUPPORT"); +#else + set_syserr(0, "EAFNOSUPPORT"); +#endif +#ifdef EADDRINUSE + set_syserr(EADDRINUSE, "EADDRINUSE"); +#else + set_syserr(0, "EADDRINUSE"); +#endif +#ifdef EADDRNOTAVAIL + set_syserr(EADDRNOTAVAIL, "EADDRNOTAVAIL"); +#else + set_syserr(0, "EADDRNOTAVAIL"); +#endif +#ifdef ENETDOWN + set_syserr(ENETDOWN, "ENETDOWN"); +#else + set_syserr(0, "ENETDOWN"); +#endif +#ifdef ENETUNREACH + set_syserr(ENETUNREACH, "ENETUNREACH"); +#else + set_syserr(0, "ENETUNREACH"); +#endif +#ifdef ENETRESET + set_syserr(ENETRESET, "ENETRESET"); +#else + set_syserr(0, "ENETRESET"); +#endif +#ifdef ECONNABORTED + set_syserr(ECONNABORTED, "ECONNABORTED"); +#else + set_syserr(0, "ECONNABORTED"); +#endif +#ifdef ECONNRESET + set_syserr(ECONNRESET, "ECONNRESET"); +#else + set_syserr(0, "ECONNRESET"); +#endif +#ifdef ENOBUFS + set_syserr(ENOBUFS, "ENOBUFS"); +#else + set_syserr(0, "ENOBUFS"); +#endif +#ifdef EISCONN + set_syserr(EISCONN, "EISCONN"); +#else + set_syserr(0, "EISCONN"); +#endif +#ifdef ENOTCONN + set_syserr(ENOTCONN, "ENOTCONN"); +#else + set_syserr(0, "ENOTCONN"); +#endif +#ifdef ESHUTDOWN + set_syserr(ESHUTDOWN, "ESHUTDOWN"); +#else + set_syserr(0, "ESHUTDOWN"); +#endif +#ifdef ETOOMANYREFS + set_syserr(ETOOMANYREFS, "ETOOMANYREFS"); +#else + set_syserr(0, "ETOOMANYREFS"); +#endif +#ifdef ETIMEDOUT + set_syserr(ETIMEDOUT, "ETIMEDOUT"); +#else + set_syserr(0, "ETIMEDOUT"); +#endif +#ifdef ECONNREFUSED + set_syserr(ECONNREFUSED, "ECONNREFUSED"); +#else + set_syserr(0, "ECONNREFUSED"); +#endif +#ifdef EHOSTDOWN + set_syserr(EHOSTDOWN, "EHOSTDOWN"); +#else + set_syserr(0, "EHOSTDOWN"); +#endif +#ifdef EHOSTUNREACH + set_syserr(EHOSTUNREACH, "EHOSTUNREACH"); +#else + set_syserr(0, "EHOSTUNREACH"); +#endif +#ifdef EALREADY + set_syserr(EALREADY, "EALREADY"); +#else + set_syserr(0, "EALREADY"); +#endif +#ifdef EINPROGRESS + set_syserr(EINPROGRESS, "EINPROGRESS"); +#else + set_syserr(0, "EINPROGRESS"); +#endif +#ifdef ESTALE + set_syserr(ESTALE, "ESTALE"); +#else + set_syserr(0, "ESTALE"); +#endif +#ifdef EUCLEAN + set_syserr(EUCLEAN, "EUCLEAN"); +#else + set_syserr(0, "EUCLEAN"); +#endif +#ifdef ENOTNAM + set_syserr(ENOTNAM, "ENOTNAM"); +#else + set_syserr(0, "ENOTNAM"); +#endif +#ifdef ENAVAIL + set_syserr(ENAVAIL, "ENAVAIL"); +#else + set_syserr(0, "ENAVAIL"); +#endif +#ifdef EISNAM + set_syserr(EISNAM, "EISNAM"); +#else + set_syserr(0, "EISNAM"); +#endif +#ifdef EREMOTEIO + set_syserr(EREMOTEIO, "EREMOTEIO"); +#else + set_syserr(0, "EREMOTEIO"); +#endif +#ifdef EDQUOT + set_syserr(EDQUOT, "EDQUOT"); +#else + set_syserr(0, "EDQUOT"); +#endif +} --- ruby1.9-1.9.0.5.orig/debian/generated-incs/optunifs.inc +++ ruby1.9-1.9.0.5/debian/generated-incs/optunifs.inc @@ -0,0 +1,115 @@ +/* -*-c-*- *********************************************************/ +/*******************************************************************/ +/*******************************************************************/ +/** + This file is for threaded code. + + ---- + This file is auto generated by insns2vm.rb + DO NOT TOUCH! + + If you want to fix something, you must edit 'template/optunifs.inc.tmpl' + or rb/insns2vm.rb + */ + +/* + static const int UNIFIED_insn_name_1[] = {id, size, ...}; + static const int UNIFIED_insn_name_2[] = {id, size, ...}; + ... + + static const int *const UNIFIED_insn_name[] = {size, + UNIFIED_insn_name_1, + UNIFIED_insn_name_2, ...}; + ... + + static const int *const *const unified_insns_data[] = { + UNIFIED_insn_nameA, + UNIFIED_insn_nameB, ...}; + */ + + + +static const int *const *const unified_insns_data[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; + + +#undef GET_INSN_NAME + --- ruby1.9-1.9.0.5.orig/debian/patches/305_r18496_dl_tain.dpatch +++ ruby1.9-1.9.0.5/debian/patches/305_r18496_dl_tain.dpatch @@ -0,0 +1,119 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 305_r18496_dl_tain.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: dl doesn't check taintness, so it could allow attackers to +## DP: call dangerous functions. r18496. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 10:24:13.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 10:24:49.000000000 +0900 +@@ -1,3 +1,15 @@ ++Mon Aug 11 20:27:12 2008 Yukihiro Matsumoto ++ ++ * ext/dl/cfunc.c (rb_dlcfunc_call): add taint check. ++ ++ * ext/dl/dl.c (rb_dl_malloc): add rb_secure(2). ++ ++ * ext/dl/dl.c (rb_dl_realloc): ditto. ++ ++ * ext/dl/dl.c (rb_dl_free): ditto. ++ ++ * ext/dl/dl.c (rb_dl_ptr2value): ditto. ++ + Fri Aug 8 10:53:52 2008 Tanaka Akira + + * lib/resolv.rb: randomize source port and transaction id. +diff -urNad ruby1.9~/ext/dl/cfunc.c ruby1.9/ext/dl/cfunc.c +--- ruby1.9~/ext/dl/cfunc.c 2007-07-15 22:24:39.000000000 +0900 ++++ ruby1.9/ext/dl/cfunc.c 2008-09-03 10:24:13.000000000 +0900 +@@ -260,6 +260,7 @@ + if( i >= DLSTACK_SIZE ){ + rb_raise(rb_eDLError, "too many arguments (stack overflow)"); + } ++ rb_check_safe_obj(RARRAY_PTR(ary)[i]); + stack[i] = NUM2LONG(RARRAY_PTR(ary)[i]); + } + +diff -urNad ruby1.9~/ext/dl/cptr.c ruby1.9/ext/dl/cptr.c +--- ruby1.9~/ext/dl/cptr.c 2007-08-08 19:20:08.000000000 +0900 ++++ ruby1.9/ext/dl/cptr.c 2008-09-03 10:24:13.000000000 +0900 +@@ -416,29 +416,33 @@ + VALUE + rb_dlptr_s_to_ptr(VALUE self, VALUE val) + { +- if( rb_obj_is_kind_of(val, rb_cIO) == Qtrue ){ ++ VALUE ptr; ++ ++ if (rb_obj_is_kind_of(val, rb_cIO) == Qtrue){ + rb_io_t *fptr; + FILE *fp; + GetOpenFile(val, fptr); + fp = rb_io_stdio_file(fptr); +- return rb_dlptr_new(fp, 0, NULL); ++ ptr = rb_dlptr_new(fp, 0, NULL); + } +- else if( rb_obj_is_kind_of(val, rb_cString) == Qtrue ){ ++ else if (rb_obj_is_kind_of(val, rb_cString) == Qtrue){ + char *ptr = StringValuePtr(val); +- return rb_dlptr_new(ptr, RSTRING_LEN(val), NULL); ++ ptr = rb_dlptr_new(ptr, RSTRING_LEN(val), NULL); + } +- else if( rb_respond_to(val, id_to_ptr) ){ ++ else if (rb_respond_to(val, id_to_ptr)){ + VALUE vptr = rb_funcall(val, id_to_ptr, 0); +- if( rb_obj_is_kind_of(vptr, rb_cDLCPtr) ){ +- return vptr; ++ if (rb_obj_is_kind_of(vptr, rb_cDLCPtr)){ ++ ptr = vptr; + } + else{ + rb_raise(rb_eDLError, "to_ptr should return a CPtr object"); + } + } + else{ +- return rb_dlptr_new(NUM2PTR(rb_Integer(val)), 0, NULL); ++ ptr = rb_dlptr_new(NUM2PTR(rb_Integer(val)), 0, NULL); + } ++ OBJ_INFECT(ptr, val); ++ return ptr; + } + + void +diff -urNad ruby1.9~/ext/dl/dl.c ruby1.9/ext/dl/dl.c +--- ruby1.9~/ext/dl/dl.c 2007-06-10 12:06:15.000000000 +0900 ++++ ruby1.9/ext/dl/dl.c 2008-09-03 10:24:13.000000000 +0900 +@@ -22,6 +22,7 @@ + { + void *ptr; + ++ rb_secure(4); + ptr = (void*)ruby_xmalloc(NUM2INT(size)); + return PTR2NUM(ptr); + } +@@ -31,6 +32,7 @@ + { + void *ptr = NUM2PTR(addr); + ++ rb_secure(4); + ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size)); + return PTR2NUM(ptr); + } +@@ -39,6 +41,8 @@ + rb_dl_free(VALUE self, VALUE addr) + { + void *ptr = NUM2PTR(addr); ++ ++ rb_secure(4); + ruby_xfree(ptr); + return Qnil; + } +@@ -46,6 +50,7 @@ + VALUE + rb_dl_ptr2value(VALUE self, VALUE addr) + { ++ rb_secure(4); + return (VALUE)NUM2PTR(addr); + } + --- ruby1.9-1.9.0.5.orig/debian/patches/201_gem_prelude.dpatch +++ ruby1.9-1.9.0.5/debian/patches/201_gem_prelude.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 201_gem_prelude.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Adjust the default RubyGems directory. + +@DPATCH@ +diff -urNad trunk~/gem_prelude.rb trunk/gem_prelude.rb +--- trunk~/gem_prelude.rb 2008-06-18 08:59:31.000000000 +0900 ++++ trunk/gem_prelude.rb 2009-08-19 22:47:44.000000000 +0900 +@@ -24,12 +24,13 @@ + :ruby_install_name => RbConfig::CONFIG["ruby_install_name"] + } + ++ # Debian patch: search order of this directory. ++ # 1. GEM_HOME enviroment variable ++ # (Using this, Gems are to be installed in any path as you like) ++ # 2. /var/lib/gems/{ruby version} (This is the default path in Debian system) ++ # + def self.default_dir +- if defined? RUBY_FRAMEWORK_VERSION +- return File.join(File.dirname(ConfigMap[:sitedir]), "Gems") +- else +- File.join(ConfigMap[:libdir], 'ruby', 'gems', ConfigMap[:ruby_version]) +- end ++ File.join('/', 'var', 'lib', 'gems', ConfigMap[:ruby_version]) + end + + def self.dir --- ruby1.9-1.9.0.5.orig/debian/patches/900_ri_pager.dpatch +++ ruby1.9-1.9.0.5/debian/patches/900_ri_pager.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 900_ri_pager.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.1~/lib/rdoc/ri/display.rb ruby1.9-1.9.0.1/lib/rdoc/ri/display.rb +--- ruby1.9-1.9.0.1~/lib/rdoc/ri/display.rb 2008-01-31 15:48:35.000000000 +0900 ++++ ruby1.9-1.9.0.1/lib/rdoc/ri/display.rb 2008-03-06 11:35:27.000000000 +0900 +@@ -192,7 +192,7 @@ + + def setup_pager + unless @use_stdout then +- for pager in [ ENV['PAGER'], "less", "more", 'pager' ].compact.uniq ++ for pager in [ ENV['PAGER'], "pager", "less", "more" ].compact.uniq + return IO.popen(pager, "w") rescue nil + end + @use_stdout = true --- ruby1.9-1.9.0.5.orig/debian/patches/931_CVE-2009-0642.dpatch +++ ruby1.9-1.9.0.5/debian/patches/931_CVE-2009-0642.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 931_CVE-2009-0642.dpatch by Nico Golde +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.2~/ext/openssl/ossl_ocsp.c ruby1.9-1.9.0.2/ext/openssl/ossl_ocsp.c +--- ruby1.9-1.9.0.2~/ext/openssl/ossl_ocsp.c 2007-02-13 00:01:19.000000000 +0100 ++++ ruby1.9-1.9.0.2/ext/openssl/ossl_ocsp.c 2009-04-06 18:43:12.000000000 +0200 +@@ -589,22 +589,22 @@ + static VALUE + ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self) + { +- VALUE certs, store, flags; ++ VALUE certs, store, flags, result; + OCSP_BASICRESP *bs; + STACK_OF(X509) *x509s; + X509_STORE *x509st; +- int flg, result; ++ int flg; + + rb_scan_args(argc, argv, "21", &certs, &store, &flags); + x509st = GetX509StorePtr(store); + flg = NIL_P(flags) ? 0 : INT2NUM(flags); + x509s = ossl_x509_ary2sk(certs); + GetOCSPBasicRes(self, bs); +- result = OCSP_basic_verify(bs, x509s, x509st, flg); ++ result = OCSP_basic_verify(bs, x509s, x509st, flg) > 0 ? Qtrue : Qfalse; + sk_X509_pop_free(x509s, X509_free); + if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL)); + +- return result ? Qtrue : Qfalse; ++ return result; + } + + /* --- ruby1.9-1.9.0.5.orig/debian/patches/306_r17586_methods_called_safelevel13.dpatch +++ ruby1.9-1.9.0.5/debian/patches/306_r17586_methods_called_safelevel13.dpatch @@ -0,0 +1,42 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 306_r17586_methods_called_safelevel13.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Insecure methods may be called at safe level 1-3. r17586. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 10:25:05.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 10:25:25.000000000 +0900 +@@ -18,6 +18,11 @@ + * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is + "". + ++Fri Jun 27 00:00:14 2008 Nobuyoshi Nakada ++ ++ * ruby.c (set_arg0, ruby_prog_init): freeze $0. a patch from Keita ++ Yamaguchi . ++ + Thu Jun 26 17:43:41 2008 Yukihiro Matsumoto + + * variable.c (rb_f_trace_var): should not be allowed at safe level 4. +diff -urNad ruby1.9~/ruby.c ruby1.9/ruby.c +--- ruby1.9~/ruby.c 2008-06-18 21:08:16.000000000 +0900 ++++ ruby1.9/ruby.c 2008-09-03 10:25:06.000000000 +0900 +@@ -1397,14 +1397,14 @@ + } + } + #endif +- rb_progname = rb_tainted_str_new(s, i); ++ rb_progname = rb_obj_freeze(rb_tainted_str_new(s, i)); + } + + void + ruby_script(const char *name) + { + if (name) { +- rb_progname = rb_tainted_str_new2(name); ++ rb_progname = rb_obj_freeze(rb_tainted_str_new2(name)); + } + } + --- ruby1.9-1.9.0.5.orig/debian/patches/940_test_thread_mutex_sync_shorter.dpatch +++ ruby1.9-1.9.0.5/debian/patches/940_test_thread_mutex_sync_shorter.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 940_test_thread_mutex_sync_shorter.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: test_mutex_synchronize takes a very long time on slow arches, +## DP: especially hppa (since it doesn't support NPTL). +## DP: The patch makes the test shorter by creating less concurrent +## DP: threads. Closes: #514696. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.5~/test/ruby/test_thread.rb ruby1.9-1.9.0.5/test/ruby/test_thread.rb +--- ruby1.9-1.9.0.5~/test/ruby/test_thread.rb 2008-09-24 19:44:39.000000000 +0200 ++++ ruby1.9-1.9.0.5/test/ruby/test_thread.rb 2009-02-18 00:17:17.000000000 +0100 +@@ -30,7 +30,7 @@ + def test_mutex_synchronize + m = Mutex.new + r = 0 +- max = 100 ++ max = 10 + (1..max).map{ + Thread.new{ + i=0 --- ruby1.9-1.9.0.5.orig/debian/patches/101_parse_rb.dpatch +++ ruby1.9-1.9.0.5/debian/patches/101_parse_rb.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 101_parse_rb.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from r17497 to make rdoc work fine. + +@DPATCH@ +diff -urNad trunk~/lib/rdoc/parsers/parse_rb.rb trunk/lib/rdoc/parsers/parse_rb.rb +--- trunk~/lib/rdoc/parsers/parse_rb.rb 2008-06-04 18:37:38.000000000 +0900 ++++ trunk/lib/rdoc/parsers/parse_rb.rb 2008-06-21 22:53:34.000000000 +0900 +@@ -1536,10 +1536,15 @@ + + tk = get_tk + while tk.kind_of?(TkCOMMENT) +- if first_line && tk.text[0,2] == "#!" ++ if first_line && /\A#!/ =~ tk.text ++ skip_tkspace ++ tk = get_tk ++ elsif first_line && /\A#\s*-\*-/ =~ tk.text ++ first_line = false + skip_tkspace + tk = get_tk + else ++ first_line = false + res << tk.text << "\n" + tk = get_tk + if tk.kind_of? TkNL +@@ -1547,7 +1552,6 @@ + tk = get_tk + end + end +- first_line = false + end + unget_tk(tk) + res --- ruby1.9-1.9.0.5.orig/debian/patches/904_linux_target_os.dpatch +++ ruby1.9-1.9.0.5/debian/patches/904_linux_target_os.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 904_linux_target_os.dpatch.dpatch by Matthias Klose +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Robustify check for target_os + +@DPATCH@ +--- ./configure.in~ 2007-09-04 17:20:41.000000000 +0200 ++++ ./configure.in 2007-09-04 17:34:11.000000000 +0200 +@@ -90,7 +90,7 @@ + fi + + AC_CANONICAL_TARGET +-target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'` ++target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnulp$/linux/;s/linux-gnu/linux-/'` + ac_install_sh='' # unusable for extension libraries. + + dnl checks for fat-binary --- ruby1.9-1.9.0.5.orig/debian/patches/307_r19033_rexml_DoS.dpatch +++ ruby1.9-1.9.0.5/debian/patches/307_r19033_rexml_DoS.dpatch @@ -0,0 +1,159 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 307_r19033_rexml_DoS.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixed DoS vulnerability in REXML. r19033. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 11:06:30.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 11:06:55.000000000 +0900 +@@ -1,3 +1,11 @@ ++Mon Sep 1 22:37:06 2008 Shugo Maeda ++ ++ * lib/rexml/document.rb: limit entity expansion. ++ ++ * lib/rexml/entity.rb: ditto. ++ ++ * test/rexml/test_document.rb: ditto. ++ + Mon Aug 11 20:27:12 2008 Yukihiro Matsumoto + + * ext/dl/cfunc.c (rb_dlcfunc_call): add taint check. +diff -urNad ruby1.9~/lib/rexml/document.rb ruby1.9/lib/rexml/document.rb +--- ruby1.9~/lib/rexml/document.rb 2008-06-05 20:22:32.000000000 +0900 ++++ ruby1.9/lib/rexml/document.rb 2008-09-03 11:06:31.000000000 +0900 +@@ -32,6 +32,7 @@ + # @param context if supplied, contains the context of the document; + # this should be a Hash. + def initialize( source = nil, context = {} ) ++ @entity_expansion_count = 0 + super() + @context = context + return if source.nil? +@@ -200,6 +201,27 @@ + Parsers::StreamParser.new( source, listener ).parse + end + ++ @@entity_expansion_limit = 10_000 ++ ++ # Set the entity expansion limit. By defualt the limit is set to 10000. ++ def Document::entity_expansion_limit=( val ) ++ @@entity_expansion_limit = val ++ end ++ ++ # Get the entity expansion limit. By defualt the limit is set to 10000. ++ def Document::entity_expansion_limit ++ return @@entity_expansion_limit ++ end ++ ++ attr_reader :entity_expansion_count ++ ++ def record_entity_expansion ++ @entity_expansion_count += 1 ++ if @entity_expansion_count > @@entity_expansion_limit ++ raise "number of entity expansions exceeded, processing aborted." ++ end ++ end ++ + private + def build( source ) + Parsers::TreeParser.new( source, self ).parse +diff -urNad ruby1.9~/lib/rexml/entity.rb ruby1.9/lib/rexml/entity.rb +--- ruby1.9~/lib/rexml/entity.rb 2008-01-01 14:43:50.000000000 +0900 ++++ ruby1.9/lib/rexml/entity.rb 2008-09-03 11:06:31.000000000 +0900 +@@ -73,6 +73,7 @@ + # all entities -- both %ent; and &ent; entities. This differs from + # +value()+ in that +value+ only replaces %ent; entities. + def unnormalized ++ document.record_entity_expansion unless document.nil? + v = value() + return nil if v.nil? + @unnormalized = Text::unnormalize(v, parent) +diff -urNad ruby1.9~/test/rexml/test_document.rb ruby1.9/test/rexml/test_document.rb +--- ruby1.9~/test/rexml/test_document.rb 1970-01-01 09:00:00.000000000 +0900 ++++ ruby1.9/test/rexml/test_document.rb 2008-09-03 11:06:31.000000000 +0900 +@@ -0,0 +1,83 @@ ++require "rexml/document" ++require "test/unit" ++ ++class REXML::TestDocument < Test::Unit::TestCase ++ def test_new ++ doc = REXML::Document.new(< ++Hello world! ++EOF ++ assert_equal("Hello world!", doc.root.children.first.value) ++ end ++ ++ def test_entity_expansion_limit ++ xml = < ++ ++ ++ ++ ++ ++ ++ ++]> ++ ++&a; ++ ++EOF ++ doc = REXML::Document.new(xml) ++ assert_raise(RuntimeError) do ++ doc.root.children.first.value ++ end ++ REXML::Document.entity_expansion_limit = 100 ++ assert_equal(100, REXML::Document.entity_expansion_limit) ++ doc = REXML::Document.new(xml) ++ assert_raise(RuntimeError) do ++ doc.root.children.first.value ++ end ++ assert_equal(101, doc.entity_expansion_count) ++ end ++end ++require "rexml/document" ++require "test/unit" ++ ++class REXML::TestDocument < Test::Unit::TestCase ++ def test_new ++ doc = REXML::Document.new(< ++Hello world! ++EOF ++ assert_equal("Hello world!", doc.root.children.first.value) ++ end ++ ++ XML_WITH_NESTED_ENTITY = < ++ ++ ++ ++ ++ ++ ++ ++]> ++ ++&a; ++ ++EOF ++ ++ def test_entity_expansion_limit ++ doc = REXML::Document.new(XML_WITH_NESTED_ENTITY) ++ assert_raise(RuntimeError) do ++ doc.root.children.first.value ++ end ++ REXML::Document.entity_expansion_limit = 100 ++ assert_equal(100, REXML::Document.entity_expansion_limit) ++ doc = REXML::Document.new(XML_WITH_NESTED_ENTITY) ++ assert_raise(RuntimeError) do ++ doc.root.children.first.value ++ end ++ assert_equal(101, doc.entity_expansion_count) ++ end ++end --- ruby1.9-1.9.0.5.orig/debian/patches/930_zero_tainted.dpatch +++ ruby1.9-1.9.0.5/debian/patches/930_zero_tainted.dpatch @@ -0,0 +1,46 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 930_zero_tainted.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Backport of upstream rev 17612 to fix tests problems with $0 +## DP: being tainted. Closes bug #501408 + +@DPATCH@ +diff --git a/lib/test/unit/ui/console/testrunner.rb b/lib/test/unit/ui/console/testrunner.rb +index 2bd01ee..1495300 100644 +--- a/lib/test/unit/ui/console/testrunner.rb ++++ b/lib/test/unit/ui/console/testrunner.rb +@@ -90,8 +90,11 @@ module Test + end + + def test_started(name) +- $0 += "\0#{name}" +- $0.sub!(/\0.*\z/, '') ++ unless defined? $program_name ++ $program_name = $0 ++ alias $0 $program_name ++ end ++ $PROGRAM_NAME += "\0#{name}" + output_single(name + ": ", VERBOSE) + end + +diff --git a/test/inlinetest.rb b/test/inlinetest.rb +index 6dbd793..4628736 100644 +--- a/test/inlinetest.rb ++++ b/test/inlinetest.rb +@@ -33,12 +33,12 @@ module InlineTest + end + + def self.in_progname(progname) +- progname_backup = $0.dup +- $0.replace(progname) ++ $program_name = progname ++ alias $0 $program_name + begin + yield + ensure +- $0.replace(progname_backup) ++ alias $0 $PROGRAM_NAME + end + end + --- ruby1.9-1.9.0.5.orig/debian/patches/304_r17577_trace_var_safeleve4.dpatch +++ ruby1.9-1.9.0.5/debian/patches/304_r17577_trace_var_safeleve4.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 304_r17577_trace_var_safeleve4.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: rb_f_trace_var should not be allowed at safe level 4. r17577. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 10:23:28.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 10:23:55.000000000 +0900 +@@ -6,6 +6,11 @@ + * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is + "". + ++Thu Jun 26 17:43:41 2008 Yukihiro Matsumoto ++ ++ * variable.c (rb_f_trace_var): should not be allowed at safe level 4. ++ a patch from Keita Yamaguchi . ++ + Fri Jul 25 23:35:18 2008 Nobuyoshi Nakada + + * lib/webrick/httputils.rb (WEBrick::HTTPUtils#split_header_value): +diff -urNad ruby1.9~/variable.c ruby1.9/variable.c +--- ruby1.9~/variable.c 2008-06-09 18:25:32.000000000 +0900 ++++ ruby1.9/variable.c 2008-09-03 10:23:29.000000000 +0900 +@@ -594,6 +594,7 @@ + struct trace_var *trace; + st_data_t data; + ++ rb_secure(4); + rb_scan_args(argc, argv, "11", &var, &cmd); + id = rb_to_id(var); + if (!st_lookup(rb_global_tbl, id, &data)) { --- ruby1.9-1.9.0.5.orig/debian/patches/902_define_YAML_in_yaml_stringio.rb.dpatch +++ ruby1.9-1.9.0.5/debian/patches/902_define_YAML_in_yaml_stringio.rb.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 902_define_YAML_in_yaml_stringio.rb.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: YAML module is needed. (It is a workaround for generating RDoc.) + +@DPATCH@ +diff -urNad ruby1.9-1.9.0+20070830~/lib/yaml/stringio.rb ruby1.9-1.9.0+20070830/lib/yaml/stringio.rb +--- ruby1.9-1.9.0+20070830~/lib/yaml/stringio.rb 2007-02-13 08:01:19.000000000 +0900 ++++ ruby1.9-1.9.0+20070830/lib/yaml/stringio.rb 2007-08-30 12:25:33.000000000 +0900 +@@ -49,6 +49,7 @@ + end + end + ++ module YAML + # + # Class method for creating streams + # +@@ -78,6 +79,6 @@ + end + io + end +- ++ end + end + --- ruby1.9-1.9.0.5.orig/debian/patches/308_regexp_segv.dpatch +++ ruby1.9-1.9.0.5/debian/patches/308_regexp_segv.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 308_regexp_segv.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.2~/re.c ruby1.9-1.9.0.2/re.c +--- ruby1.9-1.9.0.2~/re.c 2008-06-08 19:01:40.000000000 +0900 ++++ ruby1.9-1.9.0.2/re.c 2008-12-02 11:35:48.000000000 +0900 +@@ -381,8 +381,12 @@ + rb_reg_desc(const char *s, long len, VALUE re) + { + VALUE str = rb_str_buf_new2("/"); +- +- rb_enc_copy(str, re); ++ if (re && rb_enc_asciicompat(rb_enc_get(re))) { ++ rb_enc_copy(str, re); ++ } ++ else { ++ rb_enc_associate(str, rb_usascii_encoding()); ++ } + rb_reg_expr_str(str, s, len); + rb_str_buf_cat2(str, "/"); + if (re) { +diff -urNad ruby1.9-1.9.0.2~/regerror.c ruby1.9-1.9.0.2/regerror.c +--- ruby1.9-1.9.0.2~/regerror.c 2008-05-31 18:28:20.000000000 +0900 ++++ ruby1.9-1.9.0.2/regerror.c 2008-12-02 11:24:15.000000000 +0900 +@@ -51,7 +51,7 @@ + case ONIG_NO_SUPPORT_CONFIG: + p = "no support in this configuration"; break; + case ONIGERR_MEMORY: +- p = "fail to memory allocation"; break; ++ p = "failed to allocate memory"; break; + case ONIGERR_MATCH_STACK_LIMIT_OVER: + p = "match-stack limit over"; break; + case ONIGERR_TYPE_BUG: --- ruby1.9-1.9.0.5.orig/debian/patches/00list +++ ruby1.9-1.9.0.5/debian/patches/00list @@ -0,0 +1,11 @@ +201_gem_prelude.dpatch +900_ri_pager +901_extra_search_path +902_define_YAML_in_yaml_stringio.rb +903_skip_base_ruby_check +904_linux_target_os.dpatch +909_update_lib_README +919_common.mk_tweaks.dpatch +920_rexml_document_transitive +931_CVE-2009-0642 +090803_exclude_rdoc --- ruby1.9-1.9.0.5.orig/debian/patches/909_update_lib_README.dpatch +++ ruby1.9-1.9.0.5/debian/patches/909_update_lib_README.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 809_update_lib_README.dpatch by Lucas Nussbaum +## +## Fixes bug #414727 +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad trunk~/lib/README trunk/lib/README +--- trunk~/lib/README 2007-12-24 15:09:57.000000000 +0100 ++++ trunk/lib/README 2008-02-01 17:56:14.000000000 +0100 +@@ -23,7 +23,6 @@ + logger.rb simple logging utility + mathn.rb extended math operation + matrix.rb matrix calculation library +-mkmf.rb Makefile maker + monitor.rb exclusive region monitor for thread + mutex_m.rb mutex mixin + net/ftp.rb ftp access --- ruby1.9-1.9.0.5.orig/debian/patches/303_r17726_syslog_safeleve4.dpatch +++ ruby1.9-1.9.0.5/debian/patches/303_r17726_syslog_safeleve4.dpatch @@ -0,0 +1,54 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 303_r17726_syslog_safeleve4.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Syslog operations should be protected from $SAFE level 4. r17726. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 10:22:23.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 10:23:02.000000000 +0900 +@@ -12,6 +12,16 @@ + reduce backtrack. based on a fix by Christian Neukirchen + . + ++Mon Jun 30 10:28:33 2008 Yukihiro Matsumoto ++ ++ * ext/syslog/syslog.c (syslog_write): syslog operations should be ++ protected from $SAFE level 4. a patch from Keita Yamaguchi ++ . ++ ++ * ext/syslog/syslog.c (mSyslog_close): ditto. ++ ++ * ext/syslog/syslog.c (mSyslog_set_mask): ditto. ++ + Fri Jun 20 15:40:02 2008 Nobuyoshi Nakada + + * array.c (rb_ary_store, rb_ary_splice): not depend on unspecified +diff -urNad ruby1.9~/ext/syslog/syslog.c ruby1.9/ext/syslog/syslog.c +--- ruby1.9~/ext/syslog/syslog.c 2007-06-10 12:06:15.000000000 +0900 ++++ ruby1.9/ext/syslog/syslog.c 2008-09-03 10:22:24.000000000 +0900 +@@ -22,6 +22,7 @@ + { + VALUE str; + ++ rb_secure(4); + if (argc < 1) { + rb_raise(rb_eArgError, "no log message supplied"); + } +@@ -38,6 +39,7 @@ + /* Syslog module methods */ + static VALUE mSyslog_close(VALUE self) + { ++ rb_secure(4); + if (!syslog_opened) { + rb_raise(rb_eRuntimeError, "syslog not opened"); + } +@@ -132,6 +134,7 @@ + + static VALUE mSyslog_set_mask(VALUE self, VALUE mask) + { ++ rb_secure(4); + if (!syslog_opened) { + rb_raise(rb_eRuntimeError, "must open syslog before setting log mask"); + } --- ruby1.9-1.9.0.5.orig/debian/patches/302_r18220_webrick_DoS.dpatch +++ ruby1.9-1.9.0.5/debian/patches/302_r18220_webrick_DoS.dpatch @@ -0,0 +1,56 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 302_r18220_webrick_DoS.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixed DoS vulnerability in WEBrick. r18220. + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-09-03 10:21:07.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 10:21:52.000000000 +0900 +@@ -6,6 +6,12 @@ + * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is + "". + ++Fri Jul 25 23:35:18 2008 Nobuyoshi Nakada ++ ++ * lib/webrick/httputils.rb (WEBrick::HTTPUtils#split_header_value): ++ reduce backtrack. based on a fix by Christian Neukirchen ++ . ++ + Fri Jun 20 15:40:02 2008 Nobuyoshi Nakada + + * array.c (rb_ary_store, rb_ary_splice): not depend on unspecified +diff -urNad ruby1.9~/lib/webrick/httputils.rb ruby1.9/lib/webrick/httputils.rb +--- ruby1.9~/lib/webrick/httputils.rb 2007-02-13 08:01:19.000000000 +0900 ++++ ruby1.9/lib/webrick/httputils.rb 2008-09-03 10:21:07.000000000 +0900 +@@ -23,16 +23,8 @@ + ret = path.dup + + ret.gsub!(%r{/+}o, '/') # // => / +- while ret.sub!(%r{/\.(/|\Z)}o, '/'); end # /. => / +- begin # /foo/.. => /foo +- match = ret.sub!(%r{/([^/]+)/\.\.(/|\Z)}o){ +- if $1 == ".." +- raise "abnormal path `#{path}'" +- else +- "/" +- end +- } +- end while match ++ while ret.sub!(%r'/\.(?:/|\Z)', '/'); end # /. => / ++ while ret.sub!(%r'/(?!\.\./)[^/]+/\.\.(?:/|\Z)', '/'); end # /foo/.. => /foo + + raise "abnormal path `#{path}'" if %r{/\.\.(/|\Z)} =~ ret + ret +@@ -155,8 +147,8 @@ + module_function :parse_header + + def split_header_value(str) +- str.scan(/((?:"(?:\\.|[^"])+?"|[^",]+)+) +- (?:,\s*|\Z)/xn).collect{|v| v[0] } ++ str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+) ++ (?:,\s*|\Z)'xn).flatten + end + module_function :split_header_value + --- ruby1.9-1.9.0.5.orig/debian/patches/920_rexml_document_transitive.dpatch +++ ruby1.9-1.9.0.5/debian/patches/920_rexml_document_transitive.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 920_rexml_document_transitive.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: REXML::Document#write(io, 1, true, true) raises NameError/ArgumentError + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.2~/lib/rexml/document.rb ruby1.9-1.9.0.2/lib/rexml/document.rb +--- ruby1.9-1.9.0.2~/lib/rexml/document.rb 2008-06-05 20:22:32.000000000 +0900 ++++ ruby1.9-1.9.0.2/lib/rexml/document.rb 2008-09-09 22:14:43.000000000 +0900 +@@ -185,6 +185,7 @@ + end + formatter = if indent > -1 + if transitive ++ require "rexml/formatters/transitive" + REXML::Formatters::Transitive.new( indent, ie_hack ) + else + REXML::Formatters::Pretty.new( indent, ie_hack ) +diff -urNad ruby1.9-1.9.0.2~/lib/rexml/element.rb ruby1.9-1.9.0.2/lib/rexml/element.rb +--- ruby1.9-1.9.0.2~/lib/rexml/element.rb 2008-06-04 18:37:38.000000000 +0900 ++++ ruby1.9-1.9.0.2/lib/rexml/element.rb 2008-09-09 22:14:43.000000000 +0900 +@@ -691,6 +691,7 @@ + Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters") + formatter = if indent > -1 + if transitive ++ require "rexml/formatters/transitive" + REXML::Formatters::Transitive.new( indent, ie_hack ) + else + REXML::Formatters::Pretty.new( indent, ie_hack ) +diff -urNad ruby1.9-1.9.0.2~/lib/rexml/formatters/transitive.rb ruby1.9-1.9.0.2/lib/rexml/formatters/transitive.rb +--- ruby1.9-1.9.0.2~/lib/rexml/formatters/transitive.rb 2007-07-26 06:18:55.000000000 +0900 ++++ ruby1.9-1.9.0.2/lib/rexml/formatters/transitive.rb 2008-09-09 22:14:43.000000000 +0900 +@@ -12,9 +12,10 @@ + # formatted. Since this formatter does not alter whitespace nodes, the + # results of formatting already formatted XML will be odd. + class Transitive < Default +- def initialize( indentation=2 ) ++ def initialize( indentation=2, ie_hack=false ) + @indentation = indentation + @level = 0 ++ @ie_hack = ie_hack + end + + protected +@@ -29,6 +30,7 @@ + output << "\n" + output << ' '*@level + if node.children.empty? ++ output << " " if @ie_hack + output << "/" + else + output << ">" --- ruby1.9-1.9.0.5.orig/debian/patches/903_skip_base_ruby_check.dpatch +++ ruby1.9-1.9.0.5/debian/patches/903_skip_base_ruby_check.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 903_skip_base_ruby_check.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: skip host ruby check. (this packages uses pre-generated files.) + +@DPATCH@ +--- ruby1.9-1.9.0.0/configure.in 2007-12-26 10:20:54.000000000 +0900 ++++ ruby1.9-1.9.0.0/configure.in 2007-12-26 10:22:19.000000000 +0900 +@@ -18,8 +18,6 @@ + [ + BASERUBY="ruby" + ]) +-test "`$BASERUBY -e 'p 42' 2>/dev/null`" = 42 || +- BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false" + AC_SUBST(BASERUBY) + + AC_DEFUN([RUBY_MINGW32], --- ruby1.9-1.9.0.5.orig/debian/patches/919_common.mk_tweaks.dpatch +++ ruby1.9-1.9.0.5/debian/patches/919_common.mk_tweaks.dpatch @@ -0,0 +1,57 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 919_common.mk_tweaks.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Adds more verbosity to the build process. Build parse.o with -Q to +## DP: avoid timeouts on mips(el). Run the testsuite with -v, to see which +## DP: tests are blocking. +## DP: Also run a "watcher", which outputs the result of ps on a regular +## DP: basis. This avoids a timeout on slow arches. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.5~/common.mk ruby1.9-1.9.0.5/common.mk +--- ruby1.9-1.9.0.5~/common.mk 2008-10-01 12:21:02.000000000 +0200 ++++ ruby1.9-1.9.0.5/common.mk 2009-07-30 00:49:16.000000000 +0200 +@@ -372,7 +372,7 @@ + test: test-sample btest-ruby test-knownbug + + test-all: +- $(RUNRUBY) "$(srcdir)/test/runner.rb" $(TESTS) ++ $(RUNRUBY) "$(srcdir)/test/runner.rb" -v $(TESTS) + + extconf: $(PREP) + $(MAKEDIRS) "$(EXTCONFDIR)" +@@ -399,6 +399,33 @@ + {$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed + parse.h {$(VPATH)}parse.h: {$(VPATH)}parse.c + ++clean-local:: ++ rm -f start-watch.stamp ++ ++# wait at least 10 secs for gcc to start. ++# then wait for gcc to finish ++# touch -d "1 hour ago" to allow re-running builds without rebuilding parse.o ++start-watcher.stamp: ++ ( n=0 ;\ ++ while [ $$n -lt 10 ]; do \ ++ [ $$(ps aux | grep gcc | grep parse.o | grep -v grep | wc -l) -gt 0 ] && echo "# gcc parse.o started!" && break ;\ ++ n=$$(expr $$n + 1) ;\ ++ sleep 1 ;\ ++ done ;\ ++ [ $$n -eq 60 ] && echo "# gcc never started, exiting." && exit 1 ;\ ++ str="starting..." ;\ ++ while [ "$$str" != "" ]; do \ ++ echo "# running... $$str" ;\ ++ sleep 5 ;\ ++ str=$$(ps aux | grep gcc | grep parse.o | grep -v grep) ;\ ++ done ;\ ++ echo "# watched finished." ; \ ++ touch -d "1 hour ago" start-watcher.stamp ) & ++ ++parse.o: start-watcher.stamp ++ ++parse.o: CFLAGS += -Q ++ + {$(srcdir)}.y.c: + $(YACC) -d $(YFLAGS) -o y.tab.c $(<:\\=/) + sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new --- ruby1.9-1.9.0.5.orig/debian/patches/940_test_priority_fails.dpatch +++ ruby1.9-1.9.0.5/debian/patches/940_test_priority_fails.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 940_test_priority_fails.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: test_priority (in test_thread.rb) fails. +## DP: See http://redmine.ruby-lang.org/issues/show/1169 + +@DPATCH@ +diff -urNad ruby1.9-1.9.1.0~/test/ruby/test_thread.rb ruby1.9-1.9.1.0/test/ruby/test_thread.rb +--- ruby1.9-1.9.1.0~/test/ruby/test_thread.rb 2008-12-29 08:19:32.000000000 +0100 ++++ ruby1.9-1.9.1.0/test/ruby/test_thread.rb 2009-02-18 10:38:59.000000000 +0100 +@@ -115,7 +115,7 @@ + } + end + +- def test_priority ++ def est_priority + c1 = c2 = 0 + t1 = Thread.new { loop { c1 += 1 } } + t1.priority = -1 --- ruby1.9-1.9.0.5.orig/debian/patches/103_array_c_r17570_to_r17756.dpatch +++ ruby1.9-1.9.0.5/debian/patches/103_array_c_r17570_to_r17756.dpatch @@ -0,0 +1,24 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 103_array_c_r17570_to_r17756.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: applied r17570 and r17756 to fix an issue of integer overflow that +## DP: might cause DoS. + +@DPATCH@ +diff -urNad ruby1.9~/array.c ruby1.9/array.c +--- ruby1.9~/array.c 2008-06-20 15:42:07.000000000 +0900 ++++ ruby1.9/array.c 2008-07-09 00:02:42.000000000 +0900 +@@ -2145,10 +2145,10 @@ + break; + } + rb_ary_modify(ary); +- end = beg + len; +- if (end < 0) { ++ if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) { + rb_raise(rb_eArgError, "argument too big"); + } ++ end = beg + len; + if (RARRAY_LEN(ary) < end) { + if (end >= ARY_CAPA(ary)) { + RESIZE_CAPA(ary, end); --- ruby1.9-1.9.0.5.orig/debian/patches/090729_fix_Makefile_deps.dpatch +++ ruby1.9-1.9.0.5/debian/patches/090729_fix_Makefile_deps.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 090729_fix_Makefile_deps.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: In some cases, during 'make install', ruby1.9 will be removed +## DP: because make will detect that one of the INSNS targets need to +## DP: be regenerated. +## DP: We add a dependency between do-install-nodoc and $(PROGRAM) to +## DP: rebuild ruby1.9 if it was removed. + +@DPATCH@ +--- common.mk.orig 2009-08-18 09:58:10.000000000 +0200 ++++ common.mk 2009-08-18 09:58:34.000000000 +0200 +@@ -157,7 +157,7 @@ + + install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc + pre-install-nodoc:: pre-install-local pre-install-ext +-do-install-nodoc: $(PREP) ++do-install-nodoc: $(PREP) $(PROGRAM) + $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)" + post-install-nodoc:: post-install-local post-install-ext + --- ruby1.9-1.9.0.5.orig/debian/patches/102_skip_test_copy_stream.dpatch +++ ruby1.9-1.9.0.5/debian/patches/102_skip_test_copy_stream.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 102_skip_test_copy_stream.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: test_copy_stream may hang. Skip it. + +@DPATCH@ +diff -urNad ruby1.9-1.9.0.2~/test/ruby/test_io.rb ruby1.9-1.9.0.2/test/ruby/test_io.rb +--- ruby1.9-1.9.0.2~/test/ruby/test_io.rb 2008-06-18 11:45:41.000000000 +0200 ++++ ruby1.9-1.9.0.2/test/ruby/test_io.rb 2008-07-12 16:09:52.000000000 +0200 +@@ -98,7 +98,7 @@ + } + end + +- def test_copy_stream ++ def est_copy_stream + mkcdtmpdir {|d| + + content = "foobar" +@@ -336,7 +336,7 @@ + end + end + +- def test_copy_stream_socket ++ def est_copy_stream_socket + return unless defined? UNIXSocket + mkcdtmpdir {|d| + --- ruby1.9-1.9.0.5.orig/debian/patches/090803_exclude_rdoc.dpatch +++ ruby1.9-1.9.0.5/debian/patches/090803_exclude_rdoc.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 090803_exclude_rdoc.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad trunk~/common.mk trunk/common.mk +--- trunk~/common.mk 2009-08-03 15:48:07.000000000 +0900 ++++ trunk/common.mk 2009-08-03 15:49:08.000000000 +0900 +@@ -318,9 +318,9 @@ + post-install-doc:: + @$(NULLCMD) + +-rdoc: $(PROGRAM) PHONY ++rdoc: $(PROGRAM) PHONY + @echo Generating RDoc documentation +- $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" "$(srcdir)" ++ $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" --exclude mkconfig.rb --exclude test_ --exclude bm_ --exclude "tool/make-snapshot" "$(srcdir)" + + what-where-doc: no-install-doc + no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc --- ruby1.9-1.9.0.5.orig/debian/patches/301_dns_spoofing_r18424.dpatch +++ ruby1.9-1.9.0.5/debian/patches/301_dns_spoofing_r18424.dpatch @@ -0,0 +1,449 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 301_dns_spoofing_r18424.dpatch by Daigo Moriwaki +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: DNS spoofing vulnerability in resolv.rb (CVE-2008-1447). r18424 + +@DPATCH@ +diff -urNad ruby1.9~/ChangeLog ruby1.9/ChangeLog +--- ruby1.9~/ChangeLog 2008-06-20 15:40:10.000000000 +0900 ++++ ruby1.9/ChangeLog 2008-09-03 09:24:52.000000000 +0900 +@@ -1,3 +1,11 @@ ++Fri Aug 8 10:53:52 2008 Tanaka Akira ++ ++ * lib/resolv.rb: randomize source port and transaction id. ++ CVE-2008-1447. ++ ++ * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is ++ "". ++ + Fri Jun 20 15:40:02 2008 Nobuyoshi Nakada + + * array.c (rb_ary_store, rb_ary_splice): not depend on unspecified +diff -urNad ruby1.9~/lib/resolv-replace.rb ruby1.9/lib/resolv-replace.rb +--- ruby1.9~/lib/resolv-replace.rb 2007-02-13 08:01:19.000000000 +0900 ++++ ruby1.9/lib/resolv-replace.rb 2008-09-03 09:22:59.000000000 +0900 +@@ -23,7 +23,8 @@ + class UDPSocket + alias original_resolv_bind bind + def bind(host, port) +- original_resolv_bind(IPSocket.getaddress(host), port) ++ host = IPSocket.getaddress(host) if host != "" ++ original_resolv_bind(host, port) + end + + alias original_resolv_connect connect +diff -urNad ruby1.9~/lib/resolv.rb ruby1.9/lib/resolv.rb +--- ruby1.9~/lib/resolv.rb 2008-06-04 18:37:38.000000000 +0900 ++++ ruby1.9/lib/resolv.rb 2008-09-03 09:22:59.000000000 +0900 +@@ -3,6 +3,11 @@ + require 'timeout' + require 'thread' + ++begin ++ require 'securerandom' ++rescue LoadError ++end ++ + # Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can + # handle multiple DNS requests concurrently without blocking. The ruby + # interpreter. +@@ -285,11 +290,6 @@ + UDPSize = 512 + + ## +- # Group of DNS resolver threads +- +- DNSThreadGroup = ThreadGroup.new +- +- ## + # Creates a new DNS resolver. See Resolv::DNS.new for argument details. + # + # Yields the created DNS resolver to the block, if given, otherwise +@@ -330,13 +330,6 @@ + @mutex.synchronize { + unless @initialized + @config.lazy_initialize +- +- if nameserver = @config.single? +- @requester = Requester::ConnectedUDP.new(nameserver) +- else +- @requester = Requester::UnconnectedUDP.new +- end +- + @initialized = true + end + } +@@ -349,8 +342,6 @@ + def close + @mutex.synchronize { + if @initialized +- @requester.close if @requester +- @requester = nil + @initialized = false + end + } +@@ -479,7 +470,7 @@ + + def each_resource(name, typeclass, &proc) + lazy_initialize +- q = Queue.new ++ requester = make_requester + senders = {} + begin + @config.resolv(name) {|candidate, tout, nameserver| +@@ -488,11 +479,9 @@ + msg.add_question(candidate, typeclass) + unless sender = senders[[candidate, nameserver]] + sender = senders[[candidate, nameserver]] = +- @requester.sender(msg, candidate, q, nameserver) ++ requester.sender(msg, candidate, nameserver) + end +- sender.send +- reply = reply_name = nil +- timeout(tout, ResolvTimeout) { reply, reply_name = q.pop } ++ reply, reply_name = requester.request(sender, tout) + case reply.rcode + when RCode::NoError + extract_resources(reply, reply_name, typeclass, &proc) +@@ -504,7 +493,15 @@ + end + } + ensure +- @requester.delete(q) ++ requester.close ++ end ++ end ++ ++ def make_requester # :nodoc: ++ if nameserver = @config.single? ++ Requester::ConnectedUDP.new(nameserver) ++ else ++ Requester::UnconnectedUDP.new + end + end + +@@ -539,45 +536,106 @@ + } + end + ++ if defined? SecureRandom ++ def self.random(arg) # :nodoc: ++ begin ++ SecureRandom.random_number(arg) ++ rescue NotImplementedError ++ rand(arg) ++ end ++ end ++ else ++ def self.random(arg) # :nodoc: ++ rand(arg) ++ end ++ end ++ ++ ++ def self.rangerand(range) # :nodoc: ++ base = range.begin ++ len = range.end - range.begin ++ if !range.exclude_end? ++ len += 1 ++ end ++ base + random(len) ++ end ++ ++ RequestID = {} ++ RequestIDMutex = Mutex.new ++ ++ def self.allocate_request_id(host, port) # :nodoc: ++ id = nil ++ RequestIDMutex.synchronize { ++ h = (RequestID[[host, port]] ||= {}) ++ begin ++ id = rangerand(0x0000..0xffff) ++ end while h[id] ++ h[id] = true ++ } ++ id ++ end ++ ++ def self.free_request_id(host, port, id) # :nodoc: ++ RequestIDMutex.synchronize { ++ key = [host, port] ++ if h = RequestID[key] ++ h.delete id ++ if h.empty? ++ RequestID.delete key ++ end ++ end ++ } ++ end ++ ++ def self.bind_random_port(udpsock) # :nodoc: ++ begin ++ port = rangerand(1024..65535) ++ udpsock.bind("", port) ++ rescue Errno::EADDRINUSE ++ retry ++ end ++ end ++ + class Requester # :nodoc: + def initialize + @senders = {} ++ @sock = nil + end + +- def close +- thread, sock, @thread, @sock = @thread, @sock +- begin +- if thread +- thread.kill +- thread.join ++ def request(sender, tout) ++ timelimit = Time.now + tout ++ sender.send ++ while (now = Time.now) < timelimit ++ timeout = timelimit - now ++ if !IO.select([@sock], nil, nil, timeout) ++ raise ResolvTimeout ++ end ++ reply, from = recv_reply ++ begin ++ msg = Message.decode(reply) ++ rescue DecodeError ++ next # broken DNS message ignored ++ end ++ if s = @senders[[from,msg.id]] ++ break ++ else ++ # unexpected DNS message ignored + end +- ensure +- sock.close if sock + end ++ return msg, s.data + end + +- def delete(arg) +- case arg +- when Sender +- @senders.delete_if {|k, s| s == arg } +- when Queue +- @senders.delete_if {|k, s| s.queue == arg } +- else +- raise ArgumentError.new("neither Sender or Queue: #{arg}") +- end ++ def close ++ sock = @sock ++ @sock = nil ++ sock.close if sock + end + + class Sender # :nodoc: +- def initialize(msg, data, sock, queue) ++ def initialize(msg, data, sock) + @msg = msg + @data = data + @sock = sock +- @queue = queue +- end +- attr_reader :queue +- +- def recv(msg) +- @queue.push([msg, @data]) + end + end + +@@ -585,45 +643,38 @@ + def initialize + super() + @sock = UDPSocket.new +- @sock.fcntl(Fcntl::F_SETFD, 1) if defined? Fcntl::F_SETFD +- @id = {} +- @id.default = -1 +- @thread = Thread.new { +- DNSThreadGroup.add Thread.current +- loop { +- reply, from = @sock.recvfrom(UDPSize) +- msg = begin +- Message.decode(reply) +- rescue DecodeError +- STDERR.print("DNS message decoding error: #{reply.inspect}\n") +- next +- end +- if s = @senders[[[from[3],from[1]],msg.id]] +- s.recv msg +- else +- #STDERR.print("non-handled DNS message: #{msg.inspect} from #{from.inspect}\n") +- end +- } +- } ++ @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD ++ DNS.bind_random_port(@sock) + end + +- def sender(msg, data, queue, host, port=Port) ++ def recv_reply ++ reply, from = @sock.recvfrom(UDPSize) ++ return reply, [from[3],from[1]] ++ end ++ ++ def sender(msg, data, host, port=Port) + service = [host, port] +- id = Thread.exclusive { +- @id[service] = (@id[service] + 1) & 0xffff +- } ++ id = DNS.allocate_request_id(host, port) + request = msg.encode + request[0,2] = [id].pack('n') + return @senders[[service, id]] = +- Sender.new(request, data, @sock, host, port, queue) ++ Sender.new(request, data, @sock, host, port) ++ end ++ ++ def close ++ super ++ @senders.each_key {|service, id| ++ DNS.free_request_id(service[0], service[1], id) ++ } + end + + class Sender < Requester::Sender # :nodoc: +- def initialize(msg, data, sock, host, port, queue) +- super(msg, data, sock, queue) ++ def initialize(msg, data, sock, host, port) ++ super(msg, data, sock) + @host = host + @port = port + end ++ attr_reader :data + + def send + @sock.send(@msg, 0, @host, @port) +@@ -637,42 +688,38 @@ + @host = host + @port = port + @sock = UDPSocket.new(host.index(':') ? Socket::AF_INET6 : Socket::AF_INET) ++ DNS.bind_random_port(@sock) + @sock.connect(host, port) +- @sock.fcntl(Fcntl::F_SETFD, 1) if defined? Fcntl::F_SETFD +- @id = -1 +- @thread = Thread.new { +- DNSThreadGroup.add Thread.current +- loop { +- reply = @sock.recv(UDPSize) +- msg = begin +- Message.decode(reply) +- rescue DecodeError +- STDERR.print("DNS message decoding error: #{reply.inspect}") +- next +- end +- if s = @senders[msg.id] +- s.recv msg +- else +- #STDERR.print("non-handled DNS message: #{msg.inspect}") +- end +- } +- } ++ @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD + end + +- def sender(msg, data, queue, host=@host, port=@port) ++ def recv_reply ++ reply = @sock.recv(UDPSize) ++ return reply, nil ++ end ++ ++ def sender(msg, data, host=@host, port=@port) + unless host == @host && port == @port + raise RequestError.new("host/port don't match: #{host}:#{port}") + end +- id = Thread.exclusive { @id = (@id + 1) & 0xffff } ++ id = DNS.allocate_request_id(@host, @port) + request = msg.encode + request[0,2] = [id].pack('n') +- return @senders[id] = Sender.new(request, data, @sock, queue) ++ return @senders[[nil,id]] = Sender.new(request, data, @sock) ++ end ++ ++ def close ++ super ++ @senders.each_key {|from, id| ++ DNS.free_request_id(@host, @port, id) ++ } + end + + class Sender < Requester::Sender # :nodoc: + def send + @sock.send(@msg, 0) + end ++ attr_reader :data + end + end + +@@ -681,39 +728,25 @@ + super() + @host = host + @port = port +- @sock = TCPSocket.new +- @sock.connect(host, port) +- @sock.fcntl(Fcntl::F_SETFD, 1) if defined? Fcntl::F_SETFD +- @id = -1 ++ @sock = TCPSocket.new(@host, @port) ++ @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD + @senders = {} +- @thread = Thread.new { +- DNSThreadGroup.add Thread.current +- loop { +- len = @sock.read(2).unpack('n') +- reply = @sock.read(len) +- msg = begin +- Message.decode(reply) +- rescue DecodeError +- STDERR.print("DNS message decoding error: #{reply.inspect}") +- next +- end +- if s = @senders[msg.id] +- s.push msg +- else +- #STDERR.print("non-handled DNS message: #{msg.inspect}") +- end +- } +- } + end + +- def sender(msg, data, queue, host=@host, port=@port) ++ def recv_reply ++ len = @sock.read(2).unpack('n')[0] ++ reply = @sock.read(len) ++ return reply, nil ++ end ++ ++ def sender(msg, data, host=@host, port=@port) + unless host == @host && port == @port + raise RequestError.new("host/port don't match: #{host}:#{port}") + end +- id = Thread.exclusive { @id = (@id + 1) & 0xffff } ++ id = DNS.allocate_request_id(@host, @port) + request = msg.encode + request[0,2] = [request.length, id].pack('nn') +- return @senders[id] = Sender.new(request, data, @sock, queue) ++ return @senders[[nil,id]] = Sender.new(request, data, @sock) + end + + class Sender < Requester::Sender # :nodoc: +@@ -721,6 +754,14 @@ + @sock.print(@msg) + @sock.flush + end ++ attr_reader :data ++ end ++ ++ def close ++ super ++ @senders.each_key {|from,id| ++ DNS.free_request_id(@host, @port, id) ++ } + end + end + --- ruby1.9-1.9.0.5.orig/debian/patches/901_extra_search_path.dpatch +++ ruby1.9-1.9.0.5/debian/patches/901_extra_search_path.dpatch @@ -0,0 +1,54 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 902_extra_search_path.dpatch by akira yamada +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: temporally added "/usr/local/lib/site_ruby/1.8/i386-linux" and "/usr/lib/ruby/1.8/i386-linux" as extra search paths to Ruby on ix86 arch. + + +@DPATCH@ +diff -urNad ruby1.9-1.9.0+20050623/configure.in /tmp/dpep.kRYSCG/ruby1.9-1.9.0+20050623/configure.in +--- ruby1.9-1.9.0+20050623/configure.in 2005-06-13 01:56:06.000000000 +0900 ++++ /tmp/dpep.kRYSCG/ruby1.9-1.9.0+20050623/configure.in 2005-06-29 23:46:50.000000000 +0900 +@@ -1649,6 +1649,19 @@ + AC_SUBST(rubyhdrdir)dnl + AC_SUBST(sitehdrdir)dnl + ++AC_ARG_WITH(extra-site-search-path, ++ [ --with-extra-site-search-path=DIR specify the extra site search path], ++ [extra_site_search_path=$withval]) ++if test "$extra_site_search_path" != ""; then ++ AC_DEFINE_UNQUOTED(RUBY_EXTRA_SITE_SEARCH_PATH,"$extra_site_search_path") ++fi ++AC_ARG_WITH(extra-search-path, ++ [ --with-extra-search-path=DIR specify the extra search path], ++ [extra_search_path=$withval]) ++if test "$extra_search_path" != ""; then ++ AC_DEFINE_UNQUOTED(RUBY_EXTRA_SEARCH_PATH,"$extra_search_path") ++fi ++ + AC_ARG_WITH(mantype, + [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc], + [ +diff -urNad ruby1.9-1.9.0+20050623/ruby.c /tmp/dpep.kRYSCG/ruby1.9-1.9.0+20050623/ruby.c +--- ruby1.9-1.9.0+20050623/ruby.c 2005-06-16 15:43:00.000000000 +0900 ++++ /tmp/dpep.kRYSCG/ruby1.9-1.9.0+20050623/ruby.c 2005-06-29 23:47:49.000000000 +0900 +@@ -353,6 +353,9 @@ + incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB)); + #endif + incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB)); ++#ifdef RUBY_EXTRA_SITE_SEARCH_PATH ++ ruby_incpush(RUBY_RELATIVE(RUBY_EXTRA_SITE_SEARCH_PATH)); ++#endif + incpush(RUBY_RELATIVE(RUBY_SITE_LIB)); + + incpush(RUBY_RELATIVE(RUBY_LIB)); +@@ -360,6 +363,9 @@ + incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB)); + #endif + incpush(RUBY_RELATIVE(RUBY_ARCHLIB)); ++#ifdef RUBY_EXTRA_SEARCH_PATH ++ ruby_incpush(RUBY_RELATIVE(RUBY_EXTRA_SEARCH_PATH)); ++#endif + + if (rb_safe_level() == 0) { + incpush("."); --- ruby1.9-1.9.0.5.orig/debian/patches/940_test_file_exhaustive_fails_as_root.dpatch +++ ruby1.9-1.9.0.5/debian/patches/940_test_file_exhaustive_fails_as_root.dpatch @@ -0,0 +1,91 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 940_test_file_exhaustive_fails_as_root.dpatch by Lucas Nussbaum +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: several tests fail when building as root. +## DP: see http://redmine.ruby-lang.org/issues/show/1170 + +@DPATCH@ +diff -urNad ruby1.9-1.9.1.0~/test/ruby/test_file_exhaustive.rb ruby1.9-1.9.1.0/test/ruby/test_file_exhaustive.rb +--- ruby1.9-1.9.1.0~/test/ruby/test_file_exhaustive.rb 2009-01-12 14:33:08.000000000 +0100 ++++ ruby1.9-1.9.1.0/test/ruby/test_file_exhaustive.rb 2009-02-18 14:52:37.000000000 +0100 +@@ -142,6 +142,7 @@ + + def test_readable_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0200, @file) + assert(!(File.readable?(@file))) + File.chmod(0600, @file) +@@ -151,6 +152,7 @@ + + def test_readable_real_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0200, @file) + assert(!(File.readable_real?(@file))) + File.chmod(0600, @file) +@@ -171,6 +173,7 @@ + + def test_writable_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0400, @file) + assert(!(File.writable?(@file))) + File.chmod(0600, @file) +@@ -180,6 +183,7 @@ + + def test_writable_real_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0400, @file) + assert(!(File.writable_real?(@file))) + File.chmod(0600, @file) +@@ -238,6 +242,7 @@ + + def test_owned_p ## xxx + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 # only needed on HPPA? + assert(File.owned?(@file)) + assert(File.grpowned?(@file)) + end +@@ -611,6 +616,7 @@ + + def test_stat_readable_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0200, @file) + assert(!(File::Stat.new(@file).readable?)) + File.chmod(0600, @file) +@@ -619,6 +625,7 @@ + + def test_stat_readable_real_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0200, @file) + assert(!(File::Stat.new(@file).readable_real?)) + File.chmod(0600, @file) +@@ -637,6 +644,7 @@ + + def test_stat_writable_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0400, @file) + assert(!(File::Stat.new(@file).writable?)) + File.chmod(0600, @file) +@@ -645,6 +653,7 @@ + + def test_stat_writable_real_p + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 + File.chmod(0400, @file) + assert(!(File::Stat.new(@file).writable_real?)) + File.chmod(0600, @file) +@@ -696,6 +705,7 @@ + + def test_stat_owned_p ## xxx + return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM ++ return if Process.euid == 0 # only needed on HPPA? + assert(File::Stat.new(@file).owned?) + assert(File::Stat.new(@file).grpowned?) + end