Julian Fagir | 2 Mar 2012 20:31
Picon

Re: Sysinst support for installing source sets

Hi,

> I have a patch to sysinst which adds the ability to install source
> sets, and I'm wondering if I should commit it.
> ...
> Second, because source sets reside in a different directory than the
> binary sets both on install media and on FTP sites (as a result of
> being machine independent), sysinst now lets you enter a separate
> "Binary set directory" and "Source set directory" instead of just a
> "Set directory".  A default source set directory is provided and will
> be correct in the typical cases, such as installing by FTP from
> ftp.netbsd.org or from an ISO built using "build.sh iso-image-source".
as already stated by you, this is half of the fix for PR install/9582.
Doing the same for pkgsrc is mostly copy&paste (I've already done that), but
it's not very clean.
To fetch pkgsrc, you cannot use the ftp directories as used before, because
they are rooted in the netbsd/ directory. To fetch pkgsrc, you'd have to use
a ../pkgsrc/ in the pathname.
Do you really want that? Or rather change the ftp root directory (which might
not be reliable)?

Regards, Julian
Andreas Gustafsson | 3 Mar 2012 17:39

Re: Sysinst support for installing source sets

Julian Fagir wrote:
> as already stated by you, this is half of the fix for PR install/9582.
> Doing the same for pkgsrc is mostly copy&paste (I've already done that), but
> it's not very clean.
> To fetch pkgsrc, you cannot use the ftp directories as used before, because
> they are rooted in the netbsd/ directory. To fetch pkgsrc, you'd have to use
> a ../pkgsrc/ in the pathname.
> Do you really want that? Or rather change the ftp root directory (which might
> not be reliable)?

I'm afraid I don't have a quick and easy answer to that question.
That's part of the reason why I didn't add pkgsrc installation support
myself at the same time as the src installation support.
--

-- 
Andreas Gustafsson, gson <at> gson.org

Marc Balmer | 4 Mar 2012 12:24
Picon

Re: reworking sysinst: A Lua based msg system

	One of the goals of reworking sysinst is to have a replacement for the
static, C based, msg system.  The new message system should provide at
least the following functionality

- support for easy translation into foreign languages
- support dynamically created message that contain variables
- be modular insfar as sysinst extension modules can come with their own
set of (translated) messages

Message catalogs

	Messages are organized in message catalogs, one catalog per language.
Once a language has been selected by the users, only that message
catalog is used.  Message catalogs are Lua tables and a Lua script can
add its messages by calling the msg() function:

msg('english', {greeting = 'Hello', monday = 'Monday'})
msg('german', {greeting = 'Guten Tag', monday = 'Montag'})

	The function call was chosen over a static table initialization so that
scripts that run later can add to the message catalogs.  The message
catalog is available as the global table '_M', so _M.greeting will
produce the greeting message in the chosen language.

Messages with variable content

	Message definitions are not static, in fact they can contain Lua code
or expressions.  The syntax is simple:  Text embraced in <% %> is
interpreted as Lua code which is executed when the message is being
produced.  Text embraced in <%= %> is interpreted as a Lua expression,
(Continue reading)

Martin Husemann | 4 Mar 2012 12:35
Picon

Re: reworking sysinst: A Lua based msg system

On Sun, Mar 04, 2012 at 12:24:59PM +0100, Marc Balmer wrote:
> - support for easy translation into foreign languages
> - support dynamically created message that contain variables
> - be modular insfar as sysinst extension modules can come with their own
> set of (translated) messages

Why are you not using existing functionality for this (like catopen(3))?
I don't mean to imply that this would be a better solution, but the
reasoning should be made explicit and clear.

> Message catalogs
> 
> 	Messages are organized in message catalogs, one catalog per language.
> Once a language has been selected by the users, only that message
> catalog is used.  Message catalogs are Lua tables and a Lua script can
> add its messages by calling the msg() function:
> 
> msg('english', {greeting = 'Hello', monday = 'Monday'})
> msg('german', {greeting = 'Guten Tag', monday = 'Montag'})

Messages are data, not program code - keep them separate.

How do you identify messages in your code? By index?

Besides the "modules need to be able to add messages (including translations)"
property you cited above, there are two tremendously important properties
a new scheme should provide:

 - if a translation is missing, automatically fall back to english
   (so a new message can be added as english only and native translators
(Continue reading)

Marc Balmer | 4 Mar 2012 12:45
Picon

Re: reworking sysinst: A Lua based msg system

Am 04.03.12 12:35, schrieb Martin Husemann:
> On Sun, Mar 04, 2012 at 12:24:59PM +0100, Marc Balmer wrote:
>> - support for easy translation into foreign languages
>> - support dynamically created message that contain variables
>> - be modular insfar as sysinst extension modules can come with their own
>> set of (translated) messages
> 
> Why are you not using existing functionality for this (like catopen(3))?
> I don't mean to imply that this would be a better solution, but the
> reasoning should be made explicit and clear.

I want to eliminate the need to process messages in any form prior to
using them.  The goal is make things as easy as possible for users, Lua
being the only tool a user must know.

> 
>> Message catalogs
>>
>> 	Messages are organized in message catalogs, one catalog per language.
>> Once a language has been selected by the users, only that message
>> catalog is used.  Message catalogs are Lua tables and a Lua script can
>> add its messages by calling the msg() function:
>>
>> msg('english', {greeting = 'Hello', monday = 'Monday'})
>> msg('german', {greeting = 'Guten Tag', monday = 'Montag'})
> 
> Messages are data, not program code - keep them separate.

Message _are_ data.  They are organized in Lua tables, the msg()
function takes such a table and adds it to the respective language
(Continue reading)

Manuel Bouyer | 4 Mar 2012 14:46

Re: reworking sysinst: A Lua based msg system

On Sun, Mar 04, 2012 at 12:45:18PM +0100, Marc Balmer wrote:
> >> Message catalogs
> >>
> >> 	Messages are organized in message catalogs, one catalog per language.
> >> Once a language has been selected by the users, only that message
> >> catalog is used.  Message catalogs are Lua tables and a Lua script can
> >> add its messages by calling the msg() function:
> >>
> >> msg('english', {greeting = 'Hello', monday = 'Monday'})
> >> msg('german', {greeting = 'Guten Tag', monday = 'Montag'})
> > 
> > Messages are data, not program code - keep them separate.
> 
> Message _are_ data.  They are organized in Lua tables, the msg()
> function takes such a table and adds it to the respective language
> message catalog (stuff in {} is a Lua table).  Keep in mind that Lua was
> designed as a data description language and has a powerful syntax for that.

I guess what martin means here is that the message catalogs should not be
inside LUA scripts, but in separate files (just as they are now). Then
a module can add a new file to the already existing message table
(like msg('/path/to/module/messages.catalog')). Maybe msg() should then
try to load the message.catalog for the current language, as well as
the english one for fallback.

> 
> > 
> > How do you identify messages in your code? By index?
> 
> By index:
(Continue reading)

Martin Husemann | 4 Mar 2012 15:03
Picon

Re: reworking sysinst: A Lua based msg system

On Sun, Mar 04, 2012 at 02:46:19PM +0100, Manuel Bouyer wrote:
> I guess what martin means here is that the message catalogs should not be
> inside LUA scripts, but in separate files (just as they are now).

I don't think it should be in Lua syntax.

I don't care about most implementations details, as long as we can
make sure *at (cross) compile time* that the set is ok and complete and
we will not run into syntax erros later on some rarely tested arch in
some uncommon language.

Martin

Marc Balmer | 4 Mar 2012 15:15
Picon

Re: reworking sysinst: A Lua based msg system

Am 04.03.12 14:46, schrieb Manuel Bouyer:
> On Sun, Mar 04, 2012 at 12:45:18PM +0100, Marc Balmer wrote:
>>>> Message catalogs
>>>>
>>>> 	Messages are organized in message catalogs, one catalog per language.
>>>> Once a language has been selected by the users, only that message
>>>> catalog is used.  Message catalogs are Lua tables and a Lua script can
>>>> add its messages by calling the msg() function:
>>>>
>>>> msg('english', {greeting = 'Hello', monday = 'Monday'})
>>>> msg('german', {greeting = 'Guten Tag', monday = 'Montag'})
>>>
>>> Messages are data, not program code - keep them separate.
>>
>> Message _are_ data.  They are organized in Lua tables, the msg()
>> function takes such a table and adds it to the respective language
>> message catalog (stuff in {} is a Lua table).  Keep in mind that Lua was
>> designed as a data description language and has a powerful syntax for that.
> 
> I guess what martin means here is that the message catalogs should not be
> inside LUA scripts, but in separate files (just as they are now). Then
> a module can add a new file to the already existing message table
> (like msg('/path/to/module/messages.catalog')). Maybe msg() should then
> try to load the message.catalog for the current language, as well as
> the english one for fallback.

Ah, I see.  That is exactly what I did, I also think that the message
catalogs are best put into separate files, one per language, at least
for the default installer script.

(Continue reading)

Marc Balmer | 4 Mar 2012 15:18
Picon

Re: reworking sysinst: A Lua based msg system

Am 04.03.12 15:03, schrieb Martin Husemann:
> On Sun, Mar 04, 2012 at 02:46:19PM +0100, Manuel Bouyer wrote:
>> I guess what martin means here is that the message catalogs should not be
>> inside LUA scripts, but in separate files (just as they are now).
> 
> I don't think it should be in Lua syntax.

That's part of the design, that messages are in Lua syntax.

> I don't care about most implementations details, as long as we can
> make sure *at (cross) compile time* that the set is ok and complete and
> we will not run into syntax erros later on some rarely tested arch in
> some uncommon language.

I agree and I think that can be guaranteed when we define e.g. english
as the fallback language.  Some sort of message checker will be needed
that can be run at (cross) compile time.

Jeff Rizzo | 7 Mar 2012 00:05
Picon

Re: Sysinst support for installing source sets

On 3/3/12 8:39 AM, Andreas Gustafsson wrote:
> Julian Fagir wrote:
>> as already stated by you, this is half of the fix for PR install/9582.
>> Doing the same for pkgsrc is mostly copy&paste (I've already done that), but
>> it's not very clean.
>> To fetch pkgsrc, you cannot use the ftp directories as used before, because
>> they are rooted in the netbsd/ directory. To fetch pkgsrc, you'd have to use
>> a ../pkgsrc/ in the pathname.
>> Do you really want that? Or rather change the ftp root directory (which might
>> not be reliable)?
> I'm afraid I don't have a quick and easy answer to that question.
> That's part of the reason why I didn't add pkgsrc installation support
> myself at the same time as the src installation support.

I have some (ugly) patches which add some stuff to sysinst, pkgsrc 
install being one of them.  I haven't done anything with it in a couple 
months, because I didn't get much feedback.

http://mail-index.netbsd.org/tech-install/2012/01/23/msg000223.html  was 
the original message, and the patch is here:

http://www.tastylime.net/netbsd/sysinst.diff

+j


Gmane