perl_checker cleanups, mainly spaces after coma/before parenthesis and:
{'foobar'} can be written {foobar}
kill %done, it was misused and thus useless

it should have been either "next if ($done{$1}++);"
or "next if ($done{$1.$2}++);

anyway if it had worked, it would have made any sense since we could
have ignored foobar-2-3 if we see foobar-2-1 first...

(spot by perl_checker)
ignore duplicate packages at this point

we can have duplicate packages on x86_64 if 32bit media are enabled (which
they are on both Magieia & Mandriva) where noarch packages are
duplicated between 64bit & 32bit media

(spot by perl_checker)
Mandrake brand has been outlawed in 2004

this prompted MandrakeSoft to become Mandriva which was later forked by Mageia
the function doesn't take any parameters, use the empty prototype

(spot by perl_checker)
missing ";"
use local variables for file handles

this fix several warnings in perl_checker:
use a scalar instead of a bareword (eg: occurrences of CMD with $CMD)
undeclared variable *CMD

as a side effect it means files are automatically closed when
returning from their scope (functions) or when there's an exception
before the close (which was not true before)
reduce perl_checker SNR by putting "{" right after sub declarations

fix the following warnings:
you should not have a carriage-return (\n) here
make block boundaries easier to see
properly indent...
declare local variables with "my" instead of "local"

for all purpose, it's better to declare local variables with "my"
instead of "local", the latter being actually less local.
eg: g() will see different $i variables in the two calls here:
first the global variable, then the local variable of f():

my $i = 1;
sub f () {
    local $i =2;
    g();
}
sub g {
    print "i=$i\n";
}
f()
g();
there's no reason to limit (& to hardcode) media list

this broke webmin on Mageia and on future Mandriva Server
(update_system_resolve) simplify

common, this is perl, not C...
update comment
fix "undeclared variable $_"

(spot by perl_checker)
install right packages on both Mageia & Mandriva

- enable to distinct Mageia from Mandriva
- select proper package names depending on the actual distribution
kill unused variable

(spot by perl_checker)
this is perl, not C...
add a FIXME note (parsing urpmi output is plain broken)

first urpmi may not print the " from" sub string

secondly, when called with multiple packages names or with one name that
requires installing other packages, urpmi will print all packages names
after "installing ", not just one package name.
eg:

$ urpmi --auto --force null
installing /mageia/x86_64/media/nonfree/release/null-9-17.mga3.nonfree.x86_64.rpm
/mageia/x86_64/media/core/release/tcsh-6.18.01-1.mga2.x86_64.rpm
Preparing...                     #############################################
      1/2: tcsh                  #############################################
      2/2: null                  #############################################
$ urpme tcsh null
$ urpmi.update --ignore 'Nonfree Release'
$ urpmi --auto --force null
installing null-9-16.mga3.x86_64.rpm tcsh-6.18.01-1.mga2.x86_64.rpm from /mageia/x86_64/media/core/release
Preparing...                     #############################################
      1/2: tcsh                  #############################################
      2/2: null                  #############################################

What's more callers are buggy since they assume everything wen fine if
at least one package succeeded to be installed but urpmi could install
most packages but one (I/O error, bad package trying to replace a
symlink by a directory, ...)
see package_install() call in package-updates/update.cgi

we could test for urpmi return value and just return the package name we
were called with...