Gentoo Archives: gentoo-genkernel

From: "Amadeusz Żołnowski" <aidecoe@g.o>
To: Sebastian Pipping <sping@g.o>
Cc: gentoo-genkernel@l.g.o
Subject: [gentoo-genkernel] Re: [RFC] Genkernel4 and Geninitramfs plan
Date: Mon, 24 Sep 2012 20:07:40
Message-Id: 20120924200726.5551.8631@localhost
In Reply to: Re: [gentoo-genkernel] Re: [RFC] Genkernel4 and Geninitramfs plan by "Amadeusz Żołnowski"
1 Quoting Amadeusz Żołnowski (2012-09-10 14:59:42)
2 > > > I am suggesting appropiate tool for this task. Please explain me
3 > > > with real arguments how Python would be better than Bash4. I have
4 > > > mentioned altering boot manager configuration and parsing
5 > > > kernel.org already, but that still doesn't promote Python for the
6 > > > whole Genkernel.
7 > >
8 > > I have given the real arguments already; there are honestly no
9 > > hidden real ones. I use Bash and Python at work daily, so I know
10 > > what Bash is good at and what it isn't.
11 >
12 > Me too.
13 >
14 >
15 > > Let's take argument parsing as an example actually again), since you
16 > > don't get around that one. How are you going to do that in Bash,
17 > > cleanly? Using getopt(1)? Using a big case statement with
18 > > extracting "foo" from "--param=foo"?
19 >
20 > In Python it would be a big block of "parser.add_argument()" calls.
21 > This is not so much big difference from case..esac, despite that ootb
22 > it would require separate maintenance of usage help, but I have a
23 > solution for that, too.
24 >
25 >
26 > > In current genkernel that's a mess because it is Bash and not
27 > > Python.
28 >
29 > In current Genkernel it is a mess not because of Bash but because of
30 > design. In Dracut options are handled better and I have some idea how
31 > do it even better. For handling options Python/Awk could be used in
32 > some way. I'd like to implement options generator which will
33 > automatically generate usage help, man page, example config file and
34 > bash case..esac with options from a nice *single* template.
35 >
36 > Options handling is not the core functionality and shouldn't be a main
37 > argument in decision on language choice. Genkernel core functionality
38 > is about coping with shell commands and for that Bash4 is the best.
39
40
41 I haven't got any further reply. Do you agree with me?
42
43 I'd start with a tool which will generate usage help, man page, example
44 config file and bash case..esac option handler from a nice single
45 template. Next I'll proceed with Genkernel4/5.
46
47
48 --
49 Amadeusz Żołnowski

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-genkernel] Re: [RFC] Genkernel4 and Geninitramfs plan Sebastian Pipping <sping@g.o>