From 5a37c1c85b2ac7806de71990ce9291988f12f5a5 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 11 Jun 2015 03:47:35 +0300 Subject: [PATCH] Feature: added excluded pkgs from removal --- slpkg/pkg/manager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index badd1e9a..8bbc39d4 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -175,8 +175,19 @@ class PackageManager(object): removes = [] deps = dependencies.split() deps.append(package) + print("") + Msg().template(78) + print("| Enter some packages splitting with comma ',' for be excluded\n" + "| from the removal or hit Enter to continue:") + Msg().template(78) + try: + skip = raw_input("| > ").split(",") + except KeyboardInterrupt: + print("") + sys.exit(0) for dep in deps: - if find_package(dep + self.meta.sp, self.meta.pkg_path): + if (dep not in skip + and find_package(dep + self.meta.sp, self.meta.pkg_path)): subprocess.call("removepkg {0} {1}".format(self.flag, dep), shell=True) removes.append(dep)