ReddlZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z mZddlmZmZejeZGdd eZd ed ed efd ZdS)N)Values)List)Command)ERRORSUCCESS) FAVORITE_HASH STRONG_HASHES) read_chunks write_outputcBeZdZdZdZdZd dZdedee de fd Z dS) 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] ...TreturnNc |jdddtdtddt|jd|jdS) Nz-az --algorithm algorithmstorez$The hash algorithm to use: one of {}z, )destchoicesactiondefaulthelpr)cmd_opts add_optionr rformatjoinparserinsert_option_group)selfs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/commands/hash.py add_optionszHashCommand.add_optionssw    !!7>> -(( !  ''4=99999optionsargsc |s+|jtjtS|j}|D]"}t d||t||#tS)Nz%s: --hash=%s:%s) r print_usagesysstderrrrr _hash_of_filer)rr!r"rpaths rrunzHashCommand.run(so  K # #CJ / / /L%   D #T9mD)6T6T    r )rN) __name__ __module__ __qualname____doc__usageignore_require_venvrrrstrintr)r rr r sl )E : : : : 6 c s      r r r(rrct|d5}tj|}t|D]}|| dddn #1swxYwY|S)z!Return the hash digest of a file.rbN)openhashlibnewr update hexdigest)r(rarchivehashchunks rr'r'5s dD  W{9%% ))  E KK      >>  srFs 22222299999999CCCCCCCC>>>>>>>>  8 $ $#####'###Lr