From 927df05697e5495b99fb6a695029c55e52038380 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 13 Jun 2015 16:23:17 +0300 Subject: [PATCH] Fix arguments --- slpkg/main.py | 31 +++++++++++++++---------------- slpkg/slack/patches.py | 5 +++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 885c4691..c951f545 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -191,33 +191,32 @@ class ArgParse(object): def pkg_upgrade(self): """Check and upgrade packages by repository """ - skip = resolve = "" + skip = flag = "" options = ["-c", "--check"] - flag = ["--upgrade", "--skip=", "--resolve-off"] - if flag[2] in self.args: - resolve = flag[2] - index = self.args.index(flag[2]) + flags = ["--upgrade", "--skip=", "--resolve-off"] + if flags[2] in self.args: + flag = flags[2] + index = self.args.index(flags[2]) del self.args[index] if (len(self.args) == 4 and self.args[0] in options and - self.args[2] == flag[0] and - self.args[3].startswith(flag[1])): + self.args[2] == flags[0] and + self.args[3].startswith(flags[1])): skip = "".join(self.args[3].split("=")[1:]).split(",") self.args.pop(3) if (len(self.args) == 3 and self.args[0] in options and - self.args[2] == flag[0]): - if (self.args[1] in self.meta.repositories and - self.args[1] not in ["slack", "sbo"]): + self.args[2] == flags[0] and + self.args[1] in self.meta.repositories): + if self.args[1] not in ["slack", "sbo"]: BinaryInstall(pkg_upgrade(self.args[1], skip), - self.args[1], resolve).start(if_upgrade=True) + self.args[1], flag).start(if_upgrade=True) elif self.args[1] == "slack": if self.meta.only_installed in ["on", "ON"]: BinaryInstall(pkg_upgrade("slack", skip), - "slack", resolve).start(if_upgrade=True) + "slack", flag).start(if_upgrade=True) else: - Patches(skip).start() - elif (self.args[1] == "sbo" and - self.args[1] in self.meta.repositories): - SBoInstall(sbo_upgrade(skip), resolve).start(if_upgrade=True) + Patches(skip, flag).start() + elif self.args[1] == "sbo": + SBoInstall(sbo_upgrade(skip), flag).start(if_upgrade=True) else: usage(self.args[1]) else: diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 19e7b232..4ae90494 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -51,8 +51,9 @@ from slack_version import slack_ver class Patches(object): - def __init__(self, skip): + def __init__(self, skip, flag): self.skip = skip + self.flag = flag self.meta = _meta_ self.version = self.meta.slack_rel self.patch_path = self.meta.slpkg_tmp_patches @@ -133,7 +134,7 @@ class Patches(object): """ Store and return packages for upgrading """ - data = repo_data(self.PACKAGES_TXT, self.step, "slack", flag="") + data = repo_data(self.PACKAGES_TXT, self.step, "slack", self.flag) black = BlackList().packages() for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]): repo_pkg_name = split_package(name)[0]