[csw-devel] proposed checkpkg change

Maciej Bliziński maciej at opencsw.org
Thu Apr 7 10:25:25 CEST 2011


2011/4/7 Ben Walton <bwalton at opencsw.org>:
>
> Hi Maciej,
>
> What do you think of the following change to checkpkg:
>
> bwalton @ current9x : ~/opencsw/.buildsys/v2/lib/python
> $ svn diff
> Index: dependency_checks.py
> ===================================================================
> --- dependency_checks.py        (revision 14086)
> +++ dependency_checks.py        (working copy)
> @@ -32,7 +32,7 @@
>     (r".*\.pl$",   (u"CSWperl",)),
>     (r".*\.pm$",   (u"CSWperl",)),
>     (r".*\.py$",   (u"CSWpython",)),
> -    (r".*\.rb$",   (u"CSWruby",)),
> +    (r".*\.rb$",   (u"CSWruby", u"CSWruby18")),
>     (r".*\.elc?$", (u"CSWemacscommon",)),
>     (r"/opt/csw/apache2/", (u"CSWapache2",)),
>  )
>
>
> This allows a package containing .rb files to depend on CSWruby or
> CSWruby18.  I could just do a straight s/CSWruby/CSWruby18/ and that
> would be valid too.  What are your thoughts on this?  The only
> downside I see is if we ever make CSWruby pull in 1.9 instead of 1.8
> by default, people might end up with the wrong dep.  That's quite a
> bit in the future though.

It depends whether gems are version-specific.  If not, then depending
on CSWruby might be better.

I hope to change this very crude dependency detection to something
better: the NeedFile function in checkpkg.

There would need to be a bit of code to identify the interpreter as a
path, in Python's case it could be /opt/csw/bin/python2.6.  Then in
the checkpkg code, you can say:

error_mgr.NeedFile("CSWfoo", "/opt/csw/bin/python2.6")

Checkpkg then goes, looks up the file and checks if CSWfoo depends on
the package containing that file.  If you say NeedFile("CSWfoo",
"/opt/csw/bin/ruby"), and /opt/csw/bin/ruby is a symlink provided by
CSWruby, then everything will work as expected: CSWruby will be
needed.  If you call NeedFile("CSWfoo", "/opt/csw/bin/ruby18"), then
the dependency on CSWruby18 will be required.

It boils down to whether gems need bin/ruby18 or bin/ruby.  If it's
something that can be determined by the package maintainer, then the
change is OK as presented.

Maciej


More information about the devel mailing list