On 24.02.2012 10:36, Paul Harris wrote:


On 24 February 2012 17:28, Kamil Rytarowski <[email protected] <mailto:[email protected]>> wrote:

    On 24.02.2012 09:19, Martin Dietze wrote:

        On Fri, February 24, 2012, Kamil Rytarowski wrote:

            Is possible to propose a patch rewritting wm scripts (like
            wmaker.inst)
            from BASH to Perl?

        Possible? Certainly.

    OK, I will rewrite it and then we can compare.


OK. So we have three arguments against.
Not every system has Perl installed.
Do you really want to have wmaker depend on Perl ?

I can say, that not every system has BASH.

Perl v5 is long time standard and is very stable programming language, it was introduced in the middle of 90'.[1]

Perl is installable on every normal system.

It is a basesystem (or even basesystem-minimal!) of a standard Linux distribution. It's also in Puppy linux (~100 MB and place for Perl), so the additional dependency is false. For sure it's impossible to build the most minimal Linux system without Perl, it's as needed as sed (or more because sed is replaceable).

 I disagree. For simple, file system centric tasks, shell scripts
 are just the technology of choice.

I agree that it's used for simple tasks to execute things, but I disagree about 
centric tasks. It's in use o

 Just about anybody familiar
 with Unix systems can deal with Bourne shell code.

This is a false assumption. If someone can't install a system tray in WM, don't 
assumpt that this person can edit install scripts.

 >  Having taken a quick look at the current wmaker.inst code I
 think that it is fairly readable.

If we assumpt that in this random part:
FILES="$(cd "$GLOBALDEFDIR"&&  ls -d *)"
all=""
for i in $FILES; do
        if [ ! -d "$GLOBALDEFDIR/$i" ]; then
                if [ -f "$GSDIR/Defaults/$i" -a -z "$BATCH" ]; then
                        echo "The configuration file \"$i\" already exists in your 
defaults database."
                        echo "Do you wish to replace it?<y/n/a>  [n] $all"
                        if [ "$all" != "a" ]; then
                                read foo
                                if [ "$foo" = "a" -o "$foo" = "A" ]; then
                                        all="a"
                                fi
                        fi
                        if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; 
then
                                copy "$GLOBALDEFDIR/$i" "$GSDIR/Defaults/$i"
                        fi
                else
                        copy "$GLOBALDEFDIR/$i" "$GSDIR/Defaults/$i"
                fi
        fi
done

there is a bug, then it's harder to debug it then in a more modern language 
like Perl, Python etc.

 I cannot see any improvement
 that could result from rewriting it in Perl apart from
 introducing new bugs.

A bug itself isn't an improvement.

Improvement is a usage of more modern technology. Even if this may result in efforts due to switching.

But ok, if everybody is against, then I won't propose the patch. Even if it would make things cleaner and simpler.

[1] "Perl 5.000 was released on October 17, 1994."<https://en.wikipedia.org/wiki/Perl#cite_note-11> from https://en.wikipedia.org/wiki/Perl

Reply via email to