mirror of
https://github.com/mudler/luet.git
synced 2025-09-07 02:00:39 +00:00
Simplify revdep code
Isolate common code into a function and also fix a sublte bug hiding in that code. We need to stab a copy of the package inside our PackageMap to avoid having symlinks pointing at the same values when iterating over requires. ( e.g. happened in this case: https://github.com/rancher-sandbox/cOS-toolkit/pull/467#issuecomment-895060115 )
This commit is contained in:
@@ -136,6 +136,18 @@ type Packages []Package
|
||||
|
||||
type DefaultPackages []*DefaultPackage
|
||||
|
||||
type PackageMap map[string]Package
|
||||
|
||||
func (pm PackageMap) String() string {
|
||||
rr := []string{}
|
||||
for _, r := range pm {
|
||||
|
||||
rr = append(rr, r.HumanReadableString())
|
||||
|
||||
}
|
||||
return fmt.Sprint(rr)
|
||||
}
|
||||
|
||||
func (d DefaultPackages) Hash(salt string) string {
|
||||
|
||||
overallFp := ""
|
||||
|
Reference in New Issue
Block a user