summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--bignum.c2
-rw-r--r--config_s.dj1
-rw-r--r--configure.in9
-rw-r--r--hash.c38
-rw-r--r--instruby.rb2
-rw-r--r--lib/mkmf.rb22
-rw-r--r--marshal.c2
-rw-r--r--version.h4
-rw-r--r--win32/config.status1
10 files changed, 87 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c977f4276b2..2073e8a919c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+Tue Apr 11 21:14:42 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
+
+ * config_s.dj: add @sitedir@.
+ * configure.in: add --with-sitedir=DIR option.
+ * instruby.rb: use CONFIG["sitedir"].
+ * lib/mkmf.rb: support 'make site-install'.
+ * win32/config.status: add @sitedir@.
+
+Tue Apr 11 16:25:15 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * bignum.c (rb_big_2comp): unnecessary lvalue cast removed.
+
+Tue Apr 11 02:25:53 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * hash.c (env_fetch): new method.
+
+ * marshal.c (marshal_dump): accepts depth = nil for unlimited depth.
+
Sun Apr 9 20:49:19 2000 Dave Thomas <Dave@Thomases.com>
* parse.y (str_extend): Allow class variables to be expanded.
diff --git a/bignum.c b/bignum.c
index 7d1a513cd93..37f02a37528 100644
--- a/bignum.c
+++ b/bignum.c
@@ -69,7 +69,7 @@ rb_big_2comp(x) /* get 2's complement */
for (i=1; i<RBIGNUM(x)->len; i++) {
if (ds[i] != 0) return;
}
- REALLOC_N(BDIGITS(x), USHORT, RBIGNUM(x)->len++);
+ REALLOC_N(RBIGNUM(x)->digits, USHORT, RBIGNUM(x)->len++);
ds = BDIGITS(x);
ds[RBIGNUM(x)->len-1] = 1;
}
diff --git a/config_s.dj b/config_s.dj
index 6f77b7f7389..90902472af7 100644
--- a/config_s.dj
+++ b/config_s.dj
@@ -53,4 +53,5 @@ s%@LIBRUBY_SO@%%g
s%@SOLIBS@%%g
s%@srcdir%.%g
s%@arch@%i386-djgpp%g
+s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
ac_given_srcdir=.
diff --git a/configure.in b/configure.in
index 486d0bd2ae6..6fd4117c29c 100644
--- a/configure.in
+++ b/configure.in
@@ -817,14 +817,19 @@ test "$program_suffix" != NONE &&
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
RUBY_LIB_PREFIX="${prefix}/lib/ruby"
RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
-RUBY_SITE_LIB_PATH="${RUBY_LIB_PREFIX}/site_ruby"
-RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
+sitedir="${prefix}/lib/ruby/site_ruby"
+AC_ARG_WITH(sitedir,
+ [--with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
+ [sitedir=$withval])
+RUBY_SITE_LIB_PATH="${sitedir}"
+RUBY_SITE_LIB_PATH2="${sitedir}/${MAJOR}.${MINOR}"
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
AC_SUBST(arch)dnl
+AC_SUBST(sitedir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
diff --git a/hash.c b/hash.c
index a19e2983283..b6978781b8f 100644
--- a/hash.c
+++ b/hash.c
@@ -336,7 +336,7 @@ rb_hash_fetch(argc, argv, hash)
if (argc > 1) {
rb_raise(rb_eArgError, "wrong # of arguments", argc);
}
- return rb_yield(argv[0]);
+ return rb_yield(key);
}
if (argc == 1) {
rb_raise(rb_eIndexError, "key not found");
@@ -918,6 +918,40 @@ rb_f_getenv(obj, name)
return Qnil;
}
+static VALUE
+env_fetch(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE key, if_none;
+ char *nam, *env;
+ int len;
+
+ VALUE val;
+
+ rb_scan_args(argc, argv, "11", &key, &if_none);
+ nam = rb_str2cstr(key, &len);
+ if (strlen(nam) != len) {
+ rb_raise(rb_eArgError, "bad environment variable name");
+ }
+ env = getenv(nam);
+ if (!env) {
+ if (rb_iterator_p()) {
+ if (argc > 1) {
+ rb_raise(rb_eArgError, "wrong # of arguments", argc);
+ }
+ return rb_yield(key);
+ }
+ if (argc == 1) {
+ rb_raise(rb_eIndexError, "key not found");
+ }
+ return if_none;
+ }
+ if (strcmp(nam, "PATH") == 0 && !rb_env_path_tainted())
+ return rb_str_new2(env);
+ return rb_tainted_str_new2(env);
+}
+
static void
path_tainted_p(path)
char *path;
@@ -1434,7 +1468,9 @@ Init_Hash()
rb_extend_object(envtbl, rb_mEnumerable);
rb_define_singleton_method(envtbl,"[]", rb_f_getenv, 1);
+ rb_define_singleton_method(envtbl,"fetch", env_fetch, -1);
rb_define_singleton_method(envtbl,"[]=", rb_f_setenv, 2);
+ rb_define_singleton_method(envtbl,"store", rb_f_setenv, 2);
rb_define_singleton_method(envtbl,"each", env_each, 0);
rb_define_singleton_method(envtbl,"each_pair", env_each, 0);
rb_define_singleton_method(envtbl,"each_key", env_each_key, 0);
diff --git a/instruby.rb b/instruby.rb
index 3e2c85be858..444b7e6465b 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -24,7 +24,7 @@ bindir = destdir+CONFIG["bindir"]
libdir = destdir+CONFIG["libdir"]
rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version
archlibdir = rubylibdir+arch
-sitelibdir = destdir+CONFIG["prefix"]+"/lib/ruby/site_ruby"+version
+sitelibdir = destdir+CONFIG["sitedir"]+version
sitearchlibdir = sitelibdir+arch
mandir = destdir+CONFIG["mandir"] + "/man1"
wdir = Dir.getwd
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 6a16c54e604..74238b98b05 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -13,6 +13,8 @@ $config_cache = CONFIG["compile_dir"]+"/ext/config.cache"
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
+$sitelibdir = CONFIG["sitedir"]+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+$sitearchdir = $sitelibdir+"/"+CONFIG["arch"]
if File.exist? $archdir + "/ruby.h"
$hdrdir = $archdir
@@ -107,7 +109,7 @@ def try_run(src, opt="")
end
end
-def install_rb(mfile, srcdir = nil)
+def install_rb(mfile, dest, srcdir = nil)
libdir = "lib"
libdir = srcdir + "/" + libdir if srcdir
path = []
@@ -120,10 +122,10 @@ def install_rb(mfile, srcdir = nil)
end
for f in dir
next if f == "."
- mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir)/%s\n", f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' %s/%s\n", dest, f
end
for f in path
- mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s $(libdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s %s/%s\n", f, dest, f
end
end
@@ -373,6 +375,8 @@ prefix = #{CONFIG["prefix"]}
exec_prefix = #{CONFIG["exec_prefix"]}
libdir = #{$libdir}
archdir = #{$archdir}
+sitelibdir = #{$sitelibdir}
+sitearchdir = #{$sitearchdir}
#### End of system configuration section. ####
@@ -398,11 +402,21 @@ realclean: clean
install: $(archdir)/$(DLLIB)
+site-install: $(sitearchdir)/$(DLLIB)
+
$(archdir)/$(DLLIB): $(DLLIB)
@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(archdir)
@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(archdir)/$(DLLIB)
EOMF
- install_rb(mfile)
+ install_rb(mfile, "$(libdir)")
+ mfile.printf "\n"
+
+ mfile.printf <<EOMF
+$(sitearchdir)/$(DLLIB): $(DLLIB)
+ @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(sitearchdir)
+ @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(sitearchdir)/$(DLLIB)
+EOMF
+ install_rb(mfile, "$(sitelibdir)")
mfile.printf "\n"
if CONFIG["DLEXT"] != $OBJEXT
diff --git a/marshal.c b/marshal.c
index a152010c204..f5115c4b296 100644
--- a/marshal.c
+++ b/marshal.c
@@ -446,7 +446,7 @@ marshal_dump(argc, argv)
port = 0;
rb_scan_args(argc, argv, "12", &obj, &a1, &a2);
if (argc == 3) {
- limit = NUM2INT(a2);
+ if (!NIL_P(a2)) limit = NUM2INT(a2);
port = a1;
}
else if (argc == 2) {
diff --git a/version.h b/version.h
index 6d669589eff..c5c4258787b 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.3"
-#define RUBY_RELEASE_DATE "2000-04-10"
+#define RUBY_RELEASE_DATE "2000-04-11"
#define RUBY_VERSION_CODE 153
-#define RUBY_RELEASE_CODE 20000410
+#define RUBY_RELEASE_CODE 20000411
diff --git a/win32/config.status b/win32/config.status
index 36ffc99949c..150e2f3b85b 100644
--- a/win32/config.status
+++ b/win32/config.status
@@ -59,6 +59,7 @@ s%@LIBRUBY@%libruby.lib%g
s%@LIBRUBYARG@%libruby.lib%g
s%@SOLIBS@%%g
s%@arch@%i386-mswin32%g
+s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
s%@configure_args@%--with-make-prog=nmake%g
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g