Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package host-spawn for openSUSE:Factory checked in at 2025-01-19 21:50:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/host-spawn (Old) and /work/SRC/openSUSE:Factory/.host-spawn.new.5589 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "host-spawn" Sun Jan 19 21:50:09 2025 rev:4 rq:1238782 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/host-spawn/host-spawn.changes 2024-06-05 17:43:31.692570240 +0200 +++ /work/SRC/openSUSE:Factory/.host-spawn.new.5589/host-spawn.changes 2025-01-19 21:50:18.144709671 +0100 @@ -1,0 +2,11 @@ +Tue Jan 14 14:35:17 UTC 2025 - [email protected] + +- Update to version v1.6.1: + * Do not allocate a pty if stdout is redirected + * Do not assume we're only going to receive HostCommandExited messages + * Show helpful error if we receive an unexpected DBus signal + * Start a shell if basename starts with host-spawn + * Show error message if we fail to spawn the process +- drop v prefix from a tarball name + +------------------------------------------------------------------- Old: ---- host-spawn-v1.6.0.tar.zst New: ---- host-spawn-1.6.1.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ host-spawn.spec ++++++ --- /var/tmp/diff_new_pack.fP6ktY/_old 2025-01-19 21:50:18.744734394 +0100 +++ /var/tmp/diff_new_pack.fP6ktY/_new 2025-01-19 21:50:18.744734394 +0100 @@ -1,7 +1,7 @@ # # spec file for package host-spawn # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,12 +17,12 @@ Name: host-spawn -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: A reimplementation of flatpak-spawn --host License: MIT-0 URL: https://github.com/1player/host-spawn -Source0: %{name}-v%{version}.tar.zst +Source0: %{name}-%{version}.tar.zst Source1: vendor.tar.zst # Go packaging wiki suggests golang-packaging, but this does not work on 15.5 BuildRequires: golang(API) >= 1.18 @@ -32,12 +32,12 @@ Run commands on your host machine from inside your flatpak sandbox, toolbox or distrobox containers. %prep -%autosetup -p1 -a1 -n %{name}-v%{version} +%autosetup -p1 -a1 %build # https://github.com/1player/host-spawn/blob/master/build.sh#L22 CGO_ENABLED=0 go build \ - -ldflags "-X main.Version=%{version}" \ + -ldflags "-X main.Version=v%{version}" \ -mod=vendor \ -buildmode=pie ++++++ _service ++++++ --- /var/tmp/diff_new_pack.fP6ktY/_old 2025-01-19 21:50:18.776735713 +0100 +++ /var/tmp/diff_new_pack.fP6ktY/_new 2025-01-19 21:50:18.780735878 +0100 @@ -3,17 +3,17 @@ <param name="url">https://github.com/1player/host-spawn</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v1.6.0</param> + <param name="revision">v1.6.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> - <param name="versionrewrite-pattern">(.*)</param> - </service> - <service name="set_version" mode="disabled"> + <param name="versionrewrite-pattern">v(.*)</param> </service> <service name="recompress" mode="disabled"> <param name="file">*.tar</param> <param name="compression">zst</param> </service> + <service name="set_version" mode="disabled"> + </service> <service name="go_modules" mode="disabled"> <param name="compression">zst</param> </service> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.fP6ktY/_old 2025-01-19 21:50:18.800736702 +0100 +++ /var/tmp/diff_new_pack.fP6ktY/_new 2025-01-19 21:50:18.804736867 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/1player/host-spawn</param> - <param name="changesrevision">e150d2cf98d93e08db9fba7a87cabc51a9c9e34a</param></service></servicedata> + <param name="changesrevision">db1173ae2ef04beca8961a35c225117498263e23</param></service></servicedata> (No newline at EOF) ++++++ host-spawn-v1.6.0.tar.zst -> host-spawn-1.6.1.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/host-spawn-v1.6.0/CHANGELOG.md new/host-spawn-1.6.1/CHANGELOG.md --- old/host-spawn-v1.6.0/CHANGELOG.md 2024-04-28 11:55:07.000000000 +0200 +++ new/host-spawn-1.6.1/CHANGELOG.md 2025-01-10 10:14:42.000000000 +0100 @@ -1,3 +1,9 @@ +## 1.6.1 (10 Jan 2025) + +* Increase robustness in handling DBus messages (https://github.com/1player/host-spawn/issues/38) +* Show an error message if the command we're trying to run does not exist (https://github.com/1player/host-spawn/issues/39) +* Do not allocate a pty if stdout is redirected (https://github.com/1player/host-spawn/issues/40) + ## 1.6.0 (28 Apr 2024) ### Added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/host-spawn-v1.6.0/command.go new/host-spawn-1.6.1/command.go --- old/host-spawn-v1.6.0/command.go 2024-04-28 11:55:07.000000000 +0200 +++ new/host-spawn-1.6.1/command.go 2025-01-10 10:14:42.000000000 +0100 @@ -4,10 +4,11 @@ "errors" "os" - "github.com/godbus/dbus/v5" - "golang.org/x/sys/unix" "os/signal" "syscall" + + "github.com/godbus/dbus/v5" + "golang.org/x/sys/unix" ) type Command struct { @@ -133,7 +134,11 @@ _ = c.signal(unixSignal) case message := <-dbusSignals: - // HostCommandExited has fired + // Wait for HostCommandExited message + if message.Name != "org.freedesktop.Flatpak.Development.HostCommandExited" { + continue + } + waitStatus := message.Body[1].(uint32) status, exited := interpretWaitStatus(waitStatus) if exited { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/host-spawn-v1.6.0/main.go new/host-spawn-1.6.1/main.go --- old/host-spawn-v1.6.0/main.go 2024-04-28 11:55:07.000000000 +0200 +++ new/host-spawn-1.6.1/main.go 2025-01-10 10:14:42.000000000 +0100 @@ -69,7 +69,7 @@ basename := path.Base(os.Args[0]) // Check if we're shimming a host command - if basename == OUR_BASENAME { + if strings.HasPrefix(basename, OUR_BASENAME) { parseArguments() args = flag.Args() @@ -81,8 +81,13 @@ args = append([]string{basename}, os.Args[1:]...) } - // Lookup if this is a blocklisted program, where we won't enable pty. - allocatePty := !blocklist[args[0]] + // Allocate a pty if: + // - stdout isn't redirected + // - this isn't a blocklisted program + // Any of the --pty or --no-pty options will take precedence + + allocatePty := !isStdoutRedirected() && !blocklist[args[0]] + if *flagPty { allocatePty = true } else if *flagNoPty { @@ -120,6 +125,7 @@ exitCode, err := command.SpawnAndWait() if err != nil { + fmt.Fprintln(os.Stderr, err) exitCode = OUR_EXIT_CODE } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/host-spawn-v1.6.0/pty.go new/host-spawn-1.6.1/pty.go --- old/host-spawn-v1.6.0/pty.go 2024-04-28 11:55:07.000000000 +0200 +++ new/host-spawn-1.6.1/pty.go 2025-01-10 10:14:42.000000000 +0100 @@ -132,3 +132,11 @@ _ = termios.Tcsetattr(os.Stdin.Fd(), termios.TCSANOW, &p.previousStdinTermios) } } + +func isStdoutRedirected() bool { + // From https://github.com/mattn/go-isatty/blob/master/isatty_tcgets.go + _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETS) + + // We expect ENOTTY if stdout is redirected + return err != nil +} ++++++ vendor.tar.zst ++++++
