mirror of
https://github.com/Jguer/yay
synced 2024-08-31 21:58:39 +00:00
Apply linting to patch
This commit is contained in:
parent
6913770b4d
commit
433f5b6ce1
|
@ -16,10 +16,9 @@ type depTree struct {
|
|||
|
||||
type depCatagories struct {
|
||||
Repo []*alpm.Package
|
||||
Aur[]*rpc.Pkg
|
||||
Aur []*rpc.Pkg
|
||||
MakeOnly stringSet
|
||||
Bases map[string][]*rpc.Pkg
|
||||
|
||||
}
|
||||
|
||||
func makeDepTree() *depTree {
|
||||
|
|
25
install.go
25
install.go
|
@ -2,9 +2,9 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
alpm "github.com/jguer/go-alpm"
|
||||
|
@ -123,7 +123,6 @@ func install(parser *arguments) error {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if _, ok := arguments.options["gendb"]; ok {
|
||||
fmt.Println("GenDB finished. No packages were installed")
|
||||
return nil
|
||||
|
@ -190,7 +189,7 @@ func askCleanBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) {
|
|||
str = str[:len(str)-1] + ")"
|
||||
}
|
||||
|
||||
if !continueTask(str + " Directory exists. Clean Build?", "yY") {
|
||||
if !continueTask(str+" Directory exists. Clean Build?", "yY") {
|
||||
_ = os.RemoveAll(config.BuildDir + pkg.PackageBase)
|
||||
}
|
||||
}
|
||||
|
@ -267,7 +266,7 @@ func checkForConflicts(aur []*rpc.Pkg, aurMake []*rpc.Pkg, repo []*alpm.Package,
|
|||
return nil
|
||||
}
|
||||
|
||||
func askEditPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) (error) {
|
||||
func askEditPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) error {
|
||||
for _, pkg := range pkgs {
|
||||
dir := config.BuildDir + pkg.PackageBase + "/"
|
||||
|
||||
|
@ -290,8 +289,7 @@ func askEditPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) (error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) (error) {
|
||||
func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) error {
|
||||
|
||||
for _, pkg := range pkgs {
|
||||
dir := config.BuildDir + pkg.PackageBase + "/"
|
||||
|
@ -327,7 +325,7 @@ func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) (error)
|
|||
func dowloadPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) (err error) {
|
||||
for _, pkg := range pkgs {
|
||||
//todo make pretty
|
||||
str := "Downloading: " + pkg.PackageBase+"-"+pkg.Version
|
||||
str := "Downloading: " + pkg.PackageBase + "-" + pkg.Version
|
||||
if len(bases[pkg.PackageBase]) > 1 || pkg.PackageBase != pkg.Name {
|
||||
str += " ("
|
||||
for _, split := range bases[pkg.PackageBase] {
|
||||
|
@ -358,7 +356,7 @@ func downloadPkgBuildsSources(pkgs []*rpc.Pkg) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func buildInstallPkgBuilds(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD, targets stringSet, parser *arguments, bases map[string][]*rpc.Pkg) (error) {
|
||||
func buildInstallPkgBuilds(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD, targets stringSet, parser *arguments, bases map[string][]*rpc.Pkg) error {
|
||||
//for n := len(pkgs) -1 ; n > 0; n-- {
|
||||
for n := 0; n < len(pkgs); n++ {
|
||||
pkg := pkgs[n]
|
||||
|
@ -369,8 +367,8 @@ func buildInstallPkgBuilds(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD,
|
|||
srcinfo := srcinfos[pkg.PackageBase]
|
||||
version := srcinfo.CompleteVersion()
|
||||
|
||||
for _, split:= range bases[pkg.PackageBase] {
|
||||
file, err := completeFileName(dir, split.Name + "-" + version.String())
|
||||
for _, split := range bases[pkg.PackageBase] {
|
||||
file, err := completeFileName(dir, split.Name+"-"+version.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -382,7 +380,7 @@ func buildInstallPkgBuilds(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD,
|
|||
|
||||
if built {
|
||||
fmt.Println(boldRedFgBlackBg(arrow+" Warning:"),
|
||||
blackBg(pkg.Name+"-"+pkg.Version+ " Already made -- skipping build"))
|
||||
blackBg(pkg.Name+"-"+pkg.Version+" Already made -- skipping build"))
|
||||
} else {
|
||||
err := passToMakepkg(dir, "-Cscf", "--noconfirm")
|
||||
if err != nil {
|
||||
|
@ -405,7 +403,7 @@ func buildInstallPkgBuilds(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD,
|
|||
depArguments.addArg("D", "asdeps")
|
||||
|
||||
for _, split := range bases[pkg.PackageBase] {
|
||||
file, err := completeFileName(dir, split.Name + "-" + version.String())
|
||||
file, err := completeFileName(dir, split.Name+"-"+version.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -443,12 +441,11 @@ func clean(pkgs []*rpc.Pkg) {
|
|||
dir := config.BuildDir + pkg.PackageBase + "/"
|
||||
|
||||
fmt.Println(boldGreenFg(arrow +
|
||||
" CleanAfter enabled. Deleting " + pkg.Name +" source folder."))
|
||||
" CleanAfter enabled. Deleting " + pkg.Name + " source folder."))
|
||||
os.RemoveAll(dir)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func completeFileName(dir, name string) (string, error) {
|
||||
files, err := ioutil.ReadDir(dir)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue