( pkg *aur.Pkg, dbExecutor db.Executor, singleLineResults bool, )
| 48 | } |
| 49 | |
| 50 | func aurPkgSearchString( |
| 51 | pkg *aur.Pkg, |
| 52 | dbExecutor db.Executor, |
| 53 | singleLineResults bool, |
| 54 | ) string { |
| 55 | linkText := text.Bold(text.ColorHash("aur")) + "/" + text.Bold(pkg.Name) |
| 56 | toPrint := text.CreateRepoLink("aur", "", pkg.Name, linkText) + |
| 57 | " " + text.Cyan(pkg.Version) + |
| 58 | text.Bold(" (+"+strconv.Itoa(pkg.NumVotes)) + |
| 59 | " " + text.Bold(strconv.FormatFloat(pkg.Popularity, 'f', 2, 64)+") ") |
| 60 | |
| 61 | if ageTag := text.FormatAgeTag(int64(pkg.LastModified)); ageTag != "" { |
| 62 | toPrint += ageTag + " " |
| 63 | } |
| 64 | |
| 65 | if pkg.Maintainer == "" { |
| 66 | toPrint += text.Bold(text.Red(gotext.Get("(Orphaned)"))) + " " |
| 67 | } |
| 68 | |
| 69 | if pkg.OutOfDate != 0 { |
| 70 | toPrint += text.Bold(text.Red(gotext.Get("(Out-of-date: %s)", text.FormatTime(pkg.OutOfDate)))) + " " |
| 71 | } |
| 72 | |
| 73 | if localPkg := dbExecutor.LocalPackage(pkg.Name); localPkg != nil { |
| 74 | if localPkg.Version() != pkg.Version { |
| 75 | toPrint += text.Bold(text.Green(gotext.Get("(Installed: %s)", localPkg.Version()))) |
| 76 | } else { |
| 77 | toPrint += text.Bold(text.Green(gotext.Get("(Installed)"))) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | if singleLineResults { |
| 82 | toPrint += "\t" |
| 83 | } else { |
| 84 | toPrint += "\n " |
| 85 | } |
| 86 | |
| 87 | toPrint += pkg.Description |
| 88 | |
| 89 | return toPrint |
| 90 | } |
| 91 | |
| 92 | // PrintSearch receives a RepoSearch type and outputs pretty text. |
| 93 | func syncPkgSearchString(pkg alpm.Package, dbExecutor db.Executor, singleLineResults bool) string { |
no test coverage detected