morganamilo 7 years ago
parent
commit
7fd2a74bd2
6 changed files with 15 additions and 19 deletions
  1. 1 1
      cmd.go
  2. 9 10
      conflicts.go
  3. 1 1
      dependencies.go
  4. 2 3
      main.go
  5. 1 1
      print.go
  6. 1 3
      upgrade.go

+ 1 - 1
cmd.go

@@ -146,7 +146,7 @@ func handleCmd() (err error) {
 	case "T", "deptest":
 	case "T", "deptest":
 		err = passToPacman(cmdArgs)
 		err = passToPacman(cmdArgs)
 	case "U", "upgrade":
 	case "U", "upgrade":
-		err =passToPacman(cmdArgs)
+		err = passToPacman(cmdArgs)
 	case "G", "getpkgbuild":
 	case "G", "getpkgbuild":
 		err = handleGetpkgbuild()
 		err = handleGetpkgbuild()
 	case "P", "print":
 	case "P", "print":

+ 9 - 10
conflicts.go

@@ -101,7 +101,7 @@ func checkInnerConflict(name string, conflict string, conflicts map[string]strin
 				return nil
 				return nil
 			}
 			}
 
 
-			if  version.Satisfies(dep) {
+			if version.Satisfies(dep) {
 				addMapStringSet(conflicts, name, pkg.Name())
 				addMapStringSet(conflicts, name, pkg.Name())
 				return fmt.Errorf("")
 				return fmt.Errorf("")
 			}
 			}
