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.
@@ -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"
