mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-09-20 01:57:16 +00:00
Be more tolerant of apt-cache warnings.
This commit is contained in:
parent
45e4578f79
commit
19a0253e65
|
@ -65,7 +65,7 @@ func getPackages(names []string) AptPackages {
|
||||||
pkg.Name = strings.TrimSpace(strings.Split(line, ":")[1])
|
pkg.Name = strings.TrimSpace(strings.Split(line, ":")[1])
|
||||||
} else if strings.HasPrefix(line, "Version: ") {
|
} else if strings.HasPrefix(line, "Version: ") {
|
||||||
pkg.Version = strings.TrimSpace(strings.Split(line, ":")[1])
|
pkg.Version = strings.TrimSpace(strings.Split(line, ":")[1])
|
||||||
} else if strings.HasPrefix(line, "N: ") || strings.HasPrefix(line, "E: ") {
|
} else if strings.HasPrefix(line, "N: Unable to locate package ") || strings.HasPrefix(line, "E: ") {
|
||||||
if !contains(errorMessages, line) {
|
if !contains(errorMessages, line) {
|
||||||
errorMessages = append(errorMessages, line)
|
errorMessages = append(errorMessages, line)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,9 @@ func (r *RunResult) expectSuccessfulOut(expected string) {
|
||||||
r.TestContext.Errorf("Error running command: %v", r.Err)
|
r.TestContext.Errorf("Error running command: %v", r.Err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if r.Stderr != "" {
|
||||||
|
r.TestContext.Errorf("Unexpected stderr messages found.\nExpected: none\nActual:\n'%s'", r.Stderr)
|
||||||
|
}
|
||||||
if r.Stdout != expected+"\n" { // Output will always have a end of output newline.
|
if r.Stdout != expected+"\n" { // Output will always have a end of output newline.
|
||||||
r.TestContext.Errorf("Unexpected stdout found.\nExpected:\n'%s'\nActual:\n'%s'", expected, r.Stdout)
|
r.TestContext.Errorf("Unexpected stdout found.\nExpected:\n'%s'\nActual:\n'%s'", expected, r.Stdout)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue