Re: Getting rid of our remaining rhpl dependencies

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

 



On Jun 3, 2008, at 11:57 AM, Jeremy Katz wrote:

On Tue, 2008-06-03 at 11:48 -1000, David Cantrell wrote:
On Jun 3, 2008, at 11:03 AM, Jeremy Katz wrote:
So rhpl has over time turned into something of a dumping ground and
we're really not using it for much any more. This probably means it's
getting close to its time to go away (much like was done with
pythonlib
before).

Left in anaconda[1] are really just a couple of uses of rhpl
* rhpl.getArch() -- We mvoed this out of iutil, we could easily move
it
back

I've never liked rhpl.getArch() and would really like to see it go
away completely.  Uses of it in anaconda sort of hide what values you
are really testing for.  When you rhpl.getArch() hands you 's390',
that really means s390 and s390x.  And so on.  I would prefer to
explicitly test os.uname().

That gets a little ugly, just due to the multitude of uname returns for
i386.  But it's definitely doable.

I'm thinking functions like:

isPPC()
isX86()
isS390()

which is more or less how we continually use rhpl.getArch() values throughout the code. Those functions (in iutil or isys probably) could be something like this:

def isPPC():
    return os.uname()[4].startswith('ppc')

def isX86():
    arch = os.uname()[4]
    if (arch.startswith('i') and arch.endswith('86')) or \
       (arch == 'athlon' or arch == 'x86_64' or arch == 'ia32e'):
        return True
    else:
        return False

def isS390():
    return os.uname()[4].startswith('s390')


Simple and to the point. I realize this is mostly like rewriting rhpl.getArch(), but I think this is more accurate as to what we are doing. These functions would perform the test for us and tell us if the system is in a platform family rather than giving us a false arch value. And we just use os.uname().

For issues that revolve around multilib
packages, could we put pressure on yum or rpm to provide a function we
can call to tell us what we should use?

There really isn't anything to speak of like this left.  If it's
specifically yummy/rpm-y, we can use the yum versions of the methods.
But we shouldn't import yum stuff outside of the yum-backend-specific
bits

Fair enough.

* rhpl.simpleConfig -- I think this might be replaceable with
python-iniparse but I haven't looked to make sure

ConfigParser? Course, I don't know what rhpl.simpleConfig is used for
anyway.

Might also work.  It's just for the simple stupid key=value sysconfig
files

I've only used ConfigParser a few times, but the key=value format seems to be what it does.

--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux