From 4b6c930ca908b3e6c0c56ca099310ba79398580c Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 23 Jul 2013 00:30:39 +0200 Subject: [PATCH] Move hardcoded atoms of cvs, git and rsync to portage.const module and fix category of git atom. --- pym/_emerge/actions.py | 6 +++--- pym/portage/const.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 80afb0b62..11a869854 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2112,7 +2112,7 @@ def _sync_repo(repo, settings, trees, myopts): # git directly. if portage.process.find_binary("git") is None: msg = ["Command not found: git", - "Type \"emerge dev-util/git\" to enable git support."] + "Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM] for l in msg: writemsg_level("!!! %s\n" % l, level=logging.ERROR, noiselevel=-1) @@ -2140,7 +2140,7 @@ def _sync_repo(repo, settings, trees, myopts): rsync_binary = portage.process.find_binary("rsync") if rsync_binary is None: print("!!! /usr/bin/rsync does not exist, so rsync support is disabled.") - print("!!! Type \"emerge net-misc/rsync\" to enable rsync support.") + print("!!! Type \"emerge %s\" to enable rsync support." % portage.const.RSYNC_PACKAGE_ATOM) return os.EX_UNAVAILABLE mytimeout=180 @@ -2540,7 +2540,7 @@ def _sync_repo(repo, settings, trees, myopts): elif repo.sync_type == "cvs": if not os.path.exists("/usr/bin/cvs"): print("!!! /usr/bin/cvs does not exist, so CVS support is disabled.") - print("!!! Type \"emerge dev-vcs/cvs\" to enable CVS support.") + print("!!! Type \"emerge %s\" to enable CVS support." % portage.const.CVS_PACKAGE_ATOM) return os.EX_UNAVAILABLE cvs_root = syncuri if cvs_root.startswith("cvs://"): diff --git a/pym/portage/const.py b/pym/portage/const.py index 087c0e78f..c05b1c09a 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -79,6 +79,9 @@ REPO_NAME_LOC = "profiles" + "/" + REPO_NAME_FILE PORTAGE_PACKAGE_ATOM = "sys-apps/portage" LIBC_PACKAGE_ATOM = "virtual/libc" OS_HEADERS_PACKAGE_ATOM = "virtual/os-headers" +CVS_PACKAGE_ATOM = "dev-vcs/cvs" +GIT_PACKAGE_ATOM = "dev-vcs/git" +RSYNC_PACKAGE_ATOM = "net-misc/rsync" INCREMENTALS = ("USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES", "ACCEPT_KEYWORDS", -- 2.26.2