Closed tohojo closed 2 years ago
Yes, because I was trying to keep the binary as small as possible and ogier/pflag was smaller and had the features I needed. Just tested it now and it's a two-liner to replace the imports with spf13 but adds 124K to the (minimized) binary. All I want is normal long form options with -- and not -. :)
If that's causing a hassle and there's no way you can just import a package (?) I suppose I could take the 124K hit.
Pete Heist notifications@github.com writes:
Yes, because I was trying to keep the binary as small as possible and ogier/pflag was smaller and had the features I needed. Just tested it now and it's a two-liner to replace the imports with spf13 but adds 124K to the (minimized) binary. All I want is normal long form options with -- and not -. :)
If that's causing a hassle and there's no way you can just import a package (?) I suppose I could take the 124K hit.
I doubt I'll get much traction for carrying both packages. If they're compatible, I could just patch the source from the .spec file - it's basically just 'sed -i s/ogier/spf13/ *.go', right?
Yes, they're compatible. To be on the safe side replace ogier/pflag with spf13/pflag. For now it's only in irtt_client.go and irtt_server.go, although *.go is probably better in case names change. That would be nice if you could patch it that way.
Pete Heist notifications@github.com writes:
Yes, they're compatible. To be on the safe side replace ogier/pflag with spf13/pflag. For now it's only in irtt_client.go and irtt_server.go, although *.go is probably better in case names change. That would be nice if you could patch it that way.
Well, I'd probably create a proper .patch file - but cool, let's see if we can't solve it that way :)
Ok, so in case this unified diff helps...
% git diff irtt_client.go irtt_server.go
diff --git a/irtt_client.go b/irtt_client.go
index 38f2d21..c8d2cd3 100644
--- a/irtt_client.go
+++ b/irtt_client.go
@@ -14,7 +14,7 @@ import (
"text/tabwriter"
"time"
- flag "github.com/ogier/pflag"
+ flag "github.com/spf13/pflag"
)
func clientUsage() {
diff --git a/irtt_server.go b/irtt_server.go
index 6bdc0da..98ae5e9 100644
--- a/irtt_server.go
+++ b/irtt_server.go
@@ -6,7 +6,7 @@ import (
"strings"
"syscall"
- flag "github.com/ogier/pflag"
+ flag "github.com/spf13/pflag"
)
func serverUsage() {
Pete Heist notifications@github.com writes:
Ok, so in case this unified diff helps...
Great, thanks!
Finally got around to packaing irtt for Fedora: https://src.fedoraproject.org/rpms/golang-github-heistp-irtt
So closing this issue :)
Great, thanks!
I'm working on getting Flent into Fedora, but need to package up irtt as a requirement first (see https://bugzilla.redhat.com/show_bug.cgi?id=1729939).
The initial automated .spec file fails because you're using ogier/pflag instead of spf13/pflag (the latter is already packaged for Fedora). Any particular reason for this choice?
See https://koji.fedoraproject.org/koji/taskinfo?taskID=36285784 for build log...