Skip to content

HADOOP-19758. Avoid tput in shell usage formatting when unavailable.#8387

Open
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HADOOP-19758-ncurses-shell
Open

HADOOP-19758. Avoid tput in shell usage formatting when unavailable.#8387
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HADOOP-19758-ncurses-shell

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Summary
Avoid invoking tput when it is not installed, so Hadoop shell usage formatting works on minimal distros without ncurses.

Change

  • hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh: guard the terminal-width probe with command -v tput and fall back cleanly to the default width.
  • hadoop-common-project/hadoop-common/src/test/scripts/hadoop_subcommands.bats: add a regression for the missing-tput path.

JIRA
Fixes HADOOP-19758

@deepujain
Copy link
Copy Markdown
Contributor Author

Fixed the usage formatter to skip tput when it is unavailable and added a regression for the missing-tput path. I also verified the formatter directly in a PATH without tput, and it prints cleanly now. Ready for review.

@edwardcapriolo
Copy link
Copy Markdown
Contributor

Cool nice job. When i mentioned it I never thought someone else wold fix! I just installed ncurses in my docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants