v_c@sddlZddlZddlZddlZeZidHd6dId6dJd6dKd 6dLd 6ZerrdMed Zd?Zd@ZdAZd2dBZeZedCZddDZddEZdFefdGYZdS(NiNtathlontx86_64tsparcv9vtsparc64vtsparcv9tsparc64tppctppc64ts390ts390xti686ti586tgeodeti486ti386tnoarchtamd64tia32etppc64letppc64p7t ppc64pseriest ppc64iseriestsparcv8tsparct alphaev68talphaev7t alphaev67talphaev6t alphapca56t alphaev56talphaev5t alphaev45talphaev4talphatarmv6ltarmv7lt armv5tejltarmv5teltarmv7hltarmv7hnltarm64taarch64tsh4tsh4atsh3tia64ttplatformithwcapcCst|}t|r*td|}n|g}|dksN|jdrx9tjD](\}}||kr[|j|q[q[Wn|S(NtmyarchRRR(RR(t getBestArchtisMultiLibArcht getBaseArcht startswithtarchestitemstappend(tarchtresultstktv((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pytlegitMultiArchesInSameLibes    cCsdd||gkrtStd|td|kr8tS|t|ks\|t|kr`tStS(sbTake two arches and return True if it is possible that they can be installed together with the same nevr. Ex: arch1=i386 and arch2=i686 then it will return False. arch1=i386 and arch2=x86_64 will return True. It does not determine whether or not the arches make any sense. Just whether they could possibly install w/o conflictRR9(tFalseR3t getArchListtTrue(tarch1tarch2((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyt canCoinstallvs $cCsK||krdS|tkrGtt||}|dkrC|dSdSdS(Nii(R6tarchDifference(R1t targetarchtret((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyRDs   cCs tt|S(N(RDt canonArch(R9((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pytscorescCsM|dkrt}n|tkr%dS|tkr5dSt|tkrIdSdS(s5returns true if arch is a multilib arch, false if notiiN(tNoneRGR6tmultilibArches(R9((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyR3s    c CsRt|dkrdS|dkr+t}nt|}t|}||kr}t||}|dkr}|dkr}|Sn|d}x|dD]}t||}t||}|dkr|dkrqn||kr|dkr|}qn||kr|dkr|}qn||krqqWt||} | dkrNdS|S(s return the best arch from the list for myarch if - myarch is not given, then return the best arch from the list for the canonArch. iRiN(tlenRIRGR2tgetBestArchFromListRD( tarchlistR1t mybestarchtbestarchtbestarchchoicetthisarchR9tval1tval2tval((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyRLs8              cCs|st}n|g}x'|tkrAt|}|j|qW|ddkre|jddnt|dkr|d|kr|jdn|S(NiRiRR(RGR6R8tinsertRK(RQRM((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyR?s   "cCs ytddSWngSXdS(sY Try to read /proc/cpuinfo ... if we can't ignore errors (ie. proc not mounted). s /proc/cpuinfotrN(topen(((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyt_try_read_cpuinfoscCsytddj}WndSXd}d}tjd}d}tj}x}|t||krtjd||\}}||kr||_|jt dtmultilibt setup_arch(tself((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyt__init__s      cCs|r||_n t|_td|j|_td|j|_|sg}x9|jD].}t|sy|dkr[|j|q[q[W||_ntd|j|_ t d|j|_ td|j|_ t d|j|_dS(NR1RQRR9(RRGR4RR?RMR3R8R2RORRRR=tlegit_multi_arches(RR9tarchlist_includes_compat_archtlimit_archlistta((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyRs   cCs"|s|j}nt|d|S(NR1(RRL(RRMtfromarch((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pytget_best_arch_from_lists cCst|j|S(N(RDR(RR9((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyRHscCs|s |jStd|S(NRQ(RMR?(RR9((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyt get_arch_listsN( t__name__t __module__t__doc__RRIR@RRRHR(((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyRs    (sathlonsx86_64sathlon(ssparcv9vssparcv9vssparc64v(ssparcv9ssparcv9ssparc64(sppcsppcsppc64(RR R(sppcsppc64sppc64(RRsR^R\R@RRJR6RbRIR=RCRDRHR3RLR?RXRjRqRvRRRRRGRR2R4tobjectR(((s1/usr/lib/python2.7/site-packages/rpmUtils/arch.pyts              ,            (