@@ -113,7 +113,7 @@ func checkInnerConflict(name string, conflict string, conflicts map[string]strin
 
 
 // Checks every to be installed package's conflicts against every other to be
 // Checks every to be installed package's conflicts against every other to be
 // installed package and its provides.
 // installed package and its provides.
-func checkForInnerConflicts(dc *depCatagories) (map[string]stringSet) {
+func checkForInnerConflicts(dc *depCatagories) map[string]stringSet {
 	conflicts := make(map[string]stringSet)
 	conflicts := make(map[string]stringSet)
 
 
 	for _, pkg := range dc.Aur {
 	for _, pkg := range dc.Aur {
@@ -151,7 +151,6 @@ func checkReverseConflict(name string, provide string, conflicts map[string]stri
 		}
 		}
 	}
 	}
 
 
-
 	localDb.PkgCache().ForEach(func(pkg alpm.Package) error {
 	localDb.PkgCache().ForEach(func(pkg alpm.Package) error {
 		if name == pkg.Name() {
 		if name == pkg.Name() {
 			return nil
 			return nil
@@ -175,9 +174,9 @@ func checkReverseConflict(name string, provide string, conflicts map[string]stri
 				return nil
 				return nil
 			}
 			}
 
 
-			if version == nil ||  version.Satisfies(dep) {
+			if version == nil || version.Satisfies(dep) {
 				// Todo
 				// Todo
-				addMapStringSet(conflicts, name, pkg.Name() + " (" + provide + ")")
+				addMapStringSet(conflicts, name, pkg.Name()+" ("+provide+")")
 				return fmt.Errorf("")
 				return fmt.Errorf("")
 			}
 			}
 
 
@@ -233,7 +232,7 @@ func checkConflict(name string, conflict string, conflicts map[string]stringSet)
 			}
 			}
 
 
 			if provide.Mod == alpm.DepModAny {
 			if provide.Mod == alpm.DepModAny {
-				addMapStringSet(conflicts, name, pkg.Name() + " (" + provide.Name + ")")
+				addMapStringSet(conflicts, name, pkg.Name()+" ("+provide.Name+")")
 				return fmt.Errorf("")
 				return fmt.Errorf("")
 			}
 			}
 
 
@@ -243,7 +242,7 @@ func checkConflict(name string, conflict string, conflicts map[string]stringSet)
 			}
 			}
 
 
 			if version.Satisfies(dep) {
 			if version.Satisfies(dep) {
-				addMapStringSet(conflicts, name, pkg.Name() + " (" + provide.Name + ")")
+				addMapStringSet(conflicts, name, pkg.Name()+" ("+provide.Name+")")
 				return fmt.Errorf("")
 				return fmt.Errorf("")
 			}
 			}
 
 
@@ -259,7 +258,7 @@ func checkConflict(name string, conflict string, conflicts map[string]stringSet)
 // Checks every to be installed package's conflicts against the names and
 // Checks every to be installed package's conflicts against the names and
 // provides of every already installed package and checks every to be installed
 // provides of every already installed package and checks every to be installed
 // package's name and provides against every already installed package.
 // package's name and provides against every already installed package.
-func checkForConflicts(dc *depCatagories) (map[string]stringSet, error)  {
+func checkForConflicts(dc *depCatagories) (map[string]stringSet, error) {
 	conflicts := make(map[string]stringSet)
 	conflicts := make(map[string]stringSet)
 
 
 	for _, pkg := range dc.Aur {
 	for _, pkg := range dc.Aur {
@@ -302,13 +301,13 @@ func checkForAllConflicts(dc *depCatagories) error {
 	var wg sync.WaitGroup
 	var wg sync.WaitGroup
 	wg.Add(2)
 	wg.Add(2)
 
 
-	fmt.Println(bold(cyan("::")+ " Checking for conflicts..."))
+	fmt.Println(bold(cyan("::") + " Checking for conflicts..."))
 	go func() {
 	go func() {
 		conflicts, err = checkForConflicts(dc)
 		conflicts, err = checkForConflicts(dc)
 		wg.Done()
 		wg.Done()
 	}()
 	}()
 
 
-	fmt.Println(bold(cyan("::")+ " Checking for inner conflicts..."))
+	fmt.Println(bold(cyan("::") + " Checking for inner conflicts..."))
 	go func() {
 	go func() {
 		innerConflicts = checkForInnerConflicts(dc)
 		innerConflicts = checkForInnerConflicts(dc)
 		wg.Done()
 		wg.Done()

+ 1 - 1
dependencies.go

@@ -471,7 +471,7 @@ func depTreeRecursive(dt *depTree, localDb *alpm.Db, syncDb alpm.DbList, isMake
 func checkVersions(dt *depTree) error {
 func checkVersions(dt *depTree) error {
 	depStrings := make([]string, 0)
 	depStrings := make([]string, 0)
 	has := make(map[string][]string)
 	has := make(map[string][]string)
-	
+
 	for _, pkg := range dt.Aur {
 	for _, pkg := range dt.Aur {
 		for _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
 		for _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
 			for _, dep := range deps {
 			for _, dep := range deps {

+ 2 - 3
main.go

@@ -1,10 +1,10 @@
 package main
 package main
 
 
 import (
 import (
+	"encoding/json"
+	"fmt"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
-	"fmt"
-	"encoding/json"
 	"strings"
 	"strings"
 
 
 	alpm "github.com/jguer/go-alpm"
 	alpm "github.com/jguer/go-alpm"
@@ -224,4 +224,3 @@ cleanup:
 
 
 	os.Exit(status)
 	os.Exit(status)
 }
 }
-

+ 1 - 1
print.go

@@ -333,7 +333,7 @@ func printUpdateList(parser *arguments) error {
 	}
 	}
 
 
 	for pkg := range parser.targets {
 	for pkg := range parser.targets {
-		fmt.Println(red(bold("error:")), "package '" + pkg + "' was not found")
+		fmt.Println(red(bold("error:")), "package '"+pkg+"' was not found")
 	}
 	}
 
 
 	return nil
 	return nil

+ 1 - 3
upgrade.go

@@ -4,8 +4,8 @@ import (
 	"bufio"
 	"bufio"
 	"fmt"
 	"fmt"
 	"os"
 	"os"
-	"strings"
 	"sort"
 	"sort"
+	"strings"
 	"sync"
 	"sync"
 
 
 	alpm "github.com/jguer/go-alpm"
 	alpm "github.com/jguer/go-alpm"
@@ -90,7 +90,6 @@ func upList(dt *depTree) (aurUp upSlice, repoUp upSlice, err error) {
 		wg.Done()
 		wg.Done()
 	}()
 	}()
 
 
-
 	if config.Devel {
 	if config.Devel {
 		fmt.Println(bold(cyan("::") + " Checking development packages..."))
 		fmt.Println(bold(cyan("::") + " Checking development packages..."))
 		wg.Add(1)
 		wg.Add(1)
@@ -100,7 +99,6 @@ func upList(dt *depTree) (aurUp upSlice, repoUp upSlice, err error) {
 		}()
 		}()
 	}
 	}
 
 
-
 	wg.Wait()
 	wg.Wait()
 
 
 	errs := make([]string, 0)
 	errs := make([]string, 0)