관리-도구
편집 파일: needs_restarting.cpython-36.pyc
3 �f`. � @ s$ d dl mZ d dl mZ d dl mZ d dl mZ d dlmZmZ d dlZd dl Zd dl Z d dlZd dlZd dl Z d dlZd dlZddd d ddd ddg ZdgZdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� ZG d#d$� d$e�ZG d%d&� d&e�ZejjG d'd(� d(ej j!��Z"dS ))� )�absolute_import)�division)�print_function)�unicode_literals)�logger�_NZkernelz kernel-rtZglibczlinux-firmwareZsystemd�dbuszdbus-brokerzdbus-daemonZ microcode_ctl�zlibc s� t jj| �st� S t� }xjt j| �D ]\}t jj|�s$|jd� rBq$tt jj| |���&}x|D ]}|j |j � |f� q\W W dQ R X q$W t� � x4|jj� j � jdd� |D �d�D ]}� j |j� q�W x6� fdd�|D �D ] \}}tjtdj||d��� q�W � S ) z� Provide filepath as string if single dir or list of strings Return set of package names contained in files under filepath z.confNc S s h | ]}|d �qS )r � )�.0�xr r �&/usr/lib/python3.6/needs_restarting.py� <setcomp>B s z'get_options_from_dir.<locals>.<setcomp>)�namec s h | ]}|d � kr|�qS )r r )r r )�packagesr r r D s z`No installed package found for package name "{pkg}" specified in needs-restarting file "{file}".)�pkg�file)�os�path�exists�set�listdir�isdir�endswith�open�join�add�rstrip�sack�query� installed�filterr r �warningr �format)�filepath�baseZoptionsr �fp�liner r r )r r �get_options_from_dir0 s"