[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gem2deb: support for building using setup.rb



Vincent Fourmond escreveu isso aí:
> On 11/05/11 18:46, Antonio Terceiro wrote:
> > Vincent Fourmond escreveu isso aí:
> >> On 11/05/11 17:51, Antonio Terceiro wrote:
> >>> As Lucas wrote, setup.rb seems to be really deprecated. But if Vincent
> >>> is willing to write the code, IMO go ahead and write a proposal so we
> >>> can discuss in more concrete terms.
> >>
> >>   It's in principle ready...
> >>
> >>> I have only one requirement: instead of modifying the DhRuby class, please
> >>> subclass it and override the needed methods (calling super where it
> >>> makes sense), and make dh_ruby instantiate this class instead of plain
> >>> DhRuby in the case --setup-rb is passed in ARGV.
> >>
> >>   ... excepted for that.
> >>
> >>   I'll first push the changes "as is" and I'll implement the subclassing
> >> just afterwards. It is quite trivial.
> > 
> > Sorry, but I forgot to push some commits from my gem2deb 0.2.3 upload
> > yesterday, would you mind moving your code into a separate branch so
> > that I can force-push my master branch?
> > 
> > In general, it would be nice to work on separate branches for ideas we
> > want to try, and leave master always in a releasable state.
> 
>   OK. I've reverted the commits I had pushed to master, and stored them
> on the setup-rb branch. I'll merge any change necessary from your commits.

Ok, I've pushed my master branch there. It would be nice if you could
provide a clean set of changes on top of that, with:

  * one commit with the refactoring of the destdir calculations (that's
    a nice catch, thanks!)
  * one commit that adds the new class, the corresponding change in
    the dh_ruby script for intantiating the correct class.

About the code:

Please add your new class to a new file with a proper name and add the
proper require in dh_ruby.

It would be nice to have automated tests for this new class.

The spawn method you wrote already exists: run(cmd). You can use it
instead.

Instead of adding a new debhelper buildsystem, would't it be better to
centralize the logic of calling dh_ruby in one place? I'm not sure about
this, because that code seems so simple already. :-/

Your internal_install method doesn't handle running the tests. It would
be nice to extract the logic of running tests into a method of its on,
so that the install method would look like the following sequence:

  * install files and build extensions
  * run tests
  * update shebangs
  * check for require rubygems

then you would only need to override the install files and build
extensions part. Actually, check the updated master branch, it's easier
to show than than to describe. :)

http://git.debian.org/?p=pkg-ruby-extras/gem2deb.git;a=commitdiff;h=fb547d84b5545ac5dee8de9023ccae51d5cf61da

So you should be good by overriding install_files_and_build_extensions
on your new class.

after (or instead of) `setup.rb clean`, shouldn't you also do `setup.rb distclean`?
(I think ruby-pkg-tools does something like that)

-- 
Antonio Terceiro <terceiro@softwarelivre.org>
http://softwarelivre.org/terceiro


Attachment: signature.asc
Description: Digital signature


Reply to: