Your IP : 172.28.240.42


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


V ^c@sEdZddlZddlZddlZddlZddlZddlZddlZddlZyddl	m
Z
mZWnek
re
ZZ
nXyddl	mZWnek
re
ZnXddlZddlZddlmZddlmZmZmZddd	d
ddd
fZdZdZdZdefdYZdefdYZde
fdYZdefdYZ de!fdYZ"d	e
fdYZ#de
fdYZ$de
fdYZ%d
efdYZ&d
e
fdYZ'dZ(e)dkrAe(ndS( s"Functionality related to packages.iN(tMappingtSequence(R(tgettext(tfunction_deprecated_bytAttributeDeprecatedBytdeprecated_argstBaseDependencyt
DependencytOrigintPackagetRecordtVersiontVersionListcCsX|jrtjd|jS|jr8tjd|jS|jrTtjd|jSdS(sReturn a hash stringtSHA256tSHA1tMD5SumN(tsha256_hashtapt_pkgt
HashStringt	sha1_hashtmd5_hashtNone(tbinrec((s//usr/lib/python2.7/dist-packages/apt/package.pyt_get_binary_hash3s			ccs@dddg}dddg}i}tj|j}xt||D]\}}y||}Wntk
rvqFnXxXd|jDD]@\}}	}
|
|krtj||t|	f||
<qqWqFWxc|jD]X\}}	}}
xC|j	D]5\}\}}	|j
|r||	||
fVqqWqWdS(	s+Return a mapping name -> (hashstring, size)sChecksums-Sha256sChecksums-Sha1tFilesR
RRcss|]}|jVqdS(N(tsplit(t.0tl((s//usr/lib/python2.7/dist-packages/apt/package.pys	<genexpr>LsN(Rt
TagSectiontrecordtziptKeyErrort
splitlinesRtinttfilestitemstendswith(tsrcrectfieldsttypestresulttsectiontfieldthashtypeR"thashsumtsizetfnametmd5tpathttyptkeyt
hashstring((s//usr/lib/python2.7/dist-packages/apt/package.pyt_get_source_hashs>s"
&cCs;tjj|r7tjj||kr7|j|SdS(s(Return ``True`` if the file is the same.N(tosR0texiststgetsizetverify_file(R0R-R3((s//usr/lib/python2.7/dist-packages/apt/package.pyt
_file_is_sameWs*t
FetchErrorcBseZdZRS(s(Raised when a file could not be fetched.(t__name__t
__module__t__doc__(((s//usr/lib/python2.7/dist-packages/apt/package.pyR:]stUntrustedErrorcBseZdZRS(s>Exception that is thrown when fetching fails for trust reasons(R;R<R=(((s//usr/lib/python2.7/dist-packages/apt/package.pyR>ascBsQeZdZdefdYZddZdZej	rOe
dZnRS(sNA single dependency.

    Attributes defined here:
        name       - The name of the dependency
        relation   - The relation (>,>=,==,<,<=,)
        version    - The version depended on
        rawtype   - The type of the dependendy (e.g. 'Recommends')
        pre_depend - Boolean value whether this is a pre-dependency.
    t__dstrcBs eZdZdZdZRS(s(Helper to make > match >> and < match <<cCs&tj||p%tjd||S(Ni(tstrt__eq__(tselftother((s//usr/lib/python2.7/dist-packages/apt/package.pyRAsscCs&tj||o%tjd||S(Ni(R@RAt__ne__(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyRDvs(R;R<R=RARD(((s//usr/lib/python2.7/dist-packages/apt/package.pyR?ps	cCsR||_t|dkr*|j|p-||_||_||_||_dS(Ni(tnametlent_BaseDependency__dstrtrelationtversiont
pre_dependtrawtype(RBREtreltvertpreRK((s//usr/lib/python2.7/dist-packages/apt/package.pyt__init__ys
	*		cCs d|j|j|j|jfS(Ns=<BaseDependency: name:%r relation:%r version:%r preDepend:%r>(RERHRIRJ(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt__repr__sRJN(R;R<R=R@RGRRORPRt_COMPAT_0_7Rt	preDepend(((s//usr/lib/python2.7/dist-packages/apt/package.pyRes				cBs&eZdZdZedZRS(sxRepresent an Or-group of dependencies.

    Attributes defined here:
        or_dependencies - The possible choices
    cCs$tt|j|j|dS(N(tsuperRROtextend(RBtalternatives((s//usr/lib/python2.7/dist-packages/apt/package.pyROscCs|S(N((RB((s//usr/lib/python2.7/dist-packages/apt/package.pytor_dependenciess(R;R<R=ROtpropertyRV(((s//usr/lib/python2.7/dist-packages/apt/package.pyRs	tDeprecatedPropertycBs/eZdZdddddZddZRS(sA property which gives DeprecationWarning on access.

    This is only used for providing the properties in Package, which have been
    replaced by the ones in Version.
    cCs5tj||||||p+|jp+d|_dS(Nt(RWROR=(RBtfgettfsettfdeltdoc((s//usr/lib/python2.7/dist-packages/apt/package.pyROscCsT|dk	rAtjd|jjp'|j|jjftdntj|||S(NsRAccessed deprecated property %s.%s, please see the Version class for alternatives.i(	Rtwarningstwarnt	__class__R;RZtDeprecationWarningRWt__get__(RBtobjttype_((s//usr/lib/python2.7/dist-packages/apt/package.pyRbs
	N(R;R<R=RRORb(((s//usr/lib/python2.7/dist-packages/apt/package.pyRXscBs eZdZdZdZRS(syThe origin of a version.

    Attributes defined here:
        archive   - The archive (eg. unstable)
        component - The component (eg. main)
        label     - The Label, as set in the Release file
        origin    - The Origin, as set in the Release file
        site      - The hostname of the site.
        trusted   - Boolean value whether this is trustworthy.
    cCs|j|_|j|_|j|_|j|_|j|_|j|_|jjj|}|rx|j	rxt
|_n	t|_dS(N(
tarchivet	componenttlabeltorigintsitet
not_automatict_pcachet_listt
find_indext
is_trustedtTruettrustedtFalse(RBtpkgtpackagefilet	indexfile((s//usr/lib/python2.7/dist-packages/apt/package.pyROscCs,d|j|j|j|j|j|jfS(NsH<Origin component:%r archive:%r origin:%r label:%r site:%r isTrusted:%r>(RfReRhRgRiRp(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRPs(R;R<R=RORP(((s//usr/lib/python2.7/dist-packages/apt/package.pyRs
	cBskeZdZdZdZdZdZdZdZdZ	ddZd	Zd
Z
RS(s"Record in a Packages file

    Represent a record as stored in a Packages file. You can use this like
    a dictionary mapping the field names of the record to their values::

        >>> record = Record("Package: python-apt\nVersion: 0.8.0\n\n")
        >>> record["Package"]
        'python-apt'
        >>> record["Version"]
        '0.8.0'

    For example, to get the tasks of a package from a cache, you could do::

        package.candidate.record["Tasks"].split()

    Of course, you can also use the :attr:`Version.tasks` property.

    cCstj||_dS(N(RRt_rec(RBt
record_str((s//usr/lib/python2.7/dist-packages/apt/package.pyROscCs
t|jS(N(thashRu(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt__hash__scCs
t|jS(N(R@Ru(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt__str__scCs|j|S(N(Ru(RBR2((s//usr/lib/python2.7/dist-packages/apt/package.pyt__getitem__scCs
||jkS(N(Ru(RBR2((s//usr/lib/python2.7/dist-packages/apt/package.pyt__contains__scCst|jjS(N(titerRutkeys(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt__iter__sccs0x)|jjD]}||j|fVqWdS(s6An iterator over the (key, value) items of the record.N(RuR}(RBR2((s//usr/lib/python2.7/dist-packages/apt/package.pyt	iteritemsscCs|jj||S(sReturn record[key] if key in record, else *default*.

        The parameter *default* must be either a string or None.
        (Rutget(RBR2tdefault((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCs
||jkS(s deprecated form of ``key in x``.(Ru(RBR2((s//usr/lib/python2.7/dist-packages/apt/package.pythas_keyscCs
t|jS(N(RFRu(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt__len__sN(R;R<R=RORxRyRzR{R~RRRRR(((s//usr/lib/python2.7/dist-packages/apt/package.pyR
s								cBsceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
Ze
dZe
dZe
d
Ze
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZe
dZdZe
dZ e
dZ!e
dZ"e
d Z#e
d!Z$e
d"Z%e
d#Z&e
d$Z'e
d%Z(e
d&Z)e
d'Z*d(Z+e
d)Z,e
d*Z-d+d.d.d,Z/d+d.e0d.d-Z1RS(/sRepresentation of a package version.

    The Version class contains all information related to a
    specific package version.

    .. versionadded:: 0.7.9
    cCs||_||_dS(N(tpackaget_cand(RBRtcand((s//usr/lib/python2.7/dist-packages/apt/package.pyROs	cCsHytj|jj|jSWn$tk
rCtj|jj|SXdS(N(Rtversion_compareRtver_strRItAttributeError(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyt_cmps
cCs0y|j|dkSWntk
r+tSXdS(Ni(Rt	TypeErrortNotImplemented(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyRAs
cCs0y|j|dkSWntk
r+tSXdS(Ni(RRR(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyt__ge__s
cCs0y|j|dkSWntk
r+tSXdS(Ni(RRR(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyt__gt__%s
cCs0y|j|dkSWntk
r+tSXdS(Ni(RRR(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyt__le__+s
cCs0y|j|dkSWntk
r+tSXdS(Ni(RRR(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyt__lt__1s
cCs0y|j|dkSWntk
r+tSXdS(Ni(RRR(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyRD7s
cCs
|jjS(N(RRw(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRx=scCsd|jj|jfS(Ns <Version: package:%r version:%r>(RRERI(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRP@scCs3|jjjj|jjdr/|jjjSdS(s=Internal helper that moves the Records to the right position.iN(RRkt_recordstlookupRt	file_list(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRDs"cCs;|jj}|jjjj|jjd|jjjS(s2Internal helper to get the translated description.i(Rttranslated_descriptionRRkRRRtpop(RBt	desc_iter((s//usr/lib/python2.7/dist-packages/apt/package.pyt_translated_recordsKs"cCs
|jjS(s.Return the size of the package when installed.(Rtinstalled_size(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRRscCs
|jjS(s$Return the homepage for the package.(Rthomepage(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRWscCs
|jjS(sReturn the size of the package.(RR-(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR-\scCs
|jjS(s/Return the architecture of the package version.(Rtarch(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytarchitectureascCst|jjS(s:Return whether the version of the package is downloadable.(tboolRtdownloadable(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRfscCs
|jjS(sReturn the version as a string.(RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRIkscCs
|jjS(s0Return the short description (one line summary).(Rt
short_desc(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsummarypscCs
|jjS(s"return the long description (raw).(Rt	long_desc(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytraw_descriptionuscCs
|jjS(s"Return the section of the package.(RR)(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR)zscCs\d}|jj}y%t|ts6t|d}nWn*tk
rc}td|jj|fSXt|j	d}|j
x|D]}|jdkr|jds|d7}qqn|j
dr|jdsd|d	}qJd
|d	}nF|j
drD|jds.|dkr;|d}qJ|}n|}||7}qW|S(
sReturn the formatted long description.

        Return the formatted long description according to the Debian policy
        (Chapter 5.6.13).
        See http://www.debian.org/doc/debian-policy/ch-controlfields.html
        for more information.
        RYsutf-8s<Invalid unicode in description for '%s' (%s). Please report.s
t.s

s  s
%s
is%s
t i(RRt
isinstancetunicodetUnicodeDecodeErrort_RRER|RtnexttstripR$t
startswith(RBtdesctdscterrtlinestraw_linetline((s//usr/lib/python2.7/dist-packages/apt/package.pytdescriptions4		



	cCs9y|jjp|jjSWntk
r4|jjSXdS(s&Return the name of the source package.N(Rt
source_pkgRt	shortnamet
IndexError(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsource_names
cCs9y|jjp|jjSWntk
r4|jjSXdS(s)Return the version of the source package.N(Rt
source_verRRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsource_versions
cCs
|jjS(s.Return the priority of the package, as string.(Rtpriority_str(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytpriorityscCsQd}|jjjj}x2|jjD]$\}}t||j|}q%W|S(sReturn the internal policy priority as a number.
           See apt_preferences(5) for more information about what it means.
        i(RRkt	_depcachetpolicyRRtmaxtget_priority(RBRRRsR((s//usr/lib/python2.7/dist-packages/apt/package.pytpolicy_prioritys
cCst|jjS(sReturn a Record() object for this version.

        Return a Record() object for this version which provides access
        to the raw attributes of the candidate version
        (R
RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscGsg}|jj}x|D]}ywxp||D]d}g}xB|D]:}|jt|jj|j|j|dkd|q@W|jt|q-WWqt	k
rqXqW|S(s8Return a list of Dependency objects for the given types.t
PreDependsRK(
Rtdepends_listtappendRt
target_pkgREt	comp_typet
target_verRR(RBR'RtdependsRdtdep_ver_listt	base_depstdep_or((s//usr/lib/python2.7/dist-packages/apt/package.pytget_dependenciess


cCs!g|jjD]}|d^q
S(s3 Return a list of names that this version provides.i(Rt
provides_list(RBtp((s//usr/lib/python2.7/dist-packages/apt/package.pytprovidesscCs
|jdS(s4Return the list of enhances for the package version.tEnhances(R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytenhancesscCs|jddS(s/Return the dependencies of the package version.RtDepends(R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytdependenciesscCs
|jdS(s-Return the recommends of the package version.t
Recommends(R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt
recommendsscCs
|jdS(s+Return the suggests of the package version.tSuggests(R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsuggestsscCs@g}x3|jjD]%\}}|jt|j|qW|S(s1Return a list of origins for the package version.(RRRRR(RBtoriginsRsR((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCs
|jjS(sZReturn the path to the file inside the archive.

        .. versionadded:: 0.7.10
        (Rtfilename(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR
scCs
|jjS(sKReturn the md5sum of the binary.

        .. versionadded:: 0.7.10
        (RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR/scCs
|jjS(sLReturn the sha1sum of the binary.

        .. versionadded:: 0.7.10
        (RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsha1scCs
|jjS(sNReturn the sha256sum of the binary.

        .. versionadded:: 0.7.10
        (RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsha256"scCst|jdjS(sGet the tasks of the package.

        A set of the names of the tasks this package belongs to.

        .. versionadded:: 0.8.0
        tTask(tsetRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyttasks*sccsVxO|jjD]A\}}|jjjj|}|r
|j|jjVq
q
WdS(sVReturn an iterator over all available urls.

        .. versionadded:: 0.7.10
        N(	RRRRkRlRmtarchive_uriRR(RBRsRRt((s//usr/lib/python2.7/dist-packages/apt/package.pyt_uris4scCst|jS(s^Return a list of all available uris for the binary.

        .. versionadded:: 0.7.10
        (tlistR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyturis>scCs3yt|jjSWntk
r.dSXdS(sNReturn a single URI for the binary.

        .. versionadded:: 0.7.10
        N(R|RRt
StopIterationR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyturiFs
RYcCs|d	kr$tjjdt}ntjj|jj	}tjj
||}t|j}t||j
|rd|GHtjj|S|jjd\}}|jjjj|}	|p|	o|	jstd|jj|jt|	ddfntj|ptjjj}
tj|
|j |oAt!||j
|d|}|
j"|j#|j$krt%d|j&|j'fntjj|S(
sCFetch the binary version of the package.

        The parameter *destdir* specifies the directory where the package will
        be fetched to.

        The parameter *progress* may refer to an apt_pkg.AcquireProgress()
        object. If not specified or None, apt.progress.text.AcquireProgress()
        is used.

        The keyword-only parameter *allow_unauthenticated* specifies whether
        to allow unauthenticated downloads. If not specified, it defaults to
        the configuration option `APT::Get::AllowUnauthenticated`.

        .. versionadded:: 0.7.10
        sAPT::Get::AllowUnauthenticateds"Ignoring already existing file: %sis>Could not fetch %s %s source package: Source %r is not trustedtdescribes<unkown>tdestfiles$The item %r could not be fetched: %sN((RRtconfigtfind_bRqR5R0tbasenameRRtjoinRR9R-tabspathRRRRkRlRmRnR>RERItgetattrtAcquiretapttprogressttexttAcquireProgresstAcquireFileRR@truntstatust	STAT_DONER:Rt
error_text(RBtdestdirRtallow_unauthenticatedtbaseRR3tpfiletoffsettindextacqtacqfile((s//usr/lib/python2.7/dist-packages/apt/package.pytfetch_binaryQs0	!
cCs|dkr$tjjdt}ntj}tj|pKtjj	j
}d}|j}|jpr|j
j}	|jp|jj}
|j|	}x(|r|
|jkr|j|	}qW|std|nt}|p|jjs#td|j
j|j|jjfnxt|D]\}
}}}tjj|}tjj||}|dkr~|}nt |||
rd|GHq0n|j!tj"||jj#||
ot$|
||d|q0W|j%xB|j&D]7}|j'|j(krt)d|j*|j+fqqW|r|j
dtj,|j}tjj||}t-j.d	d
||gtjj/|Stjj/|SdS(s9Get the source code of a package.

        The parameter *destdir* specifies the directory where the source will
        be fetched to.

        The parameter *progress* may refer to an apt_pkg.AcquireProgress()
        object. If not specified or None, apt.progress.text.AcquireProgress()
        is used.

        The parameter *unpack* describes whether the source should be unpacked
        (``True``) or not (``False``). By default, it is unpacked.

        If *unpack* is ``True``, the path to the extracted directory is
        returned. Otherwise, the path to the .dsc file is returned.

        The keyword-only parameter *allow_unauthenticated* specifies whether
        to allow unauthenticated downloads. If not specified, it defaults to
        the configuration option `APT::Get::AllowUnauthenticated`.
        sAPT::Get::AllowUnauthenticatedsNo source for %rs>Could not fetch %s %s source package: Source %r is not trustedRs"Ignoring already existing file: %sRs$The item %r could not be fetched: %st-sdpkg-sources-xN(0RRRRRqt
SourceRecordsRRRRRRRRRRRRRRIt
ValueErrorRRRnR>RERR4R5R0RRR9RRRR@RR#RRR:RRtupstream_versiont
subprocesst
check_callR(RBRRtunpackRtsrcRRRRRt
source_lookupR"R3R-R0RdRRtitemtoutdir((s//usr/lib/python2.7/dist-packages/apt/package.pytfetch_sourcesR!				
N(2R;R<R=RORRARRRRRDRxRPRWRRRRR-RRRIRRR)RRRRRRRRRRRRRRR/RRRRRRRRRoR(((s//usr/lib/python2.7/dist-packages/apt/package.pyRs^										/		
	
/	cBseeZdZd
dZdZdZdZdZdZ	dZ
dZd
d	ZRS(sProvide a mapping & sequence interface to all versions of a package.

    This class can be used like a dictionary, where version strings are the
    keys. It can also be used as a sequence, where integers are the keys.

    You can also convert this to a dictionary or a list, using the usual way
    of dict(version_list) or list(version_list). This is useful if you need
    to access the version objects multiple times, because they do not have to
    be recreated this way.

    Examples ('package.versions' being a version list):
        '0.7.92' in package.versions # Check whether 0.7.92 is a valid version.
        package.versions[0] # Return first version or raise IndexError
        package.versions[0:2] # Return a new VersionList for objects 0-2
        package.versions['0.7.92'] # Return version 0.7.92 or raise KeyError
        package.versions.keys() # All keys, as strings.
        max(package.versions)
    cCs5||_|jj|_|r1|j||_ndS(N(t_packaget_pkgtversion_listt	_versions(RBRtslice_((s//usr/lib/python2.7/dist-packages/apt/package.pyROs	cCst|tr"|j|j|Syt|j|j|SWnDtk
rx4|jD]%}|j|krWt|j|SqWWnXtd|dS(NsVersion: %r not found.(	RtsliceR`R	RRRRR(RBRRM((s//usr/lib/python2.7/dist-packages/apt/package.pyRzs
cCsd|jS(Ns<VersionList: %r>(R}(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRPscsfdjDS(s*Return an iterator over all value objects.c3s!|]}tj|VqdS(N(RR	(RRM(RB(s//usr/lib/python2.7/dist-packages/apt/package.pys	<genexpr>s(R(RB((RBs//usr/lib/python2.7/dist-packages/apt/package.pyR~scCsFt|tr|j}nx$|jD]}|j|kr%tSq%WtS(N(RRRIRRRoRq(RBRRM((s//usr/lib/python2.7/dist-packages/apt/package.pyR{scCst|t|kS(N(R(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyRAscCs
t|jS(N(RFR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCsg|jD]}|j^q
S(s*Return a list of all versions, as strings.(RR(RBRM((s//usr/lib/python2.7/dist-packages/apt/package.pyR}scCs%y||SWntk
r |SXdS(sReturn the key or the default.N(tLookupError(RBR2R((s//usr/lib/python2.7/dist-packages/apt/package.pyRs
N(
R;R<R=RRORzRPR~R{RARR}R(((s//usr/lib/python2.7/dist-packages/apt/package.pyRs	
							cBs1eZdZdZdZdZdZdZeeeZedZ	edZ
edZed	Zed
Z
dZedZed
ZedZedZedZdZedZedZedZedZedZedZedZedZedZedZedZ edZ!edZ"edZ#ed Z$ed!Z%ed"Z&ed#Z'ed$Z(ed%Z)ed&Z*ed'Z+ed(Z,ed)Z-ed*Z.ed+Z/ed,Z0dCdCd-Z2ed.Z3ed/Z4ed0Z5ed1Z6d2Z7e8e9e:d3Z;e8e9e9e9d4Z<d5Z=e9d6Z>d7Z?e@jAso[[[[[[[[[[[[[[[ [![,[-[.[/[3neBd8ZCeBd9ZDeBd:ZEeBd;ZFeBd<ZGeBd=ZHeBd>ZIeBd?ZJeBd@ZKeBdAZLeBdBZMeNe2ZOeNe;ZPeNe<ZQeNe7ZReNe=ZSRS(DsRepresentation of a package in a cache.

    This class provides methods and properties for working with a package. It
    lets you mark the package for installation, check if it is installed, and
    much more.
    cCs||_||_d|_dS(s Init the Package object RYN(R
Rkt
_changelog(RBtpcachetpkgiter((s//usr/lib/python2.7/dist-packages/apt/package.pyROs		cCs#d|jj|jj|jjfS(Ns(<Package: name:%r architecture=%r id:%r>(R
RERtid(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRP"scCs|j|jkS(N(RE(RBRC((s//usr/lib/python2.7/dist-packages/apt/package.pyR&scCs5|jjj|j}|dk	r1t||SdS(sReturn the candidate version of the package.

        This property is writeable to allow you to set the candidate version
        of the package. Just assign a Version() object, and it will be set as
        the candidate version.
        N(RkRtget_candidate_verR
RR(RBR((s//usr/lib/python2.7/dist-packages/apt/package.pyt	candidate)scCs:|jj|jjj|j|j|jjdS(s)Set the candidate version of the package.N(Rktcache_pre_changeRtset_candidate_verR
Rtcache_post_change(RBRI((s//usr/lib/python2.7/dist-packages/apt/package.pyt__set_candidate4s
cCs)|jjdk	r%t||jjSdS(s`Return the currently installed version of the package.

        .. versionadded:: 0.7.9
        N(R
tcurrent_verRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt	installed<scCs|jjtS(s|Return the name of the package, possibly including architecture.

        If the package is not part of the system's preferred architecture,
        return the same as :attr:`fullname`, otherwise return the same
        as :attr:`shortname`

        .. versionchanged:: 0.7.100.3
        As part of multi-arch, this field now may include architecture
        information.
        (R
tget_fullnameRo(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyREEscCs|jjtS(s\Return the name of the package, including architecture.

        .. versionadded:: 0.7.100.3(R
RRq(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytfullnameSscCs
|jjS(sZReturn the name of the package, without architecture.

        .. versionadded:: 0.7.100.3(R
RE(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRZscCs
|jjS(snReturn a uniq ID for the package.

        This can be used eg. to store additional information about the pkg.(R
R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRascCs
|jjS(s[Return the hash of the object.

        This returns the same value as ID, which is unique.(R
R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRxhscCs
|jjS(s>Return True if the package is an essential part of the system.(R
t	essential(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRnscCst|jddS(sFReturn the installed version as string.

        .. deprecated:: 0.7.9RIN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledVersionsscCst|jddS(sFReturn the candidate version as string.

        .. deprecated:: 0.7.9RIN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateVersionzscCst|jddS(sPReturn a list of candidate dependencies.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateDependenciesscCst|jdgS(sPReturn a list of installed dependencies.

        .. deprecated:: 0.7.9
        R(RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledDependenciesscCs
|jjS(sReturn the Architecture of the package.

        .. versionchanged:: 0.7.100.3
            This is now the package's architecture in the multi-arch sense,
            previously it was the architecture of the candidate version
            and deprecated.
        (R
R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCst|jddS(sYReturn ``True`` if the candidate is downloadable.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateDownloadablescCst|jdtS(saReturn ``True`` if the installed version is downloadable.

        .. deprecated:: 0.7.9
        R(RRRq(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledDownloadablescCsmy|jjjp|jjSWnItk
rhy|jjjpH|jjSWqitk
rd|jjSXnXdS(sQReturn the source package name as string.

        .. deprecated:: 0.7.9
        N(RRRR
RERR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytsourcePackageNames

cCst|jddS(sLReturn the homepage field as string.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCs
|jjS(s"Return the section of the package.(R
R)(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR)scCst|jddS(sWReturn the priority (of the candidate version).

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCst|jddS(sWReturn the priority (of the installed version).

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledPriorityscCst|jddS(sXReturn the short description (one line summary).

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCst|jddS(sReturn the formatted long description.

        Return the formatted long description according to the Debian policy
        (Chapter 5.6.13).
        See http://www.debian.org/doc/debian-policy/ch-controlfields.html
        for more information.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRscCst|jddS(sAreturn the long description (raw).

        .. deprecated:: 0.7.9RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytrawDescriptionscCst|jddS(sYReturn the Record of the candidate version of the package.

        .. deprecated:: 0.7.9RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateRecordscCst|jddS(sYReturn the Record of the candidate version of the package.

        .. deprecated:: 0.7.9RRY(RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledRecordscCs|jjj|jS(s5Return ``True`` if the package is marked for install.(RkRtmarked_installR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR*scCs|jjj|jS(s5Return ``True`` if the package is marked for upgrade.(RkRtmarked_upgradeR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR+scCs|jjj|jS(s4Return ``True`` if the package is marked for delete.(RkRt
marked_deleteR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR,scCs|jjj|jS(s2Return ``True`` if the package is marked for keep.(RkRtmarked_keepR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR-scCs|jjj|jS(s! Package is marked for downgrade (RkRtmarked_downgradeR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR.scCs|jjj|jS(s7Return ``True`` if the package is marked for reinstall.(RkRtmarked_reinstallR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR/scCs|jjdk	S(s,Return ``True`` if the package is installed.N(R
RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytis_installed scCs|jo|jjj|jS(s-Return ``True`` if the package is upgradable.(R0RkRt
is_upgradableR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR1%s	cCs(|js|jo'|jjj|jS(sReturn ``True`` if the package is no longer required.

        If the package has been installed automatically as a dependency of
        another package, and if no packages depend on it anymore, the package
        is no longer required.
        (R0R*RkRt
is_garbageR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytis_auto_removable+scCs|jjj|jS(s@Return whether the package is marked as automatically installed.(RkRtis_auto_installedR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyR46scCst|jddS(sUReturn the size of the candidate deb package.

        .. deprecated:: 0.7.9
        R-N(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytpackageSize<scCst|jddS(sUReturn the size of the installed deb package.

        .. deprecated:: 0.7.9
        R-i(RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalledPackageSizeDscCst|jddS(s[Return the size of the candidate installed package.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateInstalledSizeLscCst|jddS(s\Return the size of the currently installed package.


        .. deprecated:: 0.7.9
        Ri(RR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyt
installedSizeTscCs^d|j}y8t|d#}|jjdjdSWdQXWntk
rYgSXdS(sReturn a list of files installed by the package.

        Return a list of unicode names of the files which have
        been installed by this package
        s/var/lib/dpkg/info/%s.listtrbsutf-8u
N(REtopentreadtdecodeRtEnvironmentError(RBR0R((s//usr/lib/python2.7/dist-packages/apt/package.pytinstalled_files]s
&
cCs|jdkr|jS|dkr|js.n|jjdjdkrPd}q|jjdjdkrrd}qtd}t|tr|S|jdSn|jj	}d	}|jj
}|jj}ytj
}Wntk
rnXx}|j|rn|jsqn|jj|jkr;|j}|j
}Pntj|j|dkr|j}|j
}qqW|jd
d}	t|	dkr|	d}n~	|d}
|jdrd|d
}
n|jdd}t|dkrdj|d}n~|i|d6|
d6|d6|d6}tj}z3ytjd|re|jredStj|}
d}dtj|}xtr|r|jrdS|
j}|sPn|jd}tj ||}|rt!|j"dd}|r)d|kr)|jddd}n|j#d}|rcd|krc|jddd}n|rtj||dkrPqn||7}qWt|dkrtd}t|ts|jd}qn||_Wntj$k
r+td||f}t|tr|S|jdSt%t&j'fk
rmtd}t|tr`|S|jdSXWdtj|X|jS(s
        Download the changelog of the package and return it as unicode
        string.

        The parameter *uri* refers to the uri of the changelog file. It may
        contain multiple named variables which will be substitued. These
        variables are (src_section, prefix, src_pkg, src_ver). An example is
        the Ubuntu changelog::

            "http://changelogs.ubuntu.com/changelogs/pool" \
                "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
                "/%(src_pkg)s_%(src_ver)s/changelog"

        The parameter *cancel_lock* refers to an instance of threading.Lock,
        which if set, prevents the download.
        uitDebiansshttp://packages.debian.org/changelogs/pool/%(src_section)s/%(prefix)s/%(src_pkg)s/%(src_pkg)s_%(src_ver)s/changelogtUbuntusuhttp://changelogs.ubuntu.com/changelogs/pool/%(src_section)s/%(prefix)s/%(src_pkg)s/%(src_pkg)s_%(src_ver)s/changelogs$The list of changes is not availablesutf-8tmaint/itlibit:RYtsrc_sectiontprefixtsrc_pkgtsrc_veris^%s \((.*)\)(.*)$RIsThe list of changes is not available yet.

Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog
until the changes become available or try again later.sOFailed to download the list of changes. 
Please check your Internet connection.N((RRRRRhRRRR<RR)RRRtSystemErrorRRIRRRFRRtsockettgetdefaulttimeouttsetdefaulttimeouttisSetturllib2turlopentretescapeRotreadlinetmatchRRtgroupt	HTTPErrortIOErrorthttplibt
BadStatusLine(RBRtcancel_locktresRGRER)RHtsrc_recordst
section_splitRFt
src_ver_splitttimeouttchangelog_filet	changelogtregexptline_rawRRSRt
changelog_ver((s//usr/lib/python2.7/dist-packages/apt/package.pyt
get_changelogks			#
				



	
	
 %cCst|jddS(sfReturn a list of `Origin()` objects for the candidate version.

        .. deprecated:: 0.7.9
        RN(RRR(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytcandidateOrigin
scCs
t|S(scReturn a VersionList() object for all available versions.

        .. versionadded:: 0.7.9
        (R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pytversionsscCs|jjj|jS(s5Return True if the to-be-installed package is broken.(RkRtis_inst_brokenR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRgscCs|jjj|jS(s/Return True if the installed package is broken.(RkRt
is_now_brokenR
(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRhscCs4|jj|jjj|j|jjdS(sMark a package for keep.N(RkRRt	mark_keepR
R(RB((s//usr/lib/python2.7/dist-packages/apt/package.pyRi&s
cCs|jj|jjj|j||r|jjjdkrtj|jj}|j|j|j	|j|j
|j|j|jn|jj
dS(s+Mark a package for deletion.

        If *auto_fix* is ``True``, the resolver will be run, trying to fix
        broken packages.  This is the default.

        If *purge* is ``True``, remove the configuration files of the package
        as well.  The default is to keep the configuration.
        iN(RkRRtmark_deleteR
tbroken_countRtProblemResolvertcleartprotecttremovetinstall_protecttresolveR(RBtauto_fixtpurgetfix((s//usr/lib/python2.7/dist-packages/apt/package.pyRj,s



cCs|jj|jjj|j|||r|jjjdkrtj|jj}|j|j|j	|j|j
tn|jjdS(s0Mark a package for install.

        If *autoFix* is ``True``, the resolver will be run, trying to fix
        broken packages.  This is the default.

        If *autoInst* is ``True``, the dependencies of the packages will be
        installed automatically.  This is the default.

        If *fromUser* is ``True``, this package will not be marked as
        automatically installed. This is the default. Set it to False if you
        want to be able to automatically remove the package at a later stage
        when no other package depends on it.
        iN(
RkRRtmark_installR
RkRRlRmRnRqRoR(RBRrt	auto_instt	from_usertfixer((s//usr/lib/python2.7/dist-packages/apt/package.pyRuBs
cCsS|jr5|jjj|j}|jd|ntjjd|jj	dS(sMark a package for upgrade.Rws1MarkUpgrade() called on a non-upgrable pkg: '%s'
N(
R1RkRR4R
RutsyststderrtwriteRE(RBRw((s//usr/lib/python2.7/dist-packages/apt/package.pytmark_upgrade[s
	cCs|jjj|j|dS(sMark a package as automatically installed.

        Call this function to mark a package as automatically installed. If the
        optional parameter *auto* is set to ``False``, the package will not be
        marked as automatically installed anymore. The default is ``True``.
        N(RkRt	mark_autoR
(RBtauto((s//usr/lib/python2.7/dist-packages/apt/package.pyR}escCs|jjj||dS(sCommit the changes.

        The parameter *fprogress* refers to a apt_pkg.AcquireProgress() object,
        like apt.progress.text.AcquireProgress().

        The parameter *iprogress* refers to an InstallProgress() object, as
        found in apt.progress.base.
        N(RkRtcommit(RBt	fprogresst	iprogress((s//usr/lib/python2.7/dist-packages/apt/package.pyRns	tmarked_installedR*R+R,R-R.R/R0R1R3R>N(TR;R<R=RORPRRt_Package__set_candidateRWRRERRRRxRRXRR R!R"RR#R$R%RR)RR&RRR'R(R)R*R+R,R-R.R/R0R1R3R4R5R6R7R8R>RRdReRfRgRhRiRRoRqRjRuR|R}RRRQRtmarkedInstalledt
markedInstallt
markedUpgradetmarkedDeletet
markedKeeptmarkedDowngradetmarkedReinstalltisInstalledtisUpgradabletisAutoRemovabletinstalledFilesRtgetChangelogt
markDeletetmarkInstalltmarkKeeptmarkUpgrade(((s//usr/lib/python2.7/dist-packages/apt/package.pyR	s								

				
			cCsdGHddl}tjtjjj}tj|}|d}d|jGHd|j	GHd|j
jGHd|jjGHd	|jj
GHd
|j
j
GHd|j
jGHd|j
jGHd
|j
jGHd|jGHd|j
jGHd|j
jGHd|j
jGHd|j
jGHd|j
jGHd|jjGHd|jjGHx/|j
jD]!}djd|jDGHqIWd|j
jGHd|j
jGHdG|j
jGH|djGHxtt fD]r}d|GHxB|D]:}|j!r|j"dddkr|j#|qqqWd|j$j%GHd |j$j&GHqWHxtt fD]}d!|GHtj|}xa|j'D]S}|j"dddkrfy||j(|Wqt)k
rd"|GHqXqfqfWd|j$j%GHd#|j$j*GHq;WdS($s
Self-test.sSelf-test for the Package moduliNs	apt-utilss	Name: %s sID: %s sPriority (Candidate): %s sPriority (Installed): %s sInstalled: %s sCandidate: %s sCandidateDownloadable: %ssCandidateOrigins: %ssSourcePkg: %s sSection: %s sSummary: %ssDescription (formatted) :
%ssDescription (unformatted):
%ssInstalledSize: %s sPackageSize: %s sDependencies: %ssRecommends: %st,css1|]'}d|j|j|j|jfVqdS(s%s (%s) (%s) (%s)N(RERIRHRJ(Rto((s//usr/lib/python2.7/dist-packages/apt/package.pys	<genexpr>ssarch: %sshomepage: %ssrec: t2vcards;Running install on random upgradable pkgs with AutoFix: %s iisBroken: %s sInstCount: %s s.Randomly remove some packages with AutoFix: %ssError trying to remove: %s s
DelCount: %s (+trandomRtinitRRRt
OpProgresstCacheRERRRRRIRRRR)RRRRR-RRRRVRRRRdRoRqR1trandintRuRRkt
inst_countR}RjRIt	del_count(RRtcacheRrtdeptiRE((s//usr/lib/python2.7/dist-packages/apt/package.pyt_testsd

	
		
t__main__(*R=RWR5RyRPRJRRNR^tcollectionsRRtImportErrortobjectRtapt.progress.textRRRtapt.deprecationRRRt__all__RR4R9t	ExceptionR:R>RRRRWRXRR
RRR	RR;(((s//usr/lib/python2.7/dist-packages/apt/package.pyt<module>sR


			#!:K	: