doebuild: deprecate returnpid
authorZac Medico <zmedico@gentoo.org>
Sat, 6 Jul 2013 22:06:28 +0000 (15:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 6 Jul 2013 22:06:28 +0000 (15:06 -0700)
This case is not supported, since it bypasses the EbuildPhase class
which implements important functionality (including post phase hooks
and IPC for things like best/has_version and die).

pym/portage/package/ebuild/doebuild.py

index 8444e194925098b6effb6158d40dd0b9fde39f5d..23ca2385fbb5d50280b34a220c66d070f443a322 100644 (file)
@@ -583,6 +583,15 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
                writemsg("\n", noiselevel=-1)
                return 1
 
+       if returnpid and mydo != 'depend':
+               # This case is not supported, since it bypasses the EbuildPhase class
+               # which implements important functionality (including post phase hooks
+               # and IPC for things like best/has_version and die).
+               warnings.warn("portage.doebuild() called "
+                       "with returnpid parameter enabled. This usage will "
+                       "not be supported in the future.",
+                       DeprecationWarning, stacklevel=2)
+
        if mydo == "fetchall":
                fetchall = 1
                mydo = "fetch"
@@ -1507,6 +1516,12 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
 def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
        logfile=None, fd_pipes=None, returnpid=False):
 
+       if returnpid:
+               warnings.warn("portage.spawnebuild() called "
+                       "with returnpid parameter enabled. This usage will "
+                       "not be supported in the future.",
+                       DeprecationWarning, stacklevel=2)
+
        if not returnpid and \
                (alwaysdep or "noauto" not in mysettings.features):
                # process dependency first