{"record":{"id":"89934d0310336f95","repo":"Jguer/yay","slug":"cannot-find-pkgbuild-and-srcinfo-in-directory-s","errorCode":null,"errorMessage":"cannot find PKGBUILD and .SRCINFO in directory: %s","messagePattern":"cannot find PKGBUILD and \\.SRCINFO in directory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"local_install.go","lineNumber":56,"sourceCode":"\tif _, err := os.Stat(pkgbuildDir); err == nil {\n\t\t// run makepkg to generate .SRCINFO\n\t\tsrcinfo, stderr, err := cmdBuilder.Capture(cmdBuilder.BuildMakepkgCmd(ctx, targetDir, \"--printsrcinfo\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to generate .SRCINFO: %w - %s\", err, stderr)\n\t\t}\n\n\t\tif srcinfo == \"\" {\n\t\t\treturn fmt.Errorf(\"generated .SRCINFO is empty, check your PKGBUILD for errors\")\n\t\t}\n\n\t\tif err := os.WriteFile(srcInfoDir, []byte(srcinfo), 0o600); err != nil {\n\t\t\treturn fmt.Errorf(\"unable to write .SRCINFO: %w\", err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"%w: %s\", ErrNoBuildFiles, targetDir)\n}\n\nfunc installLocalPKGBUILD(\n\tctx context.Context,\n\trun *runtime.Runtime,\n\tcmdArgs *parser.Arguments,\n\tdbExecutor db.Executor,\n) error {\n\taurCache := run.AURClient\n\tnoCheck := strings.Contains(run.Cfg.MFlags, \"--nocheck\")\n\n\tif len(cmdArgs.Targets) < 1 {\n\t\treturn errors.New(gotext.Get(\"no target directories specified\"))\n\t}\n\n\tsrcInfos := map[string]*gosrc.Srcinfo{}\n\tfor _, targetDir := range cmdArgs.Targets {\n\t\tif err := srcinfoExists(ctx, run.CmdBuilder, targetDir); err != nil {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/local_install.go#L38-L74","documentation":"The wrapped form of ErrNoBuildFiles returned at the end of srcinfoExists: the target directory has no .SRCINFO (or it couldn't be generated) and no PKGBUILD, so neither build file required for a local install is present. The %s names the offending directory. It is the terminal fall-through of the file-presence checks and generation attempt.","triggerScenarios":"Thrown at local_install.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point yay -B at a directory that actually contains a PKGBUILD","Clone the PKGBUILD from the AUR or ABS into the target directory","Verify the path for typos or trailing characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"328f4b4939fb35f38c2f7c7ce3b8638a839bafa5","analyzedAt":"2026-09-07T16:45:12.608Z","contentChangedAt":"2026-09-07T16:45:12.608Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}