Bug 39117 - bash --rpm-requires: syntax error near unexpected token `newline'
Summary: bash --rpm-requires: syntax error near unexpected token `newline'
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: bash (show other bugs)
Version: unstable
Hardware: x86 Linux
: P5 major
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-23 05:52 MSK by Vitaly Chikunov
Modified: 2020-10-23 09:38 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.