RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-5_3: rpm/ CHANGES configure.ac devtool.conf rpm/rpmio/ ...

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 21 Sep 2010 - 17:54:13 CEST
Message-Id: <20100921155413.1FDA6D0E2D@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   21-Sep-2010 17:54:13
  Branch: rpm-5_3                          Handle: 2010092115541101

  Modified files:           (Branch: rpm-5_3)
    rpm                     CHANGES configure.ac devtool.conf
    rpm/rpmio               rpmruby.c

  Log:
    - ruby: stick with ruby-1.8.6 (1.9.2p0 needs work).
    - yarn: add yarnLaunchStack() to create a yarnThread with a stack.

  Summary:
    Revision    Changes     Path
    1.3296.2.77 +2  -1      rpm/CHANGES
    2.432.2.18  +1  -1      rpm/configure.ac
    2.333.2.22  +1  -1      rpm/devtool.conf
    2.12.2.10   +23 -14     rpm/rpmio/rpmruby.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3296.2.76 -r1.3296.2.77 CHANGES
  --- rpm/CHANGES	20 Sep 2010 18:17:34 -0000	1.3296.2.76
  +++ rpm/CHANGES	21 Sep 2010 15:54:11 -0000	1.3296.2.77
  @@ -1,5 +1,6 @@
   5.3.3 -> 5.3.4:
  -    - yarn: add yarnLaunchStack() to create a yarnThread with a stack.
  +    - jbj: ruby: stick with ruby-1.8.6 (1.9.2p0 needs work).
  +    - jbj: yarn: add yarnLaunchStack() to create a yarnThread with a stack.
       - jbj: ruby: don't load stringio for now, there's a segfault here.
       - jbj: ruby: wire-up a global interpreter always.
       - jbj: autofu: hot-wire ruby-1.9.2p0 embedding.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.432.2.17 -r2.432.2.18 configure.ac
  --- rpm/configure.ac	19 Sep 2010 03:28:51 -0000	2.432.2.17
  +++ rpm/configure.ac	21 Sep 2010 15:54:12 -0000	2.432.2.18
  @@ -1486,7 +1486,7 @@
   WITH_RUBY_SUBDIR=""
   RPM_CHECK_LIB(
       [Ruby], [ruby],
  -    [ruby-static], [ruby_init], [ruby.h],
  +    [ruby], [ruby_init], [ruby.h],
       [no,external:none], [],
       [ AC_DEFINE(WITH_RUBYEMBED, 1, [Define to 1 if you want embedded Ruby])
         WITH_RUBY_SUBDIR=ruby
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  ============================================================================
  $ cvs diff -u -r2.333.2.21 -r2.333.2.22 devtool.conf
  --- rpm/devtool.conf	18 Sep 2010 22:03:51 -0000	2.333.2.21
  +++ rpm/devtool.conf	21 Sep 2010 15:54:12 -0000	2.333.2.22
  @@ -129,7 +129,7 @@
           --with-pythonembed=/usr/lib:/usr/include/python2.6 \
           --with-perl \
           --without-perlembed \
  -        --with-ruby=/usr/lib/ruby/1.8/i386-linux \
  +	--with-ruby \
           --with-selinux \
           --with-sepol \
           --with-semanage \
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmruby.c
  ============================================================================
  $ cvs diff -u -r2.12.2.9 -r2.12.2.10 rpmruby.c
  --- rpm/rpmio/rpmruby.c	20 Sep 2010 19:27:05 -0000	2.12.2.9
  +++ rpm/rpmio/rpmruby.c	21 Sep 2010 15:54:12 -0000	2.12.2.10
  @@ -1,7 +1,7 @@
   #include "system.h"
  -#include <argv.h>
   
  -/* XXX grrr, ruby.h includes its own config.h too. */
  +#if defined(WITH_RUBYEMBED)
  +/* XXX ruby-1.8.6 grrr, ruby.h includes its own config.h too. */
   #ifdef	HAVE_CONFIG_H
   #include "config.h"
   #endif
  @@ -11,7 +11,6 @@
   #undef	PACKAGE_STRING
   #undef	PACKAGE_BUGREPORT
   
  -#if defined(WITH_RUBYEMBED)
   #undef	xmalloc
   #undef	xcalloc
   #undef	xrealloc
  @@ -39,6 +38,7 @@
   rpmruby _rpmrubyI = NULL;
   
   /*==============================================================*/
  +#if defined(HAVE_RUBY_DEFINES_H)	/* XXX ruby-1.9.2p0 */
   /* puts the Ruby coroutine in control */
   static void _rpmruby_main_to_ruby(rpmruby ruby)
   {
  @@ -155,11 +155,13 @@
       Trace((zlog, "-- %s: ended", __FUNCTION__));
       return NULL;
   }
  +#endif	/* HAVE_RUBY_DEFINES_H */
   
   int rpmrubyRunThread(rpmruby ruby)
   {
       int ec = 0;
   
  +#if defined(HAVE_RUBY_DEFINES_H)	/* XXX ruby-1.9.2p0 */
       yarnPossess(ruby->ruby_coroutine_lock);
       yarnPossess(ruby->main_coroutine_lock);
   
  @@ -177,6 +179,8 @@
       yarnRelease(ruby->ruby_coroutine_lock);
       /* Reap the ruby thread. */
       ruby->thread = yarnJoin(ruby->thread);
  +    ec = 0;
  +#endif	/* HAVE_RUBY_DEFINES_H */
   
       return ec;
   }
  @@ -191,9 +195,12 @@
   
       /* XXX FIXME: 0x40000000 => xruby.c wrapper without interpreter. */
       if (ruby->flags & 0x40000000) {
  -	ruby->zlog = rpmzLogDump(ruby->zlog, NULL);
   	ruby->main_coroutine_lock = yarnFreeLock(ruby->main_coroutine_lock);
   	ruby->ruby_coroutine_lock = yarnFreeLock(ruby->ruby_coroutine_lock);
  +	ruby->zlog = rpmzLogDump(ruby->zlog, NULL);
  +	ruby->stack = _free(ruby->stack);
  +	ruby->nstack = 0;
  +	_rpmrubyI = NULL;
       } else {
   #if defined(WITH_RUBYEMBED)
   	ruby_finalize();
  @@ -224,7 +231,7 @@
   }
   
   /*@unchecked@*/
  -#if defined(WITH_RUBYEMBED)
  +#if defined(WITH_RUBYEMBED) && !defined(HAVE_RUBY_DEFINES_H)/* XXX ruby-1.8.6 */
   static const char * rpmrubyInitStringIO = "\
   require 'stringio'\n\
   $stdout = StringIO.new($result, \"w+\")\n\
  @@ -265,6 +272,9 @@
       if (ruby->flags & 0x40000000) {
   	static size_t _rpmrubyStackSize = 4 * 1024 * 1024;
   
  +	/* XXX save as global interpreter. */
  +	_rpmrubyI = ruby;
  +
   	ruby->nstack = _rpmrubyStackSize;
   	ruby->stack = malloc(ruby->nstack);
   assert(ruby->stack != NULL);
  @@ -277,19 +287,18 @@
   	ruby->ruby_coroutine_lock = yarnNewLock(0);
   	ruby->main_coroutine_lock = yarnNewLock(0);
   
  -	/* XXX save as global interpreter. */
  -	_rpmrubyI = ruby;
  -
       } else {
   
   #if defined(WITH_RUBYEMBED)
   	VALUE variable_in_this_stack_frame;		/* RUBY_INIT_STSCK */
   
  -#ifdef	NOTYET	/* XXX ruby-1.9.2p0 ruby_bind_stack patch needed */
  +#if defined(HAVE_RUBY_DEFINES_H)	/* XXX ruby-1.9.2 */
  +	ruby_sysinit(&ruby->ac, (char ***) &ruby->av);
  +	/* XXX ruby-1.9.2p0 ruby_bind_stack() patch needed */
   	{
   	    uint8_t * b = ruby->stack;
   	    uint8_t * e = b + ruby->nstack;
  -	    ruby_sysinit(&ruby->ac, (char ***) &ruby->av);
  +	    ruby_bind_stack((VALUE *)b, (VALUE *) e);
   	}
   #endif	/* NOTYET */
   
  @@ -303,7 +312,7 @@
   	    ruby_set_argv(argvCount((ARGV_t)av)-1, av+1);
   
   	rb_gv_set("$result", rb_str_new2(""));
  -#ifdef	NOTYET	/* XXX avoid ruby-1.9.2p0 segfaults */
  +#if !defined(HAVE_RUBY_DEFINES_H)	/* XXX ruby-1.8.6 */
   	(void) rpmrubyRun(ruby, rpmrubyInitStringIO, NULL);
   #endif
   #endif	/* WITH_RUBYEMBED */
  @@ -325,12 +334,12 @@
   	goto exit;
   
   #if defined(WITH_RUBYEMBED)
  -#ifdef	DYING
  +#if !defined(HAVE_RUBY_DEFINES_H)	/* XXX ruby-1.8.6 */
       rb_load_file(fn);
       ruby->state = ruby_exec();
  -#else	/* DYING */
  +#else
       ruby->state = ruby_exec_node(rb_load_file(fn));
  -#endif	/* DYING */
  +#endif
       if (resultp != NULL)
   	*resultp = RSTRING_PTR(rb_gv_get("$result"));
       rc = RPMRC_OK;
  @@ .
Received on Tue Sep 21 17:54:13 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.