c ddlZddlZddlZddlZddlZddlZddlZddlmZejZdZ e de de de de dGd d Z y) N)PIPEc|SN)es r "sqz;Ubuntu Archive Automatic Signing Key z:Ubuntu CD Image Automatic Signing Key zBUbuntu Archive Automatic Signing Key (2012) zAUbuntu CD Image Automatic Signing Key (2012) zBUbuntu Extras Archive Automatic Signing Key c2eZdZddZdZdZdZdZdZy) AptAuthc||_tj|_tj j |jd|_t|jd5}|jd|jzddd|jtjd<tj|jy#1swYFxYw)Nzapt.confwz DIR "%s"; APT_CONFIG)rootdirtempfilemkdtemptmpdirospathjoinaptconfopenwriteenvironatexitregister_cleanup_tmpdir)selfrfs r__init__zAptAuth.__init__,s &&( ww||DKK< $,, $ 2 GGMDLL0 1 2#'<< < ,,- 2 2s &C  CcBtj|jyr)shutilrmtreer)rs rrzAptAuth._cleanup_tmpdir5s dkk"r c gd}g}tj|ttd}d}|jj D]}|j d}|ddvr|d}|dd k(r>|d }t jjt|d j}|si|jd d t|d}|S)N)/usr/bin/apt-key--quietadvz --with-colonsz--batchz--fixed-list-modez --list-keysT)stdoutstderrtext:r)pubuid r-  ) subprocessrunrr( splitlinessplitdatetimedate fromtimestampint isoformatappend_) rcmdresprocessnamelinefieldskeyexpirys rlistz AptAuth.list8st..T$TJNN--/ DZZ_FayN*ayayE!Qi!44S^DNNP JJc61T7; <D  r c`dddd|g}tj|tjdk(S)Nr%r& --fakerootaddr)rr4r5r returncode)rfilenamer?s rrJz AptAuth.addJs.!9lE8L~~c$/::a??r cZgd}tj|tjdk(S)N)r%r&rIupdaterKrrL)rr?s rrPzAptAuth.updateNs#E~~c$/::a??r c`dddd|g}tj|tjdk(S)Nr%r&rIrmrKrrL)rrEr?s rrRz AptAuth.rmRs.!9lD#F~~c$/::a??r N)/) __name__ __module__ __qualname__r rrGrJrPrRrr rr r +s#.#$@@@r r ) rr8gettextrr"r4rrr>N_r rr rrYsj,  OO@A?@GHFGGH)@)@r