mirror of
https://github.com/Jguer/yay.git
synced 2025-10-06 00:05:37 -04:00
Print true pkgver when skipping build
This commit is contained in:
parent
cf6068dbd3
commit
64ab60f4b4
14
install.go
14
install.go
@ -315,13 +315,14 @@ nextpkg:
|
|||||||
return incompatible, nil
|
return incompatible, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func parsePackageList(dir string) (map[string]string, error) {
|
func parsePackageList(dir string) (map[string]string, string, error) {
|
||||||
stdout, stderr, err := passToMakepkgCapture(dir, "--packagelist")
|
stdout, stderr, err := passToMakepkgCapture(dir, "--packagelist")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("%s%s", stderr, err)
|
return nil, "", fmt.Errorf("%s%s", stderr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var version string
|
||||||
lines := strings.Split(stdout, "\n")
|
lines := strings.Split(stdout, "\n")
|
||||||
pkgdests := make(map[string]string)
|
pkgdests := make(map[string]string)
|
||||||
|
|
||||||
@ -334,17 +335,18 @@ func parsePackageList(dir string) (map[string]string, error) {
|
|||||||
split := strings.Split(fileName, "-")
|
split := strings.Split(fileName, "-")
|
||||||
|
|
||||||
if len(split) < 4 {
|
if len(split) < 4 {
|
||||||
return nil, fmt.Errorf("Can not find package name : %s", split)
|
return nil, "", fmt.Errorf("Can not find package name : %s", split)
|
||||||
}
|
}
|
||||||
|
|
||||||
// pkgname-pkgver-pkgrel-arch.pkgext
|
// pkgname-pkgver-pkgrel-arch.pkgext
|
||||||
// This assumes 3 dashes after the pkgname, Will cause an error
|
// This assumes 3 dashes after the pkgname, Will cause an error
|
||||||
// if the PKGEXT contains a dash. Please no one do that.
|
// if the PKGEXT contains a dash. Please no one do that.
|
||||||
pkgname := strings.Join(split[:len(split)-3], "-")
|
pkgname := strings.Join(split[:len(split)-3], "-")
|
||||||
|
version = strings.Join(split[len(split)-3:len(split)-2], "-")
|
||||||
pkgdests[pkgname] = line
|
pkgdests[pkgname] = line
|
||||||
}
|
}
|
||||||
|
|
||||||
return pkgdests, nil
|
return pkgdests, version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func cleanEditNumberMenu(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, installed stringSet) ([]*rpc.Pkg, []*rpc.Pkg, error) {
|
func cleanEditNumberMenu(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, installed stringSet) ([]*rpc.Pkg, []*rpc.Pkg, error) {
|
||||||
@ -686,7 +688,7 @@ func buildInstallPkgBuilds(dp *depPool, do *depOrder, srcinfos map[string]*gopkg
|
|||||||
return fmt.Errorf("Error making: %s", pkg.Name)
|
return fmt.Errorf("Error making: %s", pkg.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgdests, err := parsePackageList(dir)
|
pkgdests, version, err := parsePackageList(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -711,7 +713,7 @@ func buildInstallPkgBuilds(dp *depPool, do *depOrder, srcinfos map[string]*gopkg
|
|||||||
|
|
||||||
if built {
|
if built {
|
||||||
fmt.Println(bold(yellow(arrow)),
|
fmt.Println(bold(yellow(arrow)),
|
||||||
cyan(pkg.Name+"-"+pkg.Version)+bold(" Already made -- skipping build"))
|
cyan(pkg.Name+"-"+version)+bold(" Already made -- skipping build"))
|
||||||
} else {
|
} else {
|
||||||
args := []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"}
|
args := []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user