Bugzilla – Bug 369450
zypper install hides rpm %post script output
Last modified: 2009-05-04 14:17:30 UTC
All other tools I've used to install RPMs (e.g., apt, smart, rpm, etc.) will show you the output of the RPM's scriptlets. zypper(1) however does not. This is a problem because often these messages are important for the person doing the installation to see, e.g., "Don't forget to do XXX after you install this" etc. Even when zypper is given the "-v" flag this output is suppressed. Please change zypper to show the output of the RPM scriptlets to stdout, or at least do so when "-v" is supplied. Versions: zypper-0.8.25-0.1 libzypp-3.26.8-0.1
The output is written to /var/log/YaST/y2logRPM; since libzypp 5.12.1 to /var/log/zypp/history. See http://en.opensuse.org/Libzypp/Package_History for example. It is not optimal as an immediate notification, though. But when showing the output simply among the downloading/installing lines it can quickly scroll out of the screen. Any ideas for a better solution (like e.g. Debian's debconf), or should we just display the output of rpm when installing/removing packages with zypper?
Another issue related to this is when the package expects user input on stdin in scriptlets. See bug 430791. Should we consider that a bug in the package? Or is there a standard way of dealing with such case?
If zypper is redirecting the output to some file and post is waiting for some input, how should aunt tilly know, why this process is hanging there forever? In my case, VMware-Workstation is not even properly installed, since it does the whole installation process in %post (as drain bammaged as it is). Sure, output is scrolled away, but if you redirect it to some file additionally, it's not lost and most terminals have some way of scrolling up. Thus, yes, sure, this is a genuine bug in my book, not simply some user inconvenience.
Regarding #2: that's a package bug. Actually I wouldn't mind to change rpm so that it makes fd 0 point to /dev/null.
Michael, I'm going to accept your claim, IF either - you convince the RPM people to accept such a change officially - e.g. next fedora isn't accepting anything on stdin in rpm scripts. That way, you force those silly rpm creators to rethink their sillyness or - you convince your bosses to buy VMware and force them that way to create proper rpm packages. But until then, please cope with standard rpm behavior. If you change only Novells version of rpm, the web will fill up with silly "Novell blocks VMware products" statements. Do you want that? (I bet, your management will intervene at this point). Sure, I hate the VMware-Workstation rpm behavior. It's brain devastated. It's effectively ostracising package management (which is one important reason for me to keep using your products). But my users depend on VMware-Workstation, which allowed me to run SUSE Linux desktops diskless in a commercial setting since 1998, and believe me, it's hard enough to keep up even without any package management handling issues.
The problem is that returning an error in the post script will abort the rpm transaction and leave the system in a mess. That's not so critical for SUSE systems, as we call rpm for every transaction element, but on a fedora system you're hosed. (But maybe they don't return an error, I've not tried to install that package.)
Created attachment 244855 [details] zypp rpm install output callback This patch passes rpm output from zypp to applications through a callback, one line per call. After adapting zypper it looks like this ("rpm: " prepended to each output line): -------- The following NEW package is going to be installed: yast2-dns-server Overall download size: 127.0 K. After the operation, additional 735.0 K will be used. Continue? [YES/no]: Retrieving package yast2-dns-server-2.17.7-1.24.noarch (1/1), 127.0 K (735.0 K unpacked) rpm: warning: /var/cache/zypp/packages/iso/suse/noarch/yast2-dns-server-2.17.7-1.24.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 307e3d54 Installing: yast2-dns-server-2.17.7-1.24 [done] ---------- OK? I guess we want the same also for package removal...
*** Bug 430791 has been marked as a duplicate of this bug. ***
There is also a suggestion to enable this only with -v (verbose) option.
@ openSUSE 11.1/ SLE-11 Unfortunately the required new callback method needs to be virtual, so it breaks binary compatibility. There's a similar report assigned to Ladislav, because pkg-bindings still try to read this additional output from y2logRPM, which no longer exists (bug #456446). But we could report the additional rpm output (warnings or output from scripts) via the existing virtual void finish( Resolvable::constPtr /*resolvable*/ , Error /*error*/ , const std::string &/*reason*/ ) {} With error==NO_ERROR we could pass the additional output as 'reason'.
*** Bug 468161 has been marked as a duplicate of this bug. ***
@ openSUSE 11.1/ SLE-11 Since libzypp-5.27.4 any additional rpm output is sent via the Install/RemoveResolvableReport finish() callback. The string is readu for being printed. I suppose just zypper/src/callbacks/rpm.h has to be adapted. In case of success any non-empty reason string should be written to stdout. "%s:\n%s\n" % _("Additional rpm output") % rpmmsg
(accidentally hit <commit>) The result string already contains the 'Additional rpm output:' headline. Just write it.
Only in case of success? I would guess that we'd want _any_ rpm output, even from a failed operation, or?
In case of an error rpm output is already reported via the problem() callback.
Thanx. Done in git, will be in zypper 1.0.7 and 1.1.0.
submitted
Update released for: PackageKit, PackageKit-debuginfo, PackageKit-debugsource, PackageKit-devel, PackageKit-lang, gnome-packagekit, gnome-packagekit-debuginfo, gnome-packagekit-debugsource, gnome-packagekit-lang, libpackagekit-glib10, libpackagekit-glib10-devel, libpackagekit-qt10, libpackagekit-qt10-devel, libqdialogsolver1, libqdialogsolver1-debuginfo, libqdialogsolver1-debugsource, libqdialogsolver1-devel, libsatsolver, libsatsolver-debuginfo, libsatsolver-debugsource, libsatsolver-devel, libzypp, libzypp-debuginfo, libzypp-debugsource, libzypp-devel, perl-satsolver, python-satsolver, ruby-satsolver, satsolver-tools, yast2-pkg-bindings, yast2-pkg-bindings-debuginfo, yast2-pkg-bindings-debugsource, yast2-pkg-bindings-devel-doc, yast2-qt-pkg, yast2-qt-pkg-debuginfo, yast2-qt-pkg-debugsource, zypper, zypper-debuginfo, zypper-debugsource Products: openSUSE 11.1 (debug, i586, ppc, x86_64)