Add a README file

This commit is contained in:
Phyks 2015-04-06 19:25:37 +02:00
parent a31e10d3db
commit 1ee7ec6207
1 changed files with 7 additions and 12 deletions

View File

@ -140,14 +140,14 @@ def list_installed_aur_packages():
return pacman_raw return pacman_raw
def list_new_config_files(): def list_new_config_files(ignore_binaries=True):
""" """
List all the config files under /etc that are not directly coming from a List all the config files under /etc that are not directly coming from a
packet. packet.
""" """
# Get all the config files under /etc owned by a package # Get all the config files under /etc owned by a package
pacman = subprocess.Popen(["pacman", "-Qq"], pacman = subprocess.Popen(["pacman", "-Qq"],
stdout=subprocess.PIPE) stdout=subprocess.PIPE)
pacman_raw = subprocess.check_output(["pacman", "-Ql", "-"], pacman_raw = subprocess.check_output(["pacman", "-Ql", "-"],
stdin=pacman.stdout) stdin=pacman.stdout)
pacman_raw = pacman_raw.decode("utf-8").strip() pacman_raw = pacman_raw.decode("utf-8").strip()
@ -162,16 +162,11 @@ def list_new_config_files():
diff = [] diff = []
# Filter etc files # Filter etc files
for i in raw_diff: for i in raw_diff:
if i.startswith("/etc/certs/"):
continue
if i.startswith("/etc/ssl/certs"):
continue
if i.startswith("/etc/ca-certificates"):
continue
# Do not append if binary file # Do not append if binary file
check_binary_raw = subprocess.check_output(["file", i]) if ignore_binaries:
check_binary_raw = check_binary_raw.decode("utf-8") check_binary_raw = subprocess.check_output(["file", i])
if "text" not in check_binary_raw: check_binary_raw = check_binary_raw.decode("utf-8")
continue if "text" not in check_binary_raw:
continue
diff.append(i) diff.append(i)
return diff return diff