소스 검색

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`.
--
Ferdinand Bachmann 5 년 전
부모
커밋
023c742490
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      install.go

+ 8 - 0
install.go

@@ -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)