Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/debian/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/debian/debfile.pyc


}Nc@s\ddlZddlZddlmZmZddlmZddlmZdZ	dZ
ddd	gad
Zddd
ddgZ
dZdZdZdZdefdYZdefdYZdefdYZdefdYZdefdYZedkrXddlZedejd ZejjZejdGHndS(!iN(tArFiletArError(t	Changelog(tDeb822sdata.tarscontrol.tartgztbz2tlzmas
debian-binarytpreinsttpostinsttprermtpostrmtconfigtcontrolsusr/share/doc/%s/changelog.gzs$usr/share/doc/%s/changelog.Debian.gztmd5sumstDebErrorcBseZRS((t__name__t
__module__(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR%stDebPartcBsneZdZdZdZedZdZdZdZ	dZ
dZd	Zd
Z
RS(sW'Part' of a .deb binary package.
    
    A .deb package is considered as made of 2 parts: a 'data' part
    (corresponding to the 'data.tar.gz' archive embedded in a .deb) and a
    'control' part (the 'control.tar.gz' archive). Each of them is represented
    by an instance of this class. Each archive should be a compressed tar
    archive; supported compression formats are: .tar.gz, .tar.bz2 .

    When referring to file members of the underlying .tar.gz archive, file
    names can be specified in one of 3 formats "file", "./file", "/file". In
    all cases the file is considered relative to the root of the archive. For
    the control part the preferred mechanism is the first one (as in
    deb.control.get_content('control') ); for the data part the preferred
    mechanism is the third one (as in deb.data.get_file('/etc/vim/vimrc') ).
    cCs||_d|_dS(N(t_DebPart__membertNonet
_DebPart__tgz(tselftmember((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__init__:s	cCs|jdkr|jj}|jdrctjd|jdd}tjd|dd|_q|jdrtj	d|jdd|_qt
d|n|jS(	sReturn a TarFile object corresponding to this part of a .deb
        package.
        
        Despite the name, this method gives access to various kind of
        compressed tar archives, not only gzipped ones.
        s.gztfileobjtmodetrs.bz2sr:bz2s"part '%s' has unexpected extensionN(RRRtnametendswithtgziptGzipFilettarfiletTarFiletopenR(RRR((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyttgz>s!cCs<|jdr|d}n|jdr8|d}n|S(sw try (not so hard) to obtain a member file name in a form relative
        to the .tar.gz root and with no heading '.' s./it/i(t
startswith(tfname((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__normalize_memberSs


cCs;tj|}|jj}d||kp:||kS(s.Check if this part contains a given file name.s./(Rt_DebPart__normalize_memberR"tgetnames(RR%tnames((s2/usr/lib/python2.7/dist-packages/debian/debfile.pythas_filedscCsRtj|}y|jjd|SWn!tk
rM|jj|SXdS(s8Return a file object corresponding to a given file name.s./N(RR'R"textractfiletKeyError(RR%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pytget_filels

cCs8|j|}d}|r4|j}|jn|S(sRReturn the string content of a given file, or None (e.g. for
        directories).N(R-Rtreadtclose(RR%tftcontent((s2/usr/lib/python2.7/dist-packages/debian/debfile.pytget_contentus
cCst|jjS(N(titerR"R((R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__iter__scCs
|j|S(N(R*(RR%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__contains__scCs
|j|S(N(R*(RR%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pythas_keyscCs
|j|S(N(R2(RR%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__getitem__s(RRt__doc__RR"tstaticmethodR'R*R-R2R4R5R6R7(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR)s						
			tDebDatacBseZRS((RR(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR:st
DebControlcBs#eZdZdZdZRS(cCs@i}x3tD]+}|j|r
|j|||<q
q
W|S(so Return a dictionary of maintainer scripts (postinst, prerm, ...)
        mapping script names to script text. (t
MAINT_SCRIPTSR*R2(RtscriptsR%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR=s

cCst|jtS(s Return the debian/control as a Deb822 (a Debian-specific dict-like
        class) object.
        
        For a string representation of debian/control try
        .get_content('control') (RR2tCONTROL_FILE(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt
debcontrolscCs|jts"tdtn|jt}i}x?|jD]1}|jdjdd\}}|||<qDW|j|S(sf Return a dictionary mapping filenames (of the data part) to
        md5sums. Fails if the control part does not contain a 'md5sum' file.

        Keys of the returned dictionary are the left-hand side values of lines
        in the md5sums member of control.tar.gz, usually file names relative to
        the file system root (without heading '/' or './'). s('%s' file not found, can't list MD5 sumss
iN(	R*tMD5_FILERR-t	readlinestrstriptsplitRR/(Rtmd5_filetsumstlinetmd5R%((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR
s
!
(RRR=R?R
(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR;s			tDebFilecBszeZdZddddZdZedZedZedZ	dZ
dZd	Zd
Z
RS(sRepresentation of a .deb file (a Debian binary package)

    DebFile objects have the following (read-only) properties:
        - version       debian .deb file format version (not related with the
                        contained package version), 2.0 at the time of writing
                        for all .deb packages in the Debian archive
        - data          DebPart object corresponding to the data.tar.gz (or
                        other compressed tar) archive contained in the .deb
                        file
        - control       DebPart object corresponding to the control.tar.gz (or
                        other compressed tar) archive contained in the .deb
                        file
    Rcstj||||t|jfd}tkrVtdtni|_t|j|t	|jt	<t
|j|t|jt<d|_
|jt}|jj|_|jdS(NcsgtD]}d||f^q}jt|}|sQtd|n3t|dkrvtd|nt|dSdS(Ns%s.%ss9missing required part in given .deb (expected one of: %s)is>too many parts in given .deb (was looking for only one of: %s)i(t	PART_EXTStintersectiontsetRtlentlist(tbasenametextt
candidatestparts(tactual_names(s2/usr/lib/python2.7/dist-packages/debian/debfile.pytcompressed_part_names#

s4missing required part in given .deb (expected: '%s')(RRRKR(t	INFO_PARTRt_DebFile__partsR;t	getmembert	CTRL_PARTR:t	DATA_PARTRt_DebFile__pkgnameR.tstript_DebFile__versionR/(RtfilenameRRRSR0((RRs2/usr/lib/python2.7/dist-packages/debian/debfile.pyRs

				cCs|jd|_dS(Ntpackage(R?RY(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt__updatePkgNamescCs|jS(N(R[(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt<lambda>scCs|jtS(N(RURX(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR_scCs|jtS(N(RURW(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR_scCs
|jjS(s See .control.debcontrol() (RR?(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR?scCs
|jjS(s See .control.scripts() (RR=(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR=scCs
|jjS(s See .control.md5sums() (RR
(R((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyR
scCs|jdkr|jnxrt|jt|jgD]V}|jj|r7tjd|jj	|}|j
}|jt|Sq7WdS(s Return a Changelog object for the changelog.Debian.gz of the
        present .deb package. Return None if no changelog can be found. RN(
RYRt_DebFile__updatePkgNametCHANGELOG_DEBIANtCHANGELOG_NATIVEtdataR*RRR-R.R/R(RR%Rt
raw_changelog((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt	changelogs


N(RRR8RRR`tpropertytversionRcRR?R=R
Re(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyRHs
 				t__main__R\i(RRtarfileRRReRtdeb822RRXRWRIRTR<R>RbRaR@RtobjectRR:R;RHRtsystargvtdebRR"RV(((s2/usr/lib/python2.7/dist-packages/debian/debfile.pyt<module>s.f,U