rFSM/utils.lua vs ocl/lua/utils.lua

Hello,

I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
noticed that both provide a utils.lua file (which both should go into
/usr/share/lua/5.1/)
The version of rFSM seems to be an extended version of the one in ocl.
If I have to choose between the two would the one in rFSM work for
both?

Ruben

rFSM/utils.lua vs ocl/lua/utils.lua

On Fri, Aug 24, 2012 at 10:20:07AM +0200, Ruben Smits wrote:
> Hello,
>
> I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
> noticed that both provide a utils.lua file (which both should go into
> /usr/share/lua/5.1/)
> The version of rFSM seems to be an extended version of the one in ocl.
> If I have to choose between the two would the one in rFSM work for
> both?

Ouch, it's the same library, distributed for convenience with both ocl
and rFSM. I always update both when utils changes, but they show up at
different times. Using the newest will work OK for both, since I never
made any incompatible changes up to now.

The correct thing to do in the (close) future will be to distribute
utils.lua with both packages but with separated names,
ie. utils_rfsm.lua and utils_ocl.lua in order to avoid conflicts.

Markus

Ruben Smits's picture

rFSM/utils.lua vs ocl/lua/utils.lua

FYI,

On Fri, Aug 24, 2012 at 10:20 AM, Ruben Smits
<ruben [dot] smits [..] ...> wrote:
> Hello,
>
> I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
> noticed that both provide a utils.lua file (which both should go into
> /usr/share/lua/5.1/)
> The version of rFSM seems to be an extended version of the one in ocl.
> If I have to choose between the two would the one in rFSM work for
> both?

I solved this for now by using the alternatives system
(http://linux.die.net/man/8/alternatives).

Ruben
> Ruben
>
> --
> Ruben Smits, Phd
> Chief Technology Officer
> Intermodalics BVBA
> +32479511786
> www.intermodalics.eu

rFSM/utils.lua vs ocl/lua/utils.lua

On Fri, Aug 24, 2012 at 11:20:39AM +0200, Ruben Smits wrote:
> FYI,
>
> On Fri, Aug 24, 2012 at 10:20 AM, Ruben Smits
> <ruben [dot] smits [..] ...> wrote:
> > Hello,
> >
> > I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
> > noticed that both provide a utils.lua file (which both should go into
> > /usr/share/lua/5.1/)
> > The version of rFSM seems to be an extended version of the one in ocl.
> > If I have to choose between the two would the one in rFSM work for
> > both?
>
> I solved this for now by using the alternatives system
> (http://linux.die.net/man/8/alternatives).

But alternatives only lets you choose statically between different
versions, but you can not use them both simultaneously!

Markus

Ruben Smits's picture

rFSM/utils.lua vs ocl/lua/utils.lua

On Fri, Aug 24, 2012 at 12:58 PM, Markus Klotzbuecher
<markus [dot] klotzbuecher [..] ...> wrote:
> On Fri, Aug 24, 2012 at 11:20:39AM +0200, Ruben Smits wrote:
>> FYI,
>>
>> On Fri, Aug 24, 2012 at 10:20 AM, Ruben Smits
>> <ruben [dot] smits [..] ...> wrote:
>> > Hello,
>> >
>> > I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
>> > noticed that both provide a utils.lua file (which both should go into
>> > /usr/share/lua/5.1/)
>> > The version of rFSM seems to be an extended version of the one in ocl.
>> > If I have to choose between the two would the one in rFSM work for
>> > both?
>>
>> I solved this for now by using the alternatives system
>> (http://linux.die.net/man/8/alternatives).
>
> But alternatives only lets you choose statically between different
> versions, but you can not use them both simultaneously!

In my case, you can still explicitly require the utils provided by the
respective package by using the ocl/rfsm_utils.lua. I know it's not a
perfect solution, if the functionality is the same it would probably
better to provide the utils.lua (and ansicolors too btw) in a separate
package instead of including it in both.

Ruben

> Markus

rFSM/utils.lua vs ocl/lua/utils.lua

On Fri, Aug 24, 2012 at 01:44:31PM +0200, Ruben Smits wrote:
> On Fri, Aug 24, 2012 at 12:58 PM, Markus Klotzbuecher
> <markus [dot] klotzbuecher [..] ...> wrote:
> > On Fri, Aug 24, 2012 at 11:20:39AM +0200, Ruben Smits wrote:
> >> FYI,
> >>
> >> On Fri, Aug 24, 2012 at 10:20 AM, Ruben Smits
> >> <ruben [dot] smits [..] ...> wrote:
> >> > Hello,
> >> >
> >> > I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
> >> > noticed that both provide a utils.lua file (which both should go into
> >> > /usr/share/lua/5.1/)
> >> > The version of rFSM seems to be an extended version of the one in ocl.
> >> > If I have to choose between the two would the one in rFSM work for
> >> > both?
> >>
> >> I solved this for now by using the alternatives system
> >> (http://linux.die.net/man/8/alternatives).
> >
> > But alternatives only lets you choose statically between different
> > versions, but you can not use them both simultaneously!
>
> In my case, you can still explicitly require the utils provided by the
> respective package by using the ocl/rfsm_utils.lua. I know it's not a
> perfect solution, if the functionality is the same it would probably
> better to provide the utils.lua (and ansicolors too btw) in a separate
> package instead of including it in both.

Yes, that would be a third option!
The latest code for utils is here:

https://bitbucket.org/kmarkus/utils

ansicolors afaik never changed.

Markus

Ruben Smits's picture

rFSM/utils.lua vs ocl/lua/utils.lua

On Fri, Aug 24, 2012 at 3:30 PM, Markus Klotzbuecher
<markus [dot] klotzbuecher [..] ...> wrote:
> On Fri, Aug 24, 2012 at 01:44:31PM +0200, Ruben Smits wrote:
>> On Fri, Aug 24, 2012 at 12:58 PM, Markus Klotzbuecher
>> <markus [dot] klotzbuecher [..] ...> wrote:
>> > On Fri, Aug 24, 2012 at 11:20:39AM +0200, Ruben Smits wrote:
>> >> FYI,
>> >>
>> >> On Fri, Aug 24, 2012 at 10:20 AM, Ruben Smits
>> >> <ruben [dot] smits [..] ...> wrote:
>> >> > Hello,
>> >> >
>> >> > I'm packaging both the orocos_toolchain and rFSM for RHEL6 and I
>> >> > noticed that both provide a utils.lua file (which both should go into
>> >> > /usr/share/lua/5.1/)
>> >> > The version of rFSM seems to be an extended version of the one in ocl.
>> >> > If I have to choose between the two would the one in rFSM work for
>> >> > both?
>> >>
>> >> I solved this for now by using the alternatives system
>> >> (http://linux.die.net/man/8/alternatives).
>> >
>> > But alternatives only lets you choose statically between different
>> > versions, but you can not use them both simultaneously!
>>
>> In my case, you can still explicitly require the utils provided by the
>> respective package by using the ocl/rfsm_utils.lua. I know it's not a
>> perfect solution, if the functionality is the same it would probably
>> better to provide the utils.lua (and ansicolors too btw) in a separate
>> package instead of including it in both.
>
> Yes, that would be a third option!
> The latest code for utils is here:
>
> https://bitbucket.org/kmarkus/utils

Thanks.

> ansicolors afaik never changed.

I know, but the problem is that both orocos_toolchain and rFSM, if
packaged, try to install it in /usr/share/lua/5.1, which breaks the
install.

> Markus

Ruben