Print true pkgver when skipping build

This commit is contained in:
morganamilo 2018-06-05 14:47:55 +01:00
parent cf6068dbd3
commit 64ab60f4b4
No known key found for this signature in database
GPG Key ID: 6FE9E7996B0B082E

View File

@ -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"}