From 21fc5ec37135f2935b5c8f45c5fa51a98e06d7f2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 3 Mar 2020 13:38:18 -0800 Subject: [PATCH] cmd/mkpkg: support specifying that a package replaces another. Both RPM and Deb require us to specify both Replaces and Conflicts: Conflicts tells them that the packages cannot coexist on the system, Replaces tells them which one to keep. --- cmd/mkpkg/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/mkpkg/main.go b/cmd/mkpkg/main.go index fd7de4d94..60cc24fe7 100644 --- a/cmd/mkpkg/main.go +++ b/cmd/mkpkg/main.go @@ -41,6 +41,7 @@ func main() { postinst := getopt.StringLong("postinst", 0, "", "debian postinst script path") prerm := getopt.StringLong("prerm", 0, "", "debian prerm script path") postrm := getopt.StringLong("postrm", 0, "", "debian postrm script path") + replaces := getopt.StringLong("replaces", 0, "", "package which this package replaces, if any") getopt.Parse() filesMap, err := parseFiles(*files) @@ -66,6 +67,11 @@ func main() { }, }) + if *replaces != "" { + info.Overridables.Replaces = []string{*replaces} + info.Overridables.Conflicts = []string{*replaces} + } + switch *pkgType { case "deb": info.Section = "net"