diff --git a/ppp b/ppp index 66a1884..d3f9077 100755 Binary files a/ppp and b/ppp differ diff --git a/src/main.go b/src/main.go index 11d713c..8c8d020 100644 --- a/src/main.go +++ b/src/main.go @@ -25,6 +25,7 @@ func main() { Source: os.Args[1], Target: os.Args[2], Download: false, + Is32bit: false, } if len(os.Args) > 3 { @@ -33,10 +34,14 @@ func main() { config.Output = os.Args[4] } + if strings.Contains(config.Source, "i386") { + config.Is32bit = true + } + basePackages := processFile(config.Source) targetPackages := processFile(config.Target) - changed := compare(basePackages, targetPackages, config.Download) + changed := compare(basePackages, targetPackages, config.Download, config.Is32bit) if config.Download { download(changed, config.DlUrl, config.Output) } @@ -107,17 +112,17 @@ func processFile(url string) map[string]packageInfo { return packages } -func compare(basePackages map[string]packageInfo, targetPackages map[string]packageInfo, download bool) map[string]packageInfo { +func compare(basePackages map[string]packageInfo, targetPackages map[string]packageInfo, download bool, is32bit bool) map[string]packageInfo { output := make(map[string]packageInfo) for pack, info := range targetPackages { if baseVersion, ok := basePackages[pack]; ok { - if baseVersion.Version != info.Version { + if baseVersion.Version != info.Version && (!is32bit || !strings.HasSuffix(info.FilePath, "all.deb")) { output[pack] = info if !download { os.Stdout.WriteString(pack) } } - } else { + } else if !is32bit || !strings.HasSuffix(info.FilePath, "all.deb") { output[pack] = info if !download { os.Stdout.WriteString(pack) @@ -248,6 +253,7 @@ type config struct { Download bool DlUrl string Output string + Is32bit bool } type packageInfo struct {