ó –­PSc@s€dZddlZddlZddlZddljZddlZddlj j Z ddl Z dej fd„ƒYZdS(s“module describing a directory packaging object This module contains the DirectoryAction class, which represents a directory-type packaging object.iÿÿÿÿNtDirectoryActioncBseZdZgZdZdZdZeZeZ dZ e j eZ d„Zd„Zd„Zd „Zd „Zd „Zd „Zdd „ZRS(s5Class representing a directory-type packaging object.tdirtpathtmodetownertgroupcCst|jd|jdƒS(NR(tcmptattrs(tselftother((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pytcompare5scCsqtjj||ƒ}d|krmt|jjddƒdƒt|jjddƒdƒkrm|jdƒn|S(s4Returns a list of attributes that have different values between 'other' and 'self'. This differs from the generic Action's differences() method in that it normalizes the 'mode' attribute so that, say, '0755' and '755' are treated as identical.Rt0i(tgenerictActiont differencestintRtgettremove(RR tdiffs((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pyR8s  <cCstjj|jdƒgS(NR(tosRtnormpathR(R((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pytdirectory_referencesGscCsJd}y"t|jjddƒdƒ}Wn*ttfk rT|jd|jƒnXd}}}|j||jƒ\}}|rñy"t|jjddƒdƒ}Wn*ttfk rÒ|jd|j ƒnX|j||j ƒ\}}n|j |j j ƒƒ} |j || ƒtjƒs5|tjO}n|s„y |j| d|d|jƒWq£tk r€} | j| kr‚‚ntj| ƒ} tj| jƒ} | jtjkrÎtj| ƒrÈdS‚n| jtjkræ‚ntj| ƒr,tdƒ| } tj |d| d| d|jƒ‚qtj!| ƒr[|j"| ƒtj#| |ƒqtj| ƒrtj$| |ƒqq£Xn||kr£tj$| |ƒnx'|j%dƒD]}|j&|| ƒq³W| sì||ksì||krFytj'| ||ƒWqFtk rB} | jtj(krC| jtj)krC‚qCqFXndS( s-Client-side method that installs a directory.RitfmriNs¦Unable to create directory %s; it has been replaced with a link. To continue, please remove the link or restore the directory to its original location and try again.tdetailsterrors salvage-from(*tNoneRRRt TypeErrort ValueErrortvalidatetdestination_fmritget_fsobj_uid_gidt origin_fmritget_installed_pathtimagetget_roottfsobj_checkpathtportabletis_admintstattS_IWUSRtmakedirstOSErrortfilenameRtlstattS_IFMTtst_modeterrnotEROFStS_ISDIRtEEXISTtS_ISLNKt_tapxtActionExecutionErrortS_ISREGtsalvagetmkdirtchmodtattrlistt salvage_fromtchowntEPERMtENOSYS(RtpkgplantorigRtomodetoownertogroupRRRtetfstfs_modeterr_txtR;((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pytinstallJsp" "      cKs1|j|tjƒ\}}}}}|||fS(s»Returns a tuple of lists of the form (errors, warnings, info). The error list will be empty if the action has been correctly installed in the given image.(tverify_fsobj_commonR&tS_IFDIR(RtimgtargsR+terrorstwarningstinfotabort((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pytverifyÀs$cCs‹|j|jjƒƒ}ytj|ƒWn[tk r†}|jtjkrPq‡|jtjtj fkr{|j |ƒq‡|jtj kr|j |ƒq‡|jtj kr tj j|ƒr |jjdƒsƒtdƒ|}tj|d|d|d|jƒ‚qƒq‡|jtj krk|jjdƒsƒtdƒ|}tj|d|d|d|jƒ‚qƒq‡|jtjkr‡‚q‡nXdS(NtimplicitsƒUnable to remove %s; it is in use as a mountpoint. To continue, please unmount the filesystem at the target location and try again.RRRsUUnable to remove %s; it is in use by the system, another process, or as a mountpoint.(R R!R"RtrmdirR)R.tENOENTR1t ENOTEMPTYR7tENOTDIRtEBUSYRtismountRRR3R4R5RtEACCES(RR?RRDRG((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pyRÉs4$      cCs[|jdtjj|jdjtjjƒƒdf|jdtjj|jddfgS(swGenerates the indices needed by the search dictionary. See generic.py for a more detailed explanation.tbasenameRN(tnameRRRZRtrstriptsepR(R((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pytgenerate_indicesôs  %c Cs_tjj|d|dtddƒ}|j|jƒƒ|r[tjj||d|ƒ‚ndS(s9Performs additional validation of action attributes that for performance or other reasons cannot or should not be done during Action object creation. An ActionError exception (or subclass of) will be raised if any attributes are not valid. This is primarily intended for use during publication or during error handling to provide additional diagonostics. 'fmri' is an optional package FMRI (object or string) indicating what package contained this action.Rt raise_errorstrequired_attrsRRN(sownersgroup( R R t _validatetFalsetextendt_validate_fsobj_commontpkgtactionstInvalidActionAttributesError(RRRM((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pyRs  (spathsmodesownersgroupN(t__name__t __module__t__doc__t __slots__R[tkey_attrt unique_attrstTruetglobally_identicalt refcountabletnamespace_groupR t _orderdictt ordinalityR RRRHRQRR^RR(((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pyR(s"     v + (RjR.R Rt pkg.portableR$t pkg.actionsRetpkg.client.api_errorstclientt api_errorsR4R&R R(((s;/usr/lib/python2.7/vendor-packages/pkg/actions/directory.pyts