Ñò ‚lTc@s)ddkZddkZddkZddklZlZdZedZeidƒZ de fd„ƒYZ de fd „ƒYZ d e fd „ƒYZ d e fd „ƒYZdefd„ƒYZdefd„ƒYZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZdS(iÿÿÿÿN(tVersiont VersionErrort_PREt_sB^[A-Za-z0-9][A-Za-z0-9_\-\.\+]*(/[A-Za-z0-9][A-Za-z0-9_\-\.\+]*)*$t FmriErrorcBs eZdZd„Zd„ZRS(s%Base exception class for FMRI errors.cCsti|ƒ||_dS(N(t Exceptiont__init__tfmri(tselfR((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR4s cCs t|ƒS(N(tstr(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt __unicode__8s(t__name__t __module__t__doc__RR (((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR1s t IllegalFmricBs8eZdZdZdZdZddd„Zd„ZRS(iiis Illegal FMRIcCs/ti||ƒ||_||_||_dS(N(RRtreasontdetailt nested_exc(RRRRR((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRGs  cCsd|i|if}|itijo|t|iƒS|itijo|d|iS|iti jo ||iSdS(Ns %s '%s': sInvalid Package Name: ( t msg_prefixRRRt BAD_VERSIONR RtBAD_PACKAGENAMERt SYNTAX_ERROR(Rtoutstr((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt__str__MsN( R R RRRRtNoneRR(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR?s tIllegalMatchingFmricBseZdZRS(sIllegal matching pattern(R R R(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRWstMissingVersionErrorcBseZdZd„ZRS(syUsed to indicate that the requested operation is not supported for the fmri since version information is missing.cCstdƒ|iS(Ns)FMRI '%s' is missing version information.(RR(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR_s (R R R R(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR[stPkgFmricBsšeZdZeZdddddgZd'd'd'd'd'd„Zed'd„ƒZ ed'd„ƒZ d „Z ed „ƒZ d „Z ed „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zeed„Zd'eed„Zd'eed„Zd„Zd„Zd„Z d„Z!d„Z"ed„Z#ed „Z$d!„Z%d"„Z&d#„Z'd$„Z(d%„Z)d&„Z*RS((s”The publisher is the anchor of a package namespace. Clients can choose to take packages from multiple publishers, and specify a default search path. In general, package names may also be prefixed by a domain name, reverse domain name, or a stock symbol to avoid conflict. The unprefixed namespace is expected to be managed by architectural review. The primary equivalence relationship assumes that packages of the same package name are forwards compatible across all versions of that package, and that higher build release versions are superior publications than lower build release versions.tversiont publishertpkg_namet_hasht __weakref__c Cs|dj oÏ|iƒ}ti|ƒ\}}}|djo|||d!}n|djob|||!|_yt||d|ƒ|_WqØtj o!} t|ti d| ƒ‚qØXq |||_d|_n0||_|ot||ƒ|_n d|_|o ||_ n d|_ |ipt|ti ddƒ‚n|i i |iƒpt|tid|iƒ‚nd|_dS(NiRRsMissing package name(RtrstripRt_gen_fmri_indexesRRRRRRRRtvalid_pkg_nametmatchRR( RRt build_releaseRtnameRtveridxtnameidxtpubidxtiv((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRus<             cCs t|ƒS(sReturns the serialized state of this object in a format that that can be easily stored using JSON, pickle, etc.(R (tobjtje_state((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytgetstate§scCs t|ƒS(s`Allocate a new object using previously serialized state obtained via getstate().(R(tstatetjd_state((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt fromstate­scCstt|ƒƒS(N(RR (R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytcopy³scCsC|idƒ}|djo d}nd}|idƒoX|idd|ƒ}|djo"t|tidtdƒƒ‚nd}|d7}n£|id ƒo d }n‰|id ƒoX|idd |ƒ}|djo"t|tidtdƒƒ‚nd }|d7}n!|idƒo d}nd }|||fS(s\Return a tuple of offsets, used to extract different components of the FMRI.t@iÿÿÿÿspkg://t/iRs Missing '/' after publisher nameispkg:/is//iiN(trfindRt startswithtfindRRR(RR'R)R(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR"¶s4        cCsR|ioA|iitƒo.|iiddƒ}|t|ƒd}|S|iS(sReturn the name of the publisher that is contained within this FMRI. This strips off extraneous data that may be attached to the publisher. The output is suitable as a key into the publisher["prefix"] table.Ri(RR5t PREF_PUB_PFXtrsplittlen(Rtrta((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_publisheræs cCs<|o(|itƒ odt|f|_n ||_dS(scSet the FMRI's publisher. If this is a preferred publisher, set preferred to True.s%s_%sN(R5R7R(RRt preferred((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt set_publisherõscCs d|_|S(N(RR(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytremove_publisherþs cCs|iotStS(s)Returns true if the FMRI has a publisher.(RtTruetFalse(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt has_publishers cCs|iotStS(s&Returns True if the FMRI has a version(RR@RA(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt has_version s cCs'|i p|iitƒotStS(sQReturns true if this FMRI's publisher is the preferred publisher.(RR5R7R@RA(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytpreferred_publishers cCs|iS(säReturn the bare string that specifies everything about the publisher. This should only be used by code that must write out (or restore) the complete publisher information to disk.(R(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytget_publisher_strscCs|iS(N(R(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytget_name"scCs||_d|_dS(N(RRR(RR&((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytset_name%s cCs|ii|ƒd|_dS(N(Rt set_timestampRR(Rtnew_ts((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRH)scCs |iiƒS(N(Rt get_timestamp(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRJ-scCs |iiƒS(N(Rtget_short_version(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_version0scCsvd}|i p|iitƒp|o#|o d}nd||ifS|o d}nd||i|ifS(s…Return a string representation of the FMRI without a specific version. Anarchy returns a stem without any publisher.tspkg:/s%s%sspkg://s%s%s/%s(RR5R7R(Rtanarchytinclude_schemetpkg_str((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_pkg_stem3s   cCsºd}|i}|p |}n|idjo d}nd|iiƒ}| p|itƒp|o&|o d}nd||i|fS|o d}nd|||i|fS(sVReturn a string representation of the FMRI without a specific version.RMR2spkg:/s%s%s%sspkg://s %s%s/%s%sN(RRRRKR5R7R(Rtdefault_publisherRNRORPRR((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytget_short_fmri@s      cCsàd}|i}|djo |}n| p|itƒp|oK|o d}n|idjod||ifSd||i|ifS|o d}n|idjod|||ifSd|||i|ifS( skReturn a string representation of the FMRI. Anarchy returns a string without any publisher.RMspkg:/s%s%ss%s%s@%sspkg://s%s%s/%ss %s%s/%s@%sN(RRR5R7RR(RRRRNRORPR((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytget_fmriYs$       cCsV|iidƒ}|d}x3t|d ƒD]!}|id||dfƒq-W|S(sdGenerate the different hierarchical names that could be used to reference this fmri.R3iÿÿÿÿs%s/%s(Rtsplittreversedtappend(Rtnamestrestn((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pythierarchical_namests  cCs |iƒS(s6Return as specific an FMRI representation as possible.(RT(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyR~scCs“|ip5|ipd|i}qd|i|if}nA|ipd|i|if}nd|i|i|if}d|t|ƒfS(s6Return as specific an FMRI representation as possible.spkg:/%ss pkg:/%s@%ss pkg://%s/%sspkg://%s/%s@%ss(RRRtid(Rtfmristr((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt__repr__‚s      cCsA|i}|djo't|iƒt|iƒ}|_n|S(N(RRthashRR(Rth((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt__hash__“s  'cCs‚|pdSt|tƒpdSt|i|iƒ}|djo|St|i|iƒ}|djo|St|i|iƒS(Niiÿÿÿÿi(t isinstanceRtcmpRRR(Rtothertc((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt__cmp__Ÿs  cCsq|odti|idƒS|idjot|ƒ‚ndti|idƒtit|iƒdƒfS(sNReturn the escaped link (or file) path fragment for this FMRI.s%sRMs%s@%sN(turllibtquoteRRRRR (Rtstemonly((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_link_path³s cCsq|odti|idƒS|idjot|ƒ‚ndti|idƒti|iiƒdƒfS(s9Return the escaped directory path fragment for this FMRI.s%sRMs%s/%sN(RgRhRRRRR(RRi((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_dir_pathÀs cCsR|idjot|ƒ‚ndti|idƒti|iiƒdƒfS(seReturn the escaped URL path fragment for this FMRI. Requires a version to be defined.s%s@%sRMN(RRRRgRhRR(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt get_url_pathÌscCs|i|ijS(shReturn true if these packages are the same (although potentially of different versions.)(R(RRd((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt is_same_pkgÖscCs|iƒ|i|ifS(N(RERR(R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyttupleÛscCsti||iƒ}|djS(scTrue if the regular expression given in fmristr matches the stem of this pkg: FMRI.N(treR$RR(RR]tm((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt is_name_matchÞscCs|i|ijS(sPTrue if package names match exactly. Not a pattern-based query.(R(RRd((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt is_similaräscCs4|i|ijotS|i|ijotStS(s returns True if self >= other (RRARR@(RRd((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt is_successorés N(+R R R tg_valid_pkg_nameR#t __slots__RRt staticmethodR-R0R1R"R<RAR>R?RBRCRDRERFRGRHRJRLR@RQRSRTR[RR^RaRfRjRkRlRmRnRqRrRs(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRdsR  1 0                    tMatchingPkgFmricBs&eZdZeidƒZd„ZRS(s A subclass of PkgFmri with (much) weaker rules about package names. This is intended to accept user input with globbing characters. s^[A-Za-z0-9_/\-\.\+\*\?]*$cOsZyti|||ŽWn<tj o0}t|i|id|id|iƒ‚nXdS(NRR(RRRRRRRR(Rtargstkwargste((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRûs (R R R RotcompileR#R(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyRwöscCsd|id|ƒS(s;Returns true if 'pattern' is a proper subset of 'pkg_name'.R3(tendswith(Rtpattern((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt fmri_matchscCsti||ƒS(N(tfnmatcht fnmatchcase(RR}((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt glob_matchscCsti||ƒS(sNReturns true if 'pattern' is a regular expression matching 'pkg_name'.(Rotsearch(RR}((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt regex_match scCs ||jS(s5Returns true if 'pattern' matches 'pkg_name' exactly.((RR}((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytexact_name_matchscCsJ|iƒ}ti|ƒ\}}}|o|||!}n ||}|S(sjGiven a string that can be converted to a FMRI. Return the substring that is the FMRI's pkg_name.(R!RR"(RR'R(R)R((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytextract_pkg_names   cCs.|itƒo|ttƒ}n|}|S(s*Strip the PREF_PUB_PFX off of a publisher.(R5t PREF_PUB_PFX_R9(tpubR((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyt strip_pub_pfx!scCs||jotS|djo d}n|djo d}nt||jp|t|jotS|itƒo|itƒotStS(sWCompare two publishers. Return true if they are the same, false otherwise. RMN(R@RR†R5RA(tpub1tpub2((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytis_same_publisher+s     cCs ti|ƒS(N(RtR$(R&((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pytis_valid_pkg_nameFs(RRoRgRRRR7R†R{RtRRRRRtobjectRRwR~RRƒR„R…RˆR‹RŒ(((s./usr/lib/python2.6/vendor-packages/pkg/fmri.pyts*     ÿ“