Bug 922521

Summary: DNF crashes when passing packages to it via pipe
Product: [Fedora] Fedora Reporter: Jindrich Novy <jnovy>
Component: dnfAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: akozumpl, jzeleny, pknirsch, t-pol
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-0.3.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-14 08:52:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jindrich Novy 2013-03-17 16:08:21 UTC
Description of problem:
rpm -qa | grep kernel-3.*$ | grep -v kernel-3.8.3 | xargs dnf remove
Příprava průběhu odstranění
Řešení závislostí...
--> Starting dependency resolution
--> Hledání nepotřebných závislostí
---> Package kernel.x86_64 3.8.1-201.fc18 will be smazán
---> Package kernel.x86_64 3.7.9-205.fc18 will be smazán
---> Package kernel.x86_64 3.8.2-206.fc18 will be smazán
--> Finished dependency resolution

Závislosti vyřešeny.

=============================================================================================================================================================================
 Package                                Arch                                   Verze                                           Repozitář                                Vel.
=============================================================================================================================================================================
Odstraňuje se:
 kernel                                 x86_64                                 3.7.9-205.fc18                                  @System                                   0  
 kernel                                 x86_64                                 3.8.1-201.fc18                                  @System                                   0  
 kernel                                 x86_64                                 3.8.2-206.fc18                                  @System                                   0  

Shrnutí transakce
=============================================================================================================================================================================
Remove  3 Packages

Nainstalovaná velikost: 0  
V pořádku [a/N]: Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 306, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 215, in main
    return_code = base.doTransaction()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 192, in doTransaction
    if self.conf.assumeno or not self.userconfirm():
  File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 971, in userconfirm
    choice = dnf.i18n.input(msg)
  File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 78, in input
    return raw_input(s)
EOFError: EOF when reading a line

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. have more kernels installed
2. # rpm -qa | grep kernel-3.*$ | grep -v kernel-3.8.3 | xargs dnf remove
2. kaboom
  
Actual results:
crashes

Expected results:
As YUM - i.e. doesn't run the operation.

Additional info:
This runs as expected when:
# rpm -qa | grep kernel-3.*$ | grep -v kernel-3.8.3 | xargs dnf remove -y

Comment 1 Ales Kozumplik 2013-03-18 07:59:12 UTC
thanks for the report. I haven't tested the userconfirm() input with stdin piped into the process so this bug looks very plausible:)

Comment 2 Ales Kozumplik 2013-03-25 09:37:11 UTC
Fixed by 6c27561.

Comment 3 Ales Kozumplik 2013-03-25 09:38:48 UTC
*** Bug 927016 has been marked as a duplicate of this bug. ***