ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ U ˎ^@sddlmZddlZddlZddlZddlZz`ddlmZmZm Z m Z m Z m Z m Z mZmZmZmZeee e ee e e eeWnek rddZYnXddlZddlmZmZddlZddlmZmZmZeeeeGdd d eZGd d d eZGd d d eZ GdddeZ!Gddde"Z#Gddde$Z%Gddde$Z&Gddde$Z'Gddde$Z(Gddde(Z)Gddde(Z*Gddde$Z+Gd d!d!e$Z,d"d#Z-d$d%Z.d&d'Z/e0d(kre/dS)))print_functionN) AnyCallableDictIteratorListOptionalSetTupleUnioncastKeysViewcCs|SN)typobjrr+/usr/lib/python3/dist-packages/apt/cache.pyr +sr )PackageVersion)AcquireProgressInstallProgress OpProgressc@seZdZdZdS)FetchCancelledExceptionzAException that is thrown when the user cancels a fetch operation.N__name__ __module__ __qualname____doc__rrrrr9src@seZdZdZdS)FetchFailedExceptionz-Exception that is thrown when fetching fails.Nrrrrrr=src@seZdZdZdS)UntrustedExceptionz>Exception that is thrown when fetching fails for trust reasonsNrrrrrrAsrc@seZdZdZdS)LockFailedExceptionz,Exception that is thrown when locking fails.Nrrrrrr Esr c@seZdZdZdS)CacheClosedExceptionz>Exception that is thrown when the cache is used after close().Nrrrrrr!Isr!c@s(eZdZdZddZddZddZdS) _WrappedLockz`Wraps an apt_pkg.FileLock to raise LockFailedException. Initialized using a directory path.cCs ||_ttj|d|_dS)Nlock)_pathapt_pkgZFileLockospathjoin_lock)selfr'rrr__init__Rsz_WrappedLock.__init__c CsHz |jWStjk rB}ztd|j|fW5d}~XYnXdS)NzFailed to lock directory %s: %s)r) __enter__r%Errorr r$)r*errrr,Ws  z_WrappedLock.__enter__cCs|j|||Sr)r)__exit__)r*rvalue tracebackrrrr/_sz_WrappedLock.__exit__N)rrrrr+r,r/rrrrr"Msr"c@seZdZdZd\ddZddZdd Zd d Zd d Zd]ddZ ddZ ddZ ddZ ddZ ddZd^ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd_d,d-Zed.d/Zed0d1Zed2d3Zd4d5Zd`d6d7Zdad8d9Zd:d;Z dbd=d>Z!dcd@dAZ"dBdCZ#dddDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*edRdSZ+edTdUZ,edVdWZ-edXdYZ.edZd[Z/dS)eCacheaDictionary-like package cache. The APT cache file contains a hash table mapping names of binary packages to their metadata. A Cache object is the in-core representation of the same. It provides access to APTs idea of the list of available packages. The cache can be used like a mapping from package names to Package objects (although only getting items is supported). Keyword arguments: progress -- a OpProgress object, rootdir -- an alternative root directory. if that is given the system sources.list and system lists/files are not read, only file relative to the given rootdir, memonly -- build the cache in memory only. .. versionchanged:: 1.0 The cache now supports package names with special architecture qualifiers such as :all and :native. It does not export them in :meth:`keys()`, though, to keep :meth:`keys()` a unique set. NFc CsVttjd|_ttjd|_ttjd|_ttjd|_ i|_ i|_ t |_t |_d|_d|_|dd|dd|rtjdd|r2tj|}tj|drttj|dtj|drttj|dtjd |tjd |d tjd tj|d dd||ttj d}t!||_"|#|dS)Ncache_post_open_inc_changes_countcache_post_changezDir::Cache::pkgcachez/etc/apt/apt.confz/etc/apt/apt.conf.dZDirDir::State::status/var/lib/dpkg/statuszDir::bin::dpkgZusrbinZdpkgDir::Cache::Archives)$r r%r2_cacheDepCache _depcachePackageRecords_records SourceList_list _callbacks _callbacks2weakrefWeakValueDictionary_weakrefWeakSet _weakversions_changes_count _sorted_setconnectconfigsetr&r'abspathexistsZread_config_fileisdirZread_config_dirr(_check_and_create_required_dirsZ init_systemfind_dirr" _archive_lockopen)r*progressrootdirZmemonlyZ archive_dirrrrr+~sH        zCache.__init__cCs|jdS)zFix broken packages.N)r> fix_brokenr*rrrrXszCache.fix_brokencCs|jd7_dS)zIncrease the number of changesN)rJrYrrrr5szCache._inc_changes_countcCslddg}ddddg}|D]"}tj||st||q|D]&}tj||s@t||dq@dS) zf check if the required apt directories/files are there and if not create them r9z/etc/apt/sources.listz /var/lib/dpkgz /etc/apt/z/var/cache/apt/archives/partialz/var/lib/apt/lists/partialwN)r&r'rPmakedirsrUclose)r*rWfilesdirsdfrrrrRsz%Cache._check_and_create_required_dirscCsf||jkr2|j|D]}|dkr*|q|q||jkrb|j|D]\}}}||f||qFdS)z# internal helper to run a callback r5N)rCr5rDr*namecallbackargskwdsrrr_run_callbackss   zCache._run_callbackscCs|dkrtjj}|||_|dt||_ t |j |_ t |j |_ t|_|jd|_|ttdk|_||ddS)zY Open the package cache, after that it can be used like a dictionary NZcache_pre_openrZr4)aptrVbaserr]Z op_progressrgr%r2r<r=r>r?r@rArBread_main_listrK _Cache__remaplenZget_architecturesZ_have_multi_archZdone)r*rVrrrrUs     z Cache.openc Cst|jD]f}z|j|}Wntk r8YqYnXz|j|jj|jjf|_Wqtk rr|j|=YqXqt|j D]x}|j jj D]\}|j |j j kr|jdks|j jdks|j|j jkr|j|j jkr|j|j jkr||_ qq|j |qdS)zCalled after cache reopen() to relocate to new cache. Relocate objects like packages and versions from the old underlying cache to the new one. rN)listrGkeysKeyErrorr<_pkgrcZ architecture LookupErrorrIpackageZ version_listhashZ_candsizeZ multi_archZver_strremove)r*keypkgZvervrrrZ__remaps2     z Cache.__remapcCs|`ttjd|_dS)z Close the package cache N)r@r r%r?rYrrrr]sz Cache.closecCs|S)z Enter the with statement rrYrrrr,szCache.__enter__cCs |dS)z Exit the with statement N)r])r*exc_type exc_valuer1rrrr/!szCache.__exit__cCs\zt|}|j|}Wn tk r6td|YnX||sNtd|||}|S)z" look like a dictionary (get key) z!The cache has no package named %r)strr<ro_Cache__is_real_pkg_rawpkg_to_pkg)r*rvrawpkgrwrrr __getitem__&s   zCache.__getitem__cCs(z ||WStk r"|YSXdS)zaReturn *self*[*key*] or *default* if *key* not in *self*. .. versionadded:: 1.1 N)ro)r*rvdefaultrrrget7s z Cache.getcCs |jdd}|j|t||S)zgReturns the apt.Package object for an apt_pkg.Package object. .. versionadded:: 1.0.0 TZpretty) get_fullnamerG setdefaultr)r*r~fullnamerrrr}Bs zCache._rawpkg_to_pkgccs2|D]$}t||j|}|j||VqdSr)rnrr<rGrr*pkgnamerwrrr__iter__Ls zCache.__iter__cCs|jS)z8Check if the apt_pkg.Package provided is a real package.) has_versions)r*r~rrrZ __is_real_pkgWszCache.__is_real_pkgcCs||kSrrr*rvrrrhas_key\sz Cache.has_keycCs2z||jt|WStk r,YdSXdSNF)r|r<r{rorrrr __contains__`szCache.__contains__cCs t|Sr)rlrnrYrrr__len__gsz Cache.__len__cs0jdkr&tfddjjD_tjS)Nc3s$|]}|r|jddVqdS)TrN)r|r).0prYrr ns zCache.keys..)rKsortedr<packagesrmrYrrYrrnks    z Cache.keyscCs6g}|jj}|jjD]}||s|||q|S)z Get the marked changes )r> marked_keepr<rappendr})r*changesrr~rrr get_changesss  zCache.get_changescCs ||j||dS)zUpgrade all packages. If the parameter *dist_upgrade* is True, new dependencies will be installed as well (and conflicting packages may be removed). The default value is False. N)cache_pre_changer>upgrader6)r*Z dist_upgraderrrr}s z Cache.upgradecCs>|jdkrtdt|j}t}|||j|j|jS)z;Get the size of the packages that are required to download.N&Cache object used after close() called) r@r!r%PackageManagerr>Acquire get_archivesrBZ fetch_needed)r*pmfetcherrrrrequired_downloads  zCache.required_downloadcCs|jjS)z8Get the size of the additional required space on the fs.)r>Zusr_sizerYrrrrequired_spaceszCache.required_spacecCs^t}|jj}ttjtjf}|jjD]2}||}|r&|j s&|j |kr&| |j ddq&|S)zAReturn the packages not downloadable packages in reqreinst state.Tr) rNr>get_candidate_ver frozensetr%ZINSTSTATE_REINSTREQZINSTSTATE_HOLD_REINSTREQr<rZ downloadableZ inst_stateaddr)r*Z reqreinstrZstatesrwZcandrrrreq_reinstall_pkgss zCache.req_reinstall_pkgscCs|dkrtjdd}dd|jD}|rJ|sJtdddd|D|}d}d }|jD]2}|j|jkrrq`|j rzq`|d |j |j f7}d }q`||j krt |n |rt||S) NzAPT::Get::AllowUnauthenticatedFcSsg|]}|js|qSr)Z is_trusted)ritemrrr sz&Cache._run_fetcher..zUntrusted packages: %s css|] }|jVqdSr)desc_uri)rirrrrsz%Cache._run_fetcher..r7zFailed to fetch %s %s T)r%rMZfind_bitemsrr(runZstatusZ STAT_DONEZ STAT_IDLErZ error_textZRESULT_CANCELLEDrr)r*rallow_unauthenticatedZ untrustedresZfailederr_msgrrrr _run_fetchers4    zCache._run_fetchercCs4|jdkrtd|||j|js(dS|||S)z fetch the needed archives NrF)r@r!rrBr)r*rrrrrr_fetch_archivess zCache._fetch_archivesc Csr|dk r|dk rtd|dkr,tjj}|dkr>t|}|j$||t |j |W5QRSQRXdS)aFetch the archives for all packages marked for install/upgrade. You can specify either an :class:`apt.progress.base.AcquireProgress()` object for the parameter *progress*, or specify an already existing :class:`apt_pkg.Acquire` object for the parameter *fetcher*. The return value of the function is undefined. If an error occurred, an exception of type :class:`FetchFailedException` or :class:`FetchCancelledException` is raised. 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.8.0 Nz'Takes a progress or a an Acquire object) ValueErrorrhrVtextrr%rrTrrr>)r*rVrrrrrfetch_archivess   zCache.fetch_archivescCs<z|j|}Wntk r$YdSXt|jo4|j SdS)z0Return whether the package is a virtual package.FN)r<roboolZ has_providesrrrrris_virtual_packages zCache.is_virtual_packageTc Cst}|jj}z"|j|}|jr.|s.t|WSWntk rLt|YSX|jD]0\}}} | j} |rt| || krT| | | qTt|S)a)Return a list of all packages providing a package. Return a list of packages which provide the virtual package of the specified name. If 'candidate_only' is False, return all packages with at least one version providing the virtual package. Otherwise, return only those packages where the candidate version provides the virtual package. If 'include_nonvirtual' is True then it will search for all packages providing pkgname, even if pkgname is not itself a virtual pkg. ) rNr>rr<rrmroZ provides_listZ parent_pkgrr}) r*rZcandidate_onlyZinclude_nonvirtualZ providersrZvpZprovidesZ providesverversionr~rrrget_providing_packages s  zCache.get_providing_packagesrc CsDttjd(|rtjd}tjd}tjd}tjdtj|tjddtjddt }| n|j }z||dkrt j j}z|j|||} Wn*tk r} z t| W5d} ~ XYnX| s|rtn| WW5QRSW5|r4tjd|tjd|tjd|XW5QRXdS)aRun the equivalent of apt-get update. You probably want to call open() afterwards, in order to utilise the new cache. Otherwise, the old cache will be used which can lead to strange bugs. The first parameter *fetch_progress* may be set to an instance of apt.progress.FetchProgress, the default is apt.progress.FetchProgress() . sources_list -- Update a alternative sources.list than the default. Note that the sources.list.d directory is ignored in this case zDir::State::ListszDir::Etc::sourcelistzDir::Etc::sourcepartszAPT::List-CleanupZxxx0N)r"r%rMrSfindrNr&r'rOrArjrBrhrVrirr<update SystemErrorr) r*fetch_progressZpulse_intervalZraise_on_errorZ sources_listZold_sources_listZold_sources_list_dZ old_cleanupZslistrr.rrrr*sH       z Cache.updatecCsz |Wntk r(|YnXt}|r>tz||}W5|rZtXz |Wntk r| YnX|S)aY The first parameter *pm* refers to an object returned by apt_pkg.PackageManager(). The second parameter *install_progress* refers to an InstallProgress() object of the module apt.progress. This releases a system lock in newer versions, if there is any, and reestablishes it afterwards. ) Z startUpdateAttributeErrorZ start_updater%Zpkgsystem_is_lockedZpkgsystem_unlock_innerZpkgsystem_lock_innerrZ finishUpdateZ finish_update)r*rinstall_progressZ did_unlockrrrrinstall_archives]s    zCache.install_archivesc Cs|dkrtjj}|dkr(tjj}|dk s4ttt|j }t |}|j d| |||}| ||}||jkrqn,||jkrtdn||jkrn td||q\W5QRXW5QRX||jkS)a!Apply the marked changes to the cache. The first parameter, *fetch_progress*, refers to a FetchProgress() object as found in apt.progress, the default being apt.progress.FetchProgress(). The second parameter, *install_progress*, is a apt.progress.InstallProgress() object. The keyword-only parameter *allow_unauthenticated* specifies whether to allow unauthenticated downloads. If not specified, it defaults to the configuration option `APT::Get::AllowUnauthenticated`. NzinstallArchives() failedzrrTrrZRESULT_COMPLETEDZ RESULT_FAILEDrZRESULT_INCOMPLETEZshutdown)r*rrrrrrrrrcommits0           z Cache.commitcCs|jdS)z Unmark all changes N)r>initrYrrrclearsz Cache.clearcCs|ddS)z@ called internally if the cache has changed, emit a signal then r6NrgrYrrrr6szCache.cache_post_changecCs|ddS)zS called internally if the cache is about to change, emit a signal then rNrrYrrrrszCache.cache_pre_changecCs>|dkrtdtd||jkr*g|j|<|j||dS)zConnect to a signal. .. deprecated:: 1.0 Please use connect2() instead, as this function is very likely to cause a memory leak. r5zAconnect() likely causes a reference cycle, use connect2() insteadN)warningswarnRuntimeWarningrCr)r*rcrdrrrrLs   z Cache.connectcOs.||jkrg|j|<|j||||fdS)a;Connect to a signal. The callback will be passed the cache as an argument, and any arguments passed to this function. Make sure that, if you pass a method of a class as your callback, your class does not contain a reference to the cache. Cyclic references to the cache can cause issues if the Cache object is replaced by a new one, because the cache keeps a lot of objects and tens of open file descriptors. currently only used for cache_{post,pre}_{changed,open}. .. versionadded:: 1.0 N)rDrrbrrrconnect2s  zCache.connect2cCs t|jS)aReturn an `ActionGroup` object for the current cache. Action groups can be used to speedup actions. The action group is active as soon as it is created, and disabled when the object is deleted or when release() is called. You can use the action group as a context manager, this is the recommended way:: with cache.actiongroup(): for package in my_selected_packages: package.mark_install() This way, the action group is automatically released as soon as the with statement block is left. It also has the benefit of making it clear which parts of the code run with a action group and which don't. )r%Z ActionGroupr>rYrrr actiongroupszCache.actiongroupcCsDtjtjd}ttj|dD]}t|dr(dSq(dS)zReturn True if the dpkg was interrupted All dpkg operations will fail until this is fixed, the action to fix the system if dpkg got interrupted is to run 'dpkg --configure -a' as root. r8Zupdatesz[0-9]*TF) r&r'dirnamer%rMZ find_filelistdirr(fnmatch)r*Zdpkg_status_dirrarrrdpkg_journal_dirtys   zCache.dpkg_journal_dirtycCs|jjS)z7Return the number of packages with broken dependencies.)r> broken_countrYrrrrszCache.broken_countcCs|jjS)z2Return the number of packages marked for deletion.)r>Z del_countrYrrr delete_countszCache.delete_countcCs|jjS)z6Return the number of packages marked for installation.)r>Z inst_countrYrrr install_count"szCache.install_countcCs|jjS)z-Return the number of packages marked as keep.)r> keep_countrYrrrr(szCache.keep_count)NNF)N)N)F)N)NNN)TF)NrTN)NNN)0rrrrr+rXr5rRrgrUrkr]r,r/rrr}rr|rrrrnrrpropertyrrrrrrrrrrrrr6rrLrrrrrrrrrrrr2ds .         $  "  ! 3# :    r2c@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)ProblemResolverzuResolve problems due to dependencies and conflicts. The first argument 'cache' is an instance of apt.Cache. cCst|j|_||_dSr)r%rr> _resolverr<r*cacherrrr+5szProblemResolver.__init__cCs|j|jdS)z'Reset the package to the default state.N)rrrpr*rrrrrr:szProblemResolver.clearcCs|j|jdS)z)Protect a package so it won't be removed.N)rprotectrprrrrr?szProblemResolver.protectcCs|j|jdS)zMark a package for removal.N)rrurprrrrruDszProblemResolver.removecCs"|j|j|jdS)z:Resolve dependencies, try to remove packages where needed.N)r<rrresolver6rYrrrrIs  zProblemResolver.resolvecCs"|j|j|jdS)z4Resolve dependencies, do not try to remove packages.N)r<rrresolve_by_keepr6rYrrrrPs  zProblemResolver.resolve_by_keepN) rrrrr+rrrurrrrrrr/src@seZdZdZddZdS)Filterz Filter base class cCsdS)zn Filter function, return True if the package matchs a filter criteria and False otherwise Trr*rwrrrapply^sz Filter.applyNrrrrrrrrrr[src@seZdZdZddZdS)MarkedChangesFilterz( Filter that returns all marked changes cCs|js|js|jrdSdSdS)NTF)Zmarked_installZ marked_deleteZmarked_upgraderrrrriszMarkedChangesFilter.applyNrrrrrrfsrc@seZdZdZddZdS)InstalledFilterzMFilter that returns all installed packages. .. versionadded:: 1.0.0 cCs|jSr)Z is_installedrrrrrwszInstalledFilter.applyNrrrrrrqsrc@s0eZdZdZddZddZddZdd Zd S) _FilteredCacheHelperz:Helper class for FilteredCache to break a reference cycle.cCs,i|_g|_|d|j|d|jdS)Nr6r4) _filtered_filtersrfilter_cache_post_changerrrrr+sz_FilteredCacheHelper.__init__cCs:i|_|D]*}|jD]}||rd|j|j<q qq dS)z internal helper to refilter TN)rrrrc)r*rrwrarrr_reapply_filters    z$_FilteredCacheHelper._reapply_filtercCsg|_|j|dSzSet the current active filter.N)rrr*filterrrr set_filtersz_FilteredCacheHelper.set_filtercCs||dSz;Called internally if the cache changes, emit a signal then.N)rrrrrrsz-_FilteredCacheHelper.filter_cache_post_changeN)rrrrr+rrrrrrrr|s   rc@sbeZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS) FilteredCacheza A package cache that is filtered. Can work on a existing cache or create a new one NcCs*|dkrt||_n||_t|j|_dSr)r2rr_helper)r*rrVrrrr+s zFilteredCache.__init__cCs t|jjSr)rlrrrYrrrrszFilteredCache.__len__cCs |j|SrrrrrrrszFilteredCache.__getitem__ccs|jjD]}|j|VqdSr)rrr)r*rrrrrs zFilteredCache.__iter__cCs |jjSr)rrrnrYrrrrnszFilteredCache.keyscCs||kSrrrrrrrszFilteredCache.has_keycCs2z|j|j|jjkWStk r,YdSXdSr)rrcrrrorrrrrszFilteredCache.__contains__cCs|j||jdSr)rrrr6rrrrrs zFilteredCache.set_filtercCs|j|jdSr)rrrrYrrrrsz&FilteredCache.filter_cache_post_changecCs t|j|S)z)we try to look exactly like a real cache.)getattrrrrrr __getattr__szFilteredCache.__getattr__)NN)rrrrr+rrrrnrrrrrrrrrrs rcCs tddS)Nzcache pre changedprintrrrrcache_pre_changedsrcCs tddS)Nzcache post changedrrrrrcache_post_changedsrcCstdtttjj}|dt |dt td|k|d}t|j tt || D]}||j |ksjtqj||}tt ||D]}|j stqdD]}tj|st|qtjddt|j}ttjj}|||dtd t|}|jdt |jdt |j|ttt || D]}|||j ksbtqbtt |td ttjj d }|jdt |jdt |j|ttt || D]}|||j kstqtt |dS) zInternal test code.zCache self testrr6Zaptitude) /tmp/pytestz/tmp/pytest/partialr;rNz.Testing filtered cache (argument is old cache)z$Testing filtered cache (no argument))rV)!rr%rr2rhrVrrrrrrcrlrnrrrr&r'rPmkdirrMrNrr>rrrrrrrri)rrwrrrrrZfilteredrrr_testsV                    r__main__)1Z __future__rrr&rrEtypingrrrrrrr r r r r ImportErrorr%Z apt.packagerrZapt.progress.textrhZapt.progress.baserrrIOErrorrrrr Exceptionr!objectr"r2rrrrrrrrrrrrrrsd 4P,   $<9