Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/package/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/package/skeleton.pyc

ó
ÍÿŠTc@sÔddlmZddlZdZdZdZdZdZdeBZdeBZ	deBZ
deBZdeBZdeBZ
deBZdefd
„ƒYZdefd„ƒYZd„Zdd„Zeed„ZdS(iÿÿÿÿ(tsha1NiiiiiiiiitPackageTypeErrorcBseZdZRS(sDRaised when an unsupported package type is passed to build_skeleton.(t__name__t
__module__t__doc__(((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pyRstPackageSkeletoncBsPeZdZdZdZdZdZdZd„Z	d„Z
d„Zd„ZRS(cCs(||_||_||_g|_dS(N(ttypetnametversiont	relations(tselfRRR((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pyt__init__"s			cCs|jj||fƒdS(N(R	tappend(R
Rtinfo((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytadd_relation(scCst|jdk	r|jStd|j|j|jfƒ}|jjƒx"|jD]}|jd|ƒqOW|j	ƒS(sšCalculate the package hash.

        If C{set_hash} has been used, that hash will be returned and the
        hash won't be the calculated value.
        s
[%d %s %s]s[%d %s]N(
t_hashtNoneRRRRR	tsorttupdatetdigest(R
Rtpair((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytget_hash+s"
cCs
||_dS(sZSet the hash to an explicit value.

        This should be used when the hash is previously known and can't
        be calculated from the relations anymore.

        The only use case for this is package resurrection. We're
        planning on getting rid of package resurrection, and this code
        can be removed when that is done.
        N(R(R
tpackage_hash((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytset_hash9s
N(
RRRtsectiontsummarytdescriptiontsizetinstalled_sizeRRRRR(((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pyRs			cCs6|\}}}|}|r2|d||f7}n|S(sConvert an apt relation to a string representation.

    @param relation_tuple: A tuple, (name, version, relation). version
        and relation can be the empty string, if the relation is on a
        name only.

    Returns something like "name > 1.0"
    s %s %s((trelation_tupleRRt
relation_typetrelation_string((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytrelation_to_stringGs
	cCs›tƒ}tj|j|dƒƒ}xp|D]h}g|D]}t|ƒ^q8}|}	t|ƒdkrq|}	ndj|ƒ}
|j|	|
fƒq+W|S(s¬Parse an apt C{Record} field and return skeleton relations

    @param record: An C{apt.package.Record} instance with package information.
    @param record_field: The name of the record field to parse.
    @param relation_type: The deb relation that can be passed to
        C{skeleton.add_relation()}
    @param or_relation_type: The deb relation that should be used if
        there is more than one value in a relation.
    tis | (tsettapt_pkgt
parse_dependstgetR tlentjointadd(trecordtrecord_fieldRtor_relation_typeR	tvaluestvaluetrelationt
value_stringstvalue_relation_typeR((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytparse_record_fieldWs	
	cCsã|jj|j}}|r8t|ƒt|ƒ}}ntt||ƒ}tƒ}|jt|j	dt
ƒƒ|jtd|jj|jffƒ|jt|j	dt
tƒƒ|jt|j	dt
tƒƒ|jtd|jj|jffƒ|jt|j	dtƒƒ|jt|j	dtƒƒt|ƒ|_|rß|j|_|j|_|j|_|j|_|jdkr”|j|_n|rß|jjd	ƒ|_|jjd	ƒ|_|jjd	ƒ|_qßn|S(
sSBuild a package skeleton from an apt package.

    @param version: An instance of C{apt.package.Version}
    @param with_info: Whether to extract extra information about the
        package, like description, summary, size.
    @param with_unicode: Whether the C{name} and C{version} of the
        skeleton should be unicode strings.
    tProvidess%s = %ssPre-DependstDependss%s < %st	ConflictstBreaksisutf-8(tpackageRRtunicodeRtDEB_PACKAGER"RR1R)tDEB_PROVIDESR(tDEB_NAME_PROVIDEStDEB_REQUIREStDEB_OR_REQUIREStDEB_UPGRADESt
DEB_CONFLICTStsortedR	RRRRRtdecode(Rt	with_infotwith_unicodeRtversion_stringtskeletonR	((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pytbuild_skeleton_aptnsB					 		iiiiiiiiiiii(tlandscape.lib.hashlibRR#tPACKAGEtPROVIDEStREQUIREStUPGRADESt	CONFLICTSR8R9R:R;R<R=R>t	ExceptionRtobjectRR RR1tFalseRE(((s>/usr/lib/python2.7/dist-packages/landscape/package/skeleton.pyt<module>s$






.