ó TONc@s}ddlZddlZddlZddlZddlZddlZddlZdejj fd„ƒYZ d„Z dS(iÿÿÿÿNtDirectoryBundlecBs5eZdZdd„Zd„Zd„Zd„ZRS(s1The DirectoryBundle class assists in the conversion of a directory tree to a pkg(5) package by traversing the tree and emitting actions for all files, directories, and links found therein. Paths are published relative to the given directory. Hardlinks are resolved as long as their companions are in the tree as well. All owners are set to "root" and groups to "bin", as the ownership information is not considered to be valid. These can be set by the caller once the action has been emitted. cCs[tjj|ƒ}||_||_tjj|jƒ|_d|_||_ d|_ dS(N( tostpathtnormpathtfilenametrootdirtbasenametpkgnametNonetinodest targetpathstpkg(tselfRR ((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyt__init__1s    c csÈ|jdkrfi|_xK|jD]=}tjj|j|ƒ}tj|ƒ}||j|jx7|jƒD])\}}|j|Œ}|r |Vq q WdS(N(Rtaction(R Rtdatatact((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyt__iter__Jsc Cs´|j}tjj||ƒ}tj|ƒ}ttj|j ƒƒ}tjj |j ƒ}tj |j ƒr9|j }||jks“||jkrò|jdkr¸|jj||ƒntjjjt|dƒd|ddddd|d |ƒStjj|j|tjj|ƒƒ}tjjjd|d |ƒSnwtj|j ƒrptjjjd tj|ƒd|ƒStj|j ƒr°tjjj d |d|ddddd|ƒSdS( NitrbtmodetownerRtgrouptbinRt timestampttarget(!RR tmisctrelpathRRtocttstattS_IMODEtst_modettime_to_timestamptst_mtimetS_ISREGRR R tst_nlinkt setdefaulttactionstfilet FileActiontopenRtdirnamethardlinktHardLinkActiontS_ISLNKtlinkt LinkActiontreadlinktS_ISDIRt directorytDirectoryAction( R RRtpubpathRRR#tinodeR$((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyRPs4    ((t__name__t __module__t__doc__R RRR(((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyR$s    cCstjtj|ƒjƒS(N(R(R;RR*(R((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyttestss( RR(tpkg.miscR t pkg.bundletpkg.actions.filetpkg.actions.linktpkg.actions.hardlinktbundletBundleRRC(((s@/usr/lib/python2.7/vendor-packages/pkg/bundle/DirectoryBundle.pyts       O