Jguer před 7 roky
rodič
revize
d8f1c382b1
2 změnil soubory, kde provedl 26 přidání a 15 odebrání
  1. 12 3
      aur/aur.go
  2. 14 12
      config/config.go

+ 12 - 3
aur/aur.go

@@ -154,9 +154,18 @@ func Upgrade(flags []string) error {
 		}
 	}
 
-	q, err := rpc.Info(keys)
-	if err != nil {
-		return err
+	var q Query
+	var j int
+	for i = len(keys); i != 0; i = j {
+		j = i - config.YayConf.RequestSplitN
+		if j < 0 {
+			j = 0
+		}
+		qtemp, err := rpc.Info(keys[j:i])
+		q = append(q, qtemp...)
+		if err != nil {
+			return err
+		}
 	}
 
 	var buffer bytes.Buffer

+ 14 - 12
config/config.go

@@ -27,18 +27,19 @@ const (
 
 // Configuration stores yay's config.
 type Configuration struct {
-	BuildDir   string `json:"buildDir"`
-	Editor     string `json:"editor"`
-	MakepkgBin string `json:"makepkgbin"`
-	Shell      string `json:"-"`
-	NoConfirm  bool   `json:"noconfirm"`
-	Devel      bool   `json:"devel"`
-	PacmanBin  string `json:"pacmanbin"`
-	PacmanConf string `json:"pacmanconf"`
-	SearchMode int    `json:"-"`
-	SortMode   int    `json:"sortmode"`
-	TarBin     string `json:"tarbin"`
-	TimeUpdate bool   `json:"timeupdate"`
+	BuildDir      string `json:"buildDir"`
+	Editor        string `json:"editor"`
+	MakepkgBin    string `json:"makepkgbin"`
+	Shell         string `json:"-"`
+	NoConfirm     bool   `json:"noconfirm"`
+	Devel         bool   `json:"devel"`
+	PacmanBin     string `json:"pacmanbin"`
+	PacmanConf    string `json:"pacmanconf"`
+	RequestSplitN int    `json:"requestsplitn"`
+	SearchMode    int    `json:"-"`
+	SortMode      int    `json:"sortmode"`
+	TarBin        string `json:"tarbin"`
+	TimeUpdate    bool   `json:"timeupdate"`
 }
 
 // YayConf holds the current config values for yay.
@@ -128,6 +129,7 @@ func defaultSettings(config *Configuration) {
 	config.SortMode = BottomUp
 	config.TarBin = "/usr/bin/bsdtar"
 	config.TimeUpdate = false
+	config.RequestSplitN = 150
 }
 
 // Editor returns the preferred system editor.