portageq: Print deprecation warnings for deprecated commands.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 2 Dec 2013 15:17:54 +0000 (16:17 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 2 Dec 2013 15:17:54 +0000 (16:17 +0100)
bin/portageq

index 3dc5c28e108f413a3b5fc676030df7ce342165b6..a50b8055c752d00973171c5005faf74eb750d9f2 100755 (executable)
@@ -677,7 +677,9 @@ def repos_config(argv):
 def portdir(_argv):
        """
        Returns the PORTDIR path.
+       Deprecated in favor of repositories_configuration command.
        """
+       print("WARNING: 'portageq portdir' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
        print(portage.settings["PORTDIR"])
 
 
@@ -698,7 +700,9 @@ def config_protect_mask(_argv):
 def portdir_overlay(_argv):
        """
        Returns the PORTDIR_OVERLAY path.
+       Deprecated in favor of repositories_configuration command.
        """
+       print("WARNING: 'portageq portdir_overlay' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
        print(portage.settings["PORTDIR_OVERLAY"])
 
 
@@ -737,6 +741,8 @@ def envvar(argv):
                return 2
 
        for arg in argv:
+               if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
+                       print("WARNING: 'portageq envvar %s' is deprecated. Use 'portageq repositories_configuration' instead." % arg, file=sys.stderr)
                if verbose:
                        print(arg + "=" + portage._shell_quote(portage.settings[arg]))
                else: