On Dec 5, 2003, at 3:48 PM, B. Fongo wrote:


I went back to my books to refresh my memory on how to use references.
Your suggestion help a lot, but the subroutine returns wrong values.

It was intent upon demonstrating an idea to see how much work were we really into. The following actually sorta explains that we have a bit more work to deal with.

I did some small modifications on the codes below
, and tried it. It return perl-5.8.0-80.3.i386.rpm and samba-2.2.7-5.8.0.i386.rpm, which is wrong because:
1. The perl version available on the ftp server is higher.
2. The samba version already installed is higher than the one on the ftp server.
[..]
my @remote_packages = qw(perl-5.8.0-88.3.i386.rpm
    samba-2.2.7-5.7.0.i386.rpm bob-5.3.2.4.1.rpm xml-2.5.2.1.rpm);
my @installed_packages = qw(perl-5.8.0-80.3.i386.rpm
     samba-2.2.7-5.8.0.i386.rpm  bob-5.3.2.4.1.rpm);


Given these two lists,

Since the local host has no 'xml' it would not care about
picking up the "OS" independent version that could be installed.

At which point we are down to sorting out how to deal
with the basic naming schema that appareas to be

<pkg_nam>-<pkg_ver>-<perl_ver>.<OS>.<suffix>

which of course works for our two canonical bits,
but not for bob or xml... Bob we have and will need
to check the server - those seem to be of the form

<pkg_nam>-<pkg_ver>.<suffix>

eh no? now all we need is a Hash Of Hashes?

something that would look like say

$VAR1 = {
          'perl' => {
                      'version' => '5.8.0',
                      'full_name' => 'perl-5.8.0-88.3.i386.rpm',
                      'subversion' => '88.3'
                    },
          'xml' => {
                     'version' => '2.5.2.1',
                     'full_name' => 'xml-2.5.2.1.rpm'
                   },
          'samba' => {
                       'version' => '2.2.7',
                       'full_name' => 'samba-2.2.7-5.7.0.i386.rpm',
                       'subversion' => '5.7.0'
                     },
          'bob' => {
                     'version' => '5.3.2.4.1.1',
                     'full_name' => 'bob-5.3.2.4.1.1.rpm'
                   }
        };

cf:
<http://www.wetware.com/drieux/pbl/Sys/Admin/version_picker.txt>

ciao
drieux

---

caveat Emptor, remember in these days
of highten security having a version is
one thing, but having subversion may be
a crime...



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to