install.go: check if packages exist before trying to install them

Sometimes *-debug packages generated by makepkg are listed in
`makepkg --packagelist`, but are not built when running `makepkg`.

This is the case when no debug info sections could be found in the package,
which is often the case for `python-*` packages, like `python-bashlex`.
--
This commit is contained in:
Ferdinand Bachmann 2020-02-28 16:02:00 +01:00 committed by J Guerreiro
parent 4f35c2c4fe
commit 023c742490

View file

@ -1119,6 +1119,14 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc
return fmt.Errorf("Could not find PKGDEST for: %s", name)
}
if _, err := os.Stat(pkgdest); os.IsNotExist(err) {
if optional {
return nil
}
return fmt.Errorf("PKGDEST for %s listed by makepkg, but does not exist: %s", name, pkgdest)
}
arguments.addTarget(pkgdest)
if parser.existsArg("asdeps", "asdep") {
deps = append(deps, name)