
    Vhc                    D    d Z ddlmZ ddlZddlZd Zedk(  r e        yy)z"Check for unwanted symbolic links.    )annotationsNc                 D   t        j                         t         j                  j                  z   } t        j
                  dd xs, t        j                  j                         j                         D ],  }t         j                  j                  |j                  t         j                  j                              sKt         j                  j                  |      st        d|z         y|j                  t         j                  j                        rt        d|z         t         j                  j                  |      }|j                  |       rt        |dt         j                  j!                  |t         j                  j#                  |                   / y)zMain entry point.   Nz#%s: broken symlinks are not allowedz+%s: symlinks to directories are not allowedz1: symlinks outside content tree are not allowed: )osgetcwdpathsepsysargvstdinread
splitlinesislinkrstripexistsprintendswithrealpath
startswithrelpathdirname)root_dirr   	real_paths      h/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_util/controller/sanity/code-smell/symlinks.pymainr      s"   yy{RWW[[(H=		 0 ; ; = ww~~dkk"''++67ww~~d#7$>?==%?$FGGG$$T*	##H-TSUSZSZSbSbclnpnunun}n}  C  oD  TE  F  G!    __main__)__doc__
__future__r   r   r
   r   __name__ r   r   <module>r"      s*    ( " 	 
. zF r   