[Bug 812292] New: PackageKit's command_not_found_handle prints to stdout
https://bugzilla.novell.com/show_bug.cgi?id=812292 https://bugzilla.novell.com/show_bug.cgi?id=812292#c0 Summary: PackageKit's command_not_found_handle prints to stdout Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: x86-64 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: tr@thomasrast.ch QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Firefox/17.0 conkeror/1.0pre The package PackageKit installs a script /etc/profile.d/PackageKit.sh which installs a command_not_found_handle function for bash to use when the user invokes an unknown command. This function prints to stdout (not stderr!). This is terrible because the error will be lost if one mistypes a command in the presence of redirections: $ . /etc/profile.d/PackageKit.sh $ srot foo | grep test $ time gerp foo >/dev/null real 0m0.002s user 0m0.000s sys 0m0.002s In previous versions of openSuSE it was possible to fix it by simply uninstalling the offending package (command-not-found IIRC), but this time it is tied to PackageKit! So one needs to resort to 'undef -f command_not_found_handle' in .bashrc. Reproducible: Always Steps to Reproduce: $ . /etc/profile.d/PackageKit.sh $ srot foo | grep test Actual Results: Nothing printed Expected Results: Should print 'bash: srot: command not found' to stderr. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=812292 https://bugzilla.novell.com/show_bug.cgi?id=812292#c Xiaolong Li <xlli@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xlli@suse.com AssignedTo|bnc-team-screening@forge.pr |os.gnome.maintainers@gmail. |ovo.novell.com |com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=812292 https://bugzilla.novell.com/show_bug.cgi?id=812292#c1 Dominique Leuenberger <dimstar@opensuse.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dimstar@opensuse.org --- Comment #1 from Dominique Leuenberger <dimstar@opensuse.org> 2013-04-06 13:08:28 UTC --- PackageKit's c-n-f handler has actually not been touched in like 2 years... And /etc/profile.c/PackageKit.sh existed on 12.2 as well (why are you even sourcing it if you don't want to use it?) 2ndly: the entire script does not work.. the 'real' idea behind this handler would actually be to trigger pk to install the command if it can be found; which is likely even more disturbing... command-not-found still exists as the package of choice. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=812292 https://bugzilla.novell.com/show_bug.cgi?id=812292#c2 --- Comment #2 from Thomas Rast <tr@thomasrast.ch> 2013-04-08 12:16:32 UTC --- (In reply to comment #1)
PackageKit's c-n-f handler has actually not been touched in like 2 years... And /etc/profile.c/PackageKit.sh existed on 12.2 as well (why are you even sourcing it if you don't want to use it?)
I'm not sourcing it. The example was merely to ensure that you get the same results. My point is that it's broken in a default install: /etc/profile automatically sources /etc/profile.d/*. I'm not going to argue the merits of a command_not_found_handle; I don't want one, but I can see why it is nice to have one by default. But it MUST print to stderr. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=812292 https://bugzilla.novell.com/show_bug.cgi?id=812292#c3 Dominique Leuenberger <dimstar@opensuse.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #3 from Dominique Leuenberger <dimstar@opensuse.org> 2013-09-29 17:41:06 UTC --- Due to # don't run if packagekitd doesn't exist in the _system_ root [ ! -x /usr/libexec/packagekitd ] && runcnf=0 The script never even attempts to do anything, so, yes, this is entirely broken. The CNF handler used on openSUSE lives in the package command-not-found. So, as a solution for upcoming openSUSE releases, I did: Request: #201398 submit: home:dimstar:branches:GNOME:Factory/PackageKit(cleanup) -> GNOME:Factory Message: - Set BUILD_CNF to 0: in openSUSE, we use the sep. command-not-found package for the same purpose. The existing handler anyway never worked, as it checked for the presence of /usr/libexec/packagekitd, which is not a valid openSUSE location. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com