ADB uninstall fails with non-zero return code if the package to be
uninstalled does not exist. To allow the installation proceed when
there's no previous package, the non-zero return value should be ignored
for the uninstall step.
There are historical reasons for not relying on -r -d for
install (replace, allow downgrade), which I can't recall right now.
Test: Installed succesfully on device without deqp package.
Bug:
33961937
Change-Id: I401f3861f8d68f352747c041bd60cd372b48134b
if retcode != 0:
raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
-def execArgsInDirectory (args, cwd, linePrefix=""):
+def execArgsInDirectory (args, cwd, linePrefix="", failOnNonZeroExit=True):
def readApplyPrefixAndPrint (source, prefix, sink):
while True:
stdoutJob.start()
stderrJob.start()
retcode = process.wait()
- if retcode != 0:
+ if failOnNonZeroExit and retcode != 0:
raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
def serialApply(f, argsList):
common.execArgsInDirectory([common.ADB_BIN] + extraArgs + [
'uninstall',
'com.drawelements.deqp'
- ], buildRoot, printPrefix)
+ ], buildRoot, printPrefix, failOnNonZeroExit=False)
print printPrefix + "Remove complete\n",
print printPrefix + "Installing dEQP Package from %s...\n" %(buildRoot),