bugfix, giving id to dependency resolver
This commit is contained in:
@@ -289,10 +289,6 @@ func GetDependencies(db *sql.DB, id string) (map[string]string, error) {
|
||||
|
||||
func ResolvDependencies(depnList map[string]string) ([]string, error) {
|
||||
|
||||
if len(depnList) > 0 {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite", consts.IndexDB)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
@@ -308,13 +304,13 @@ func ResolvDependencies(depnList map[string]string) ([]string, error) {
|
||||
switch {
|
||||
case strings.HasPrefix(constraint, ">"):
|
||||
filter = fmt.Sprintf("AND serial > %s", value)
|
||||
order = "ORDER BY serial ASC LIMIT 1"
|
||||
order = "ORDER BY serial DESC LIMIT 1"
|
||||
case strings.HasPrefix(constraint, "<="):
|
||||
filter = fmt.Sprintf("AND serial <= %s", value)
|
||||
order = "ORDER BY serial DESC LIMIT 1"
|
||||
order = "ORDER BY serial ASC LIMIT 1"
|
||||
case strings.HasPrefix(constraint, "<"):
|
||||
filter = fmt.Sprintf("AND serial < %s", value)
|
||||
order = "ORDER BY serial DESC LIMIT 1"
|
||||
order = "ORDER BY serial ASC LIMIT 1"
|
||||
case strings.HasPrefix(constraint, "="):
|
||||
filter = fmt.Sprintf("AND serial = %s", value)
|
||||
order = ""
|
||||
@@ -331,7 +327,6 @@ func ResolvDependencies(depnList map[string]string) ([]string, error) {
|
||||
}
|
||||
|
||||
resolved = append(resolved, packageId)
|
||||
|
||||
dp, err := GetDependencies(db, packageId)
|
||||
if err != nil {
|
||||
return resolved, err
|
||||
|
||||
Reference in New Issue
Block a user