mò ªËŽGc@s(dkTdkTdefd„ƒYZdS((t*tChownRcBsVtZdZdZdZeƒd„Zd„Zd„Zd„Z d„Z d „Z RS( Nschange ownership recursivelysChange Ownership RecursivelytchownRcCs||_||_g|_dS(N(townertselft_ChownR__ownert directoryt_ChownR__directoryt_ChownR__originalOwners(RRR((t`/home/faculty/youssef/public_html/pacman/sample_cache/tarballs/pre/tmp/pacman-3.29/src/ChownR.pyt__init__ s  cCs|id|iS(Ns/... to (RRR(R((R tstrscCstd|iƒd|i ƒS(Nt[s] has not been set yet.(tReasonRR tacquired(R((R t satisfiedscCsSd„}d}tii|i||ƒ|o tƒSntd|idƒSdS(NcCsYt|ƒp d}nx;|D]3}tii||ƒ}t|ƒp d}PqqWdS(Ni(t writeAccesstdirnametargtnamestnametostpathtjoin(RRRRR((R tvisits  is Directory [s&] contains files with no write access.(RRRRtwalkRRR (RRR((R t satisfiables   c stƒ}tˆiƒ\}‰‰tˆi ƒˆ_ tdˆi dt i i ˆi ƒ ƒ}|i ƒo¢tˆi ƒˆ_ ‡‡‡d†}|o[d}yt i iˆi ||ƒWqttfj o|idˆidƒqXq |idˆidƒn|S( NsFile [s] doesn't exist. Can't chownR.cskxd|D]\}ttii||ƒƒ}titii||ƒˆˆƒˆi i |||fƒqWdS(N(RtfilenameRRRRRt originalOwnertchowntuidtgidRRtappend(RRRRR(RRR(R R-s "isFailure chownging files in [s/...].sUser [s] no longer exists.(R treasontuseridsRRtgotitRRtfullpathRRRtexiststokRRRtIOErrortOSErrort _ChownR__path(RR#RRR!RR((RRRR tacquire%s * !cCsütƒ}xìt|iƒdjoÕ|iƒoÈ|id\}}}t |ƒ\}}}|o}y3t it ii||ƒ||ƒ|iiƒWqóttfj o1|idtt ii||ƒƒdƒqóXq |id|dƒq W|S(Niiÿÿÿÿs!Can't restore ownership of file [s].sUser [s] no longer exists.(R R!tlenRRtisNulltownRRR"R#RRRRRRtpopR'R(R$(RR-R#RR!RRR((R tretract<s #"3( t__name__t __module__ttypettitletactiont getusernameR R RRR*R/(((R Rs    N(t EnvironmenttBaseR(R((R t?s