|
|
|
|
@ -157,6 +157,9 @@ func (d *Device) Install(path string) error {
|
|
|
|
|
if line == "Success" { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
if !strings.HasPrefix(line, "Failure [INSTALL_") { |
|
|
|
|
return errors.New("unknown result: " + line) |
|
|
|
|
} |
|
|
|
|
code := line[len("Failure [INSTALL_") : len(line)-1] |
|
|
|
|
switch code { |
|
|
|
|
case "FAILED_ALREADY_EXISTS": |
|
|
|
|
@ -267,6 +270,9 @@ func (d *Device) Uninstall(pkg string) error {
|
|
|
|
|
if line == "Success" { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
if !strings.HasPrefix(line, "Failure [DELETE_") { |
|
|
|
|
return errors.New("unknown result: " + line) |
|
|
|
|
} |
|
|
|
|
code := line[len("Failure [DELETE_") : len(line)-1] |
|
|
|
|
switch code { |
|
|
|
|
case "FAILED_INTERNAL_ERROR": |
|
|
|
|
|