Move hardcoded atoms of cvs, git and rsync to portage.const module and fix category...
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 22 Jul 2013 22:30:39 +0000 (00:30 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 22 Jul 2013 22:30:39 +0000 (00:30 +0200)
pym/_emerge/actions.py
pym/portage/const.py

index 80afb0b6226213831dd4ef87faedf97a1237c423..11a86985436a611cec3e50597272c63a4cb4724d 100644 (file)
@@ -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://"):
index 087c0e78f4c638348a49e29372e7c7faa4b435e5..c05b1c09a18e709cab90e504826738cbe6ddb060 100644 (file)
@@ -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",