-#!/usr/bin/python3
+#!/usr/bin/env python3
import codecs
import subprocess
print()
if explicit_pkg_list:
- print("# Found explicitly installed packages to keep")
+ print("# Found explicitly installed packages to keep or remove")
print("echo " + " ".join(explicit_pkg_list) + " | tr ' ' '\\n' >> ~/.pacorphan/keep")
+ print("sudo pacman -D --asdeps " + " ".join(explicit_pkg_list))
print()
if mark_explicit_list:
pkg = strip_comment(pkg).strip()
if not pkg:
continue
- if filename[0] != "~":
+ if filename[0] != "~" and pkg[0] != "~":
if pkg in result:
print("# Duplicate entry:", pkg, "in file", filename)
continue
result.append(pkg)
else:
+ pkg = pkg.strip("~")
if pkg not in result:
print("# Redundant removal:", pkg, "in file", filename)
continue