Re3@sddlmZddlZddlZddlZddlmZddlmZm Z ddl m Z m Z ddl mZmZddlmZerddlmZdd lmZejeZGd d d eZd d ZdS))absolute_importN)Command)ERRORSUCCESS) FAVORITE_HASH STRONG_HASHES) read_chunks write_output)MYPY_CHECK_RUNNING)Values)Listc@s:eZdZdZdZdZddZddZdS) HashCommandz Compute a hash of a local package archive. These can be used with --hash in a requirements file to do repeatable installs. z%prog [options] ...TcCs]|jjdddddtdddtd d jd jt|jjd |jdS) Nz-az --algorithmdest algorithmchoicesactionstoredefaulthelpz$The hash algorithm to use: one of {}z, r)cmd_opts add_optionrrformatjoinparserinsert_option_group)selfr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/commands/hash.py add_optionss  zHashCommand.add_optionscCsW|s|jjtjtS|j}x*|D]"}td||t||q-WtS)Nz%s: --hash=%s:%s) r print_usagesysstderrrrr _hash_of_filer)roptionsargsrpathrrrrun+s  zHashCommand.runN)__name__ __module__ __qualname____doc__usageignore_require_venvrr&rrrrr s  r c CsVt|d:}tj|}x!t|D]}|j|q.WWdQRX|jS)z!Return the hash digest of a file.rbN)openhashlibnewrupdate hexdigest)r%rarchivehashchunkrrrr"8s r") __future__rr/loggingr pip._internal.cli.base_commandrpip._internal.cli.status_codesrrpip._internal.utils.hashesrrpip._internal.utils.miscrr pip._internal.utils.typingr optparser typingr getLoggerr'loggerr r"rrrrs   $