[Yum] arch lists

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

 



--=-QwVbDud6jJw7rtm8oMqi
Content-Type: multipart/mixed; boundary="=-PRiiuTY883+Eor6K5cp1"


--=-PRiiuTY883+Eor6K5cp1
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,
 I wrote the attached.

It outputs the base + archs.

Some interesting results, but they don't appear to be incorrect.

Looking for some assistance on verification b/c I don't know all of the
archs.

The output I got was:
Base - alpha : axp noarch alphaev5 alphaev56 alphapca56 alphaev6 alphaev67=20
Base - i386 : noarch i486 osfmach3_i386 osfmach3_i486 i586 osfmach3_i586 i6=
86 osfmach3_i486 osfmach3_i686 osfmach3_i586=20
Base - rs6000 : noarch ppc ppc64 ppciseries powerppc powerpc ppcpseries osf=
mach3_ppc=20
Base - sparc : noarch sun4c sun4m sparcv9 sun4d sparc64 sun4u=20
Base - mips : noarch=20
Base - mipsel : noarch=20
Base - parisc : noarch hppa1.0 hppa1.1 hppa1.2 hppa2.0=20
Base - armv4b : noarch=20
Base - armv3l : noarch armv4l=20
Base - atarist : m68kmint noarch=20
Base - atariste : m68kmint noarch=20
Base - ataritt : m68kmint noarch=20
Base - falcon : m68kmint noarch=20
Base - atariclone : m68kmint noarch=20
Base - milan : m68kmint noarch=20
Base - hades : m68kmint noarch=20
Base - i370 : noarch=20
Base - s390 : noarch=20
Base - s390x : s390 noarch=20
Base - ia64 : i686 noarch osfmach3_i686 athlon=20
Base - x86_64 : noarch=20


thanks
-sv


--=-PRiiuTY883+Eor6K5cp1
Content-Disposition: attachment; filename=test.py
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-python; name=test.py; charset=ISO-8859-1



#create a second list which is corrected entries
#change the entry in the corrected entry to point to their basearch
#gist
# if they don't include noarch OR aren't in this list, then check the archs=
[key] for
# their value and place their value in there if it is noarch or wherever th=
eir
# value points to


import re
import time
import sys

file =3D '/usr/lib/rpm/rpmrc'
basearchs =3D []
archlines =3D []
archs =3D {}
finished =3D {}

fd =3D open(file)
lines =3D fd.readlines()
fd.close()

archre =3D re.compile('\Aarch\_compat\:.*')
basere =3D re.compile('.*noarch\n*\Z')
wsre =3D re.compile('\A\s|\s\Z')

for line in lines:
    if archre.match(line):
        line =3D re.sub('\n','', line)
        archlines.append(line)
        (junk, arch, fallthrough) =3D re.split(':',line)
        arch =3D wsre.sub('', arch)
        if not archs.has_key(arch):
            archs[arch]=3D[]
        fallthrough =3D wsre.sub('', fallthrough)
        subarchs =3D []
        subarchs =3D re.split(' ', fallthrough)
        for subarch in subarchs:
            subarch =3D wsre.sub('', subarch)
            archs[arch].append(subarch)
        if basere.match(line):
            basearchs.append(arch)

print len(basearchs)
print len(archs.keys())
while len(finished.keys()) !=3D len(archs.keys()):
#    print len(finished.keys())
#    print finished
#    print archs
    for arch in basearchs:
        if not finished.has_key(arch):
            finished[arch] =3D []
        for included in archs[arch]:
            if included not in finished[arch]:
#                print 'going in to %s - %s ' % (arch, included)
                finished[arch].append(included)
    for arch in archs.keys():
        if arch not in basearchs:
#            print arch
            for included in archs[arch]:
                if included in basearchs:
                    finished[included].append(arch)
                    archs[arch].remove(included)
                else:
                    for key in basearchs:
                        if included in finished[key]:
                            finished[key].append(arch)
                            archs[arch].remove(included)
                if len(archs[arch]) =3D=3D 0:
                    finished[arch]=3D[]
    #time.sleep(3)

for arch in basearchs:
    print 'Base - %s :' % (arch),
    for include in finished[arch]:
        print include,
    print ""   =20
       =20
   =20

--=-PRiiuTY883+Eor6K5cp1--

--=-QwVbDud6jJw7rtm8oMqi
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+U/0I1Aj3x2mIbMcRAoZ4AJ0WEPPKt/kws44ndPngCoNT4yJ/JgCcC+Vm
ZC/cqTulpoBskeaxNIVO9+o=
=Ok/o
-----END PGP SIGNATURE-----

--=-QwVbDud6jJw7rtm8oMqi--



[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux