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

Re: when and why did python(-minimal) become essential?



On Sun, Jan 29, 2006 at 02:51:44PM +0100, Josselin Mouette wrote:
> Or maybe it's just there's nothing to argue about for haskell and
> scheme. Show me an administration script written in haskell or scheme,
> and we can include the language in the discussion.

Actually I would advocate to rewrite _all_ the maintainers scripts in
haskell. There are absolutly critical to the correction operation of
Debian systems and we cannot rely on so brittle a language than POSIX sh.

Actually, since haskell can be compiled to native code, we don't even need
to move any haskell packages to base.

Look how cleanly the following postrm script implement policy 6.4:

module Main where
import System
import IO
import Directory

main = getArgs >>= postrm

postrm ["remove"]                                    = exitWith ExitSuccess
postrm ["purge"]                                     = try (removeFile "/etc/foobar.conf")
postrm ["upgrade", new_version ]                     = exitWith ExitSuccess
postrm ["failed-upgrade", old_version ]              = exitWith ExitSuccess
postrm ["abort-install"]                             = exitWith ExitSuccess
postrm ["abort-install", old_version]                = exitWith ExitSuccess
postrm ["abort-upgrade", old_version]                = exitWith ExitSuccess
postrm ["disappear", overwriter, overwriter_version] = exitWith ExitSuccess

postrm bad_command_line = error ("Maintainer script called with unknown arguments"
                             ++ (foldl (\x -> \y ->x++" "++y) "" bad_command_line))

The only (very minor) drawback is that above haskell scripts when
compiled is about 7MB in size, but the huge gain in reliability
and maintainability that this would give to Debian far outweight the
extra disk usage.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here.

PS: May I be allowed to remember that perl-base was introduced mainly for the
purpose of replacing awk scripts and other awk+sed+sh mix ?



Reply to: