fix found logic
This commit is contained in:
parent
160ac6a667
commit
c223b0531f
1 changed files with 3 additions and 1 deletions
|
@ -28,16 +28,18 @@ func run() error {
|
||||||
kernelPrefix := "Filename: pool/main/r/raspberrypi-firmware/raspberrypi-kernel_"
|
kernelPrefix := "Filename: pool/main/r/raspberrypi-firmware/raspberrypi-kernel_"
|
||||||
version := ""
|
version := ""
|
||||||
versionPrefix := "Version: "
|
versionPrefix := "Version: "
|
||||||
|
found := false
|
||||||
err := scanOnlineTextFile(packagesURL, func(s string) bool {
|
err := scanOnlineTextFile(packagesURL, func(s string) bool {
|
||||||
if strings.HasPrefix(s, versionPrefix) {
|
if strings.HasPrefix(s, versionPrefix) {
|
||||||
version = s[len(versionPrefix):]
|
version = s[len(versionPrefix):]
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(s, kernelPrefix) {
|
if strings.HasPrefix(s, kernelPrefix) {
|
||||||
|
found = true
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
if version == "" {
|
if !found {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue