From 841771c18e6ef15ee2575418fcc8c41259e4e470 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 18 Feb 2014 00:18:55 +0400 Subject: [PATCH] Sort architectures for stability of result, use package architecture for dependency search. --- cmd_snapshot.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd_snapshot.go b/cmd_snapshot.go index 8da6dae2..5f2fd2ab 100644 --- a/cmd_snapshot.go +++ b/cmd_snapshot.go @@ -274,6 +274,8 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error { architecturesList = packageList.Architectures(false) } + sort.Strings(architecturesList) + if len(architecturesList) == 0 { return fmt.Errorf("unable to determine list of architectures, please specify explicitly") } @@ -308,11 +310,11 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error { } // Remove all packages with the same name and architecture - for p := packageList.Search(debian.Dependency{Architecture: arch, Pkg: pkg.Name}); p != nil; { + for p := packageList.Search(debian.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}); p != nil; { packageList.Remove(p) color.Printf("@r[-]@| %s removed", p) fmt.Printf("\n") - p = packageList.Search(debian.Dependency{Architecture: arch, Pkg: pkg.Name}) + p = packageList.Search(debian.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}) } // Add new discovered package