ó >ìˆUc@sœddlZyddlZeZWnek r;eZnXddlmZej Z dZ eddkrªddgZ ddgZ d d gZd d gZd dgZnüeddkrùddgZ ddgZ d dgZd dgZd dgZn­eddkr9dgZ dgZ d gZd gZdgZnmeddkrydgZ dgZ dgZdgZdgZn-dgZ dgZ d gZd gZd gZdZdZdZdZdZeddkrçiej d6Zn3iej d6ejd6ZerejjedÑsccs!|]}|jddƒVqdS(RRN(R (R R ((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pys Ýsccs!|]}|jddƒVqdS(Rs chain.chashesN(R (R R ((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pys ßscCsè|tkr*|rt}nt}t}n´|tkrT|rEt}nt}t}nŠ|tkr~|rot }nt }t }n`|t kr¨|r™t }nt}t}n6|tkrÒ|rÃt}nt}t}n d}d}||fS(sƒBased on the 'hash_type', return a tuple describing the ranking of hash attributes from "most preferred" to "least preferred" and a mapping of those attributes to the hash algorithms that are used to compute those attributes. If 'reverse' is true, return the rank_tuple in reverse order, from least preferred hash to most preferred hash. N(tHASHtREVERSE_RANKED_HASH_ATTRStRANKED_HASH_ATTRSt HASH_ALGStCHASHtREVERSE_RANKED_CHASH_ATTRStRANKED_CHASH_ATTRSt CHASH_ALGSt CONTENT_HASHt!REVERSE_RANKED_CONTENT_HASH_ATTRStRANKED_CONTENT_HASH_ATTRStCONTENT_HASH_ALGStCHAINtREVERSE_RANKED_CHAIN_ATTRStRANKED_CHAIN_ATTRSt CHAIN_ALGSt CHAIN_CHASHt REVERSE_RANKED_CHAIN_CHASH_ATTRStRANKED_CHAIN_CHASH_ATTRStCHAIN_CHASH_ALGStNone(t hash_typetreverset rank_tuplethash_dic((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pyt_get_hash_dicsïs8               cCsët|ƒ\}}|o|s1td|ƒ‚nx5|D]-}||jkr8||j|||fSq8W|tkrˆd|jtjfS|tkr¡ddt fS|t kr±dS|t krÁdS|t krÑdSt d||fƒ‚dS(sIReturns a tuple of the form (hash_attr, hash_val, hash_func) where 'hash_attr' is the preferred hash attribute name, 'hash_val' is the the preferred hash value, and 'hash_func' is the function used to compute the preferred hash based on the available pkg.*hash.* attributes declared in the action.s1Unknown hash_type %s passed to get_preferred_hashs.Error determining the preferred hash for %s %sN(NNN(NNN(NNN(R%t ValueErrortattrsR R RthashlibRRtDEFAULT_HASH_FUNCRRRt Exception(tactionR!R#R$thash_attr_name((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pytget_preferred_hashs(          cCs%|tkrD|s"ddtjfSdtkrDd|jtjfSnt|dtƒ\}}|oe|s{td|ƒ‚n|sš|dd||dfSx5|D]-}||j kr¡||j |||fSq¡W|t krëddt fS|t krûdS|t kr dStd||fƒ‚dS( sReturns a tuple of the least preferred hash attribute name, the hash value that should result when we compute the hash, and the function used to compute the hash based on the available hash and pkg.*hash.* attributes declared in the action.RR"s1Unknown hash_type %s passed to get_preferred_hashis4Error determining the least preferred hash for %s %sN(NNN(NNN(R R R(RtDEFAULT_HASH_ATTRSRR%tTrueR&R'RR)RRR*(R+R!t rank_listR$R,((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pytget_least_preferred_hashEs.          cCsÖ|s dSt|ƒ\}}|o%|s;td|ƒ‚nt|jjƒƒjt|jjƒƒƒ}x<|D]4}||kro||j||j|||fSqoW|jrÒ|jrÒd|j|jtj fSdS(s)Returns the best common hash attribute of those shared between a new action and an installed (old) version of that action. We return the name of the common attribute, the new and original values of that attribute, and the function used to compute the hash. If no common attribute is found, we fallback to the legacy .hash member assuming it is not None for the new and orig actions, and specify hashlib.sha1 as the algorithm. If no 'hash' member is set, we return a tuple of None objects.s8Unknown hash_type %s passed to get_preferred_common_hashN(NNNN(NNNN( R R%R&tsetR'tkeyst intersectionRR(R(R+t old_actionR!R0R$t common_attrsR,((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pytget_common_preferred_hashrs   *    (spkg.hash.sha512_256(spkg.hash.sha256(spkg.hash.sha256shash(spkg.hash.sha512_256(1R(t pkg.sha512_ttpkgR/tsha512_supportedt ImportErrortFalsetpkg.client.debugvaluesRRR)tDEFAULT_HASH_NAMER.tDEFAULT_CHASH_ATTRStDEFAULT_CONTENT_HASH_ATTRStDEFAULT_CHAIN_ATTRStDEFAULT_CHAIN_CHASH_ATTRSR RRRRRRtsha512_ttSHA512_tRR R RRRRttupleRt_content_hash_attrstappendRRRR RRRRR%R-R1R7(((s0/usr/lib/python2.7/vendor-packages/pkg/digest.pytsÆ                                     !                   / ' -