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

Re: Automated Kerberos installation ready

Maximilian Wilhelm wrote:
Am Samstag, den 17. Juli hub Jonas Smedegaard folgendes in die Tasten:

* Avoid hardcoding -x when debugging - instead use "sh -x script.sh"

That is a left over debugging option, I just forgot to delete that.

I assumed so - which is why I suggest changing your _debugging_ habbit: Instead of adding "-x" implicitly to the first line of the (ba)sh script, instead execute the file explicitly with sh -x.

(you may already understood my point, but it is not obvious from your response)

* In perl use 'system "echo" $arg' instead of 'system "echo $arg"'

I don't know perl, that was only proof of concept. :)
I know Andreas or others would find a better way.
Again: only proof of concept

Fair enough. I welcome you hacking around, BUT I recommend you to always treat execution of other scripts/binaries from within a script with extra concern: Always quote values passed on. You never know (especially when doing "proof of concept") if the value you pass on contains space, semicolon, newline or other special characters that has special meaning to the (current or passed onto) interpreter.

* Why hide common functions? Just don't make it executable

OK, that's desgin opinions.

What I mean is: You place common functions loaded other scripts in a file starting with a dot.

You may call it a design decision. I just find it odd: to my knowledge only very few files like personal configuration files are commonly hidden.

* postinst must be idempotent: Try configure twice...

That is a know bug, I were to tired to fix that.

...which brings me to another suggestion: Add "FIXME:" and "TODO:" comments in the code. FIXME for things that really needs to be fixed before releasing the code in a larger scale, and TODO for hints about future improvements or corrections that are not critical showstoppers for a release.

Such hints make it easier for yourself (and others like me) to grep through your code if you are in the mood for either releasing or hacking/improving stuff.

Again, my idea was to show that it is posibble, to do that automatically.
I do not want to win a codingstyle-record with that, I know that it
is a bad hack.

My intention was not to turn down your application for some codingstyle contest, but to help you improve your code. I was (and still am) serious about my disclaimer: Simply grab what you want from it - it is not a question of right or wrong (I believe your code to be useable!).

Please *don't* think that I in general write such style. :)

Ok, I won't :-)

 - Jonas

* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm

Reply to: