Bug 39117

Summary: bash --rpm-requires: syntax error near unexpected token `newline'
Product: Sisyphus Reporter: Vitaly Chikunov <vt>
Component: bashAssignee: placeholder <placeholder>
Status: NEW --- QA Contact: qa-sisyphus
Severity: major    
Priority: P5 CC: glebfm, ldv, placeholder, shaba
Version: unstable   
Hardware: x86   
OS: Linux   

Description Vitaly Chikunov 2020-10-23 05:52:28 MSK
shell.req fails on dracut.sh:

  builder@x86_64:/.in$ echo /usr/src/tmp/dracut-buildroot/usr/bin/dracut | /usr/lib/rpm/shell.req
  /usr/src/tmp/dracut-buildroot/usr/bin/dracut: line 1354: syntax error near unexpected token `newline'
  /usr/src/tmp/dracut-buildroot/usr/bin/dracut: line 1354: `        ID_FS_TYPE=$(get_fs_env "/dev/block/$1") && host_fs_types["$(readlink -f
+"/dev/block/$1")"]="$ID_FS_TYPE"'
  shell.req: ERROR: /usr/src/tmp/dracut-buildroot/usr/bin/dracut: /bin/bash --rpm-requires failed

This seem to be bash --rpm-requires bug. Reproducer:

  $ echo 'x["$(:)"]=y' | bash --rpm-requires
  executable(/etc/bashrc)
  executable(grep)
  function(group)
  bash: line 1: syntax error near unexpected token `newline'
  bash: line 1: `x["$(:)"]=y'
  $

When clean_simple_command() calls assignment() it calls yyparse().
Comment 1 Dmitry V. Levin 2020-10-23 09:38:37 MSK
The implementation of --rpm-requires is severely broken in bash4 because of internal bash changes between bash3 and bash4.