o nnh,@s0ddlmZdZddlmZGdddeZdS)) annotationsa  name: sh short_description: "POSIX shell (/bin/sh)" version_added: historical description: - This shell plugin is the one you want to use on most Unix systems, it is the most compatible and widely installed shell. extends_documentation_fragment: - shell_common ) ShellBasec@sHeZdZedZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd dZdS) ShellModule)shzshbashdashkshrecho; z> /dev/null 2>&1z&&z||z"`z`"()cCsh||}dt|||j|jd}d|||jd|||jg}d|j|}d|||j|f}|S)Nzrc=flag; [ -r %(p)s ] %(shell_or)s rc=2; [ -f %(p)s ] %(shell_or)s rc=1; [ -d %(p)s ] %(shell_and)s rc=3; %(i)s -V 2>/dev/null %(shell_or)s rc=4; [ x"$rc" != "xflag" ] %(shell_and)s echo "${rc} "%(p)s %(shell_and)s exit 0)pi shell_andshell_ora({0} -c 'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1();{2}afile = open("'{1}'", "rb"){2}buf = afile.read(BLOCKSIZE){2}while len(buf) > 0:{2} hasher.update(buf){2} buf = afile.read(BLOCKSIZE){2}afile.close(){2}print(hasher.hexdigest())' 2>/dev/null)z({0} -c 'import sha; BLOCKSIZE = 65536; hasher = sha.sha();{2}afile = open("'{1}'", "rb"){2}buf = afile.read(BLOCKSIZE){2}while len(buf) > 0:{2} hasher.update(buf){2} buf = afile.read(BLOCKSIZE){2}afile.close(){2}print(hasher.hexdigest())' 2>/dev/null)z %s z%s; %s %s (echo '0 '%s))quotedict _SHELL_AND _SHELL_ORformat_SHELL_EMBEDDED_PY_EOLjoin)selfpath python_interpshell_escaped_pathtestcsumscmdr!C/usr/local/lib/python3.10/dist-packages/ansible/plugins/shell/sh.pychecksum,s zShellModule.checksumN)__name__ __module__ __qualname__ frozensetCOMPATIBLE_SHELLS SHELL_FAMILYECHO COMMAND_SEPr_SHELL_REDIRECT_ALLNULLrr_SHELL_SUB_LEFT_SHELL_SUB_RIGHT_SHELL_GROUP_LEFT_SHELL_GROUP_RIGHTr#r!r!r!r"rs rN) __future__r DOCUMENTATIONansible.plugins.shellrrr!r!r!r"s