Bug 846209 - bash "read" does not work inside publish script
bash "read" does not work inside publish script
Status: CLOSED CURRENTRELEASE
Product: PressGang CCMS
Classification: Community
Component: CSProcessor (Show other bugs)
1.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lee Newson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-07 03:12 EDT by Joshua Wulf
Modified: 2014-10-19 19:01 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.26.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-06 21:29:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Wulf 2012-08-07 03:12:38 EDT
Using this:
https://svn.devel.redhat.com/repos/ecs/Red_Hat_Enterprise_MRG/2.2/publish.sh

as a publish script, it consistently fails at the "read" line, simply stopping - not taking further input or continuing to execute.

Executing the script in a standalone environment, outside the publish script it works as expected.

Seems to be something to do with the way csprocessor calls the script.

I need to have a "Press Y to continue, N to cancel" type thing in my script.

It was cspclient 0.26.1 on my other machine, so I'll generate the JVM version and add later to this bug.
Comment 1 Lee Newson 2012-08-07 03:20:39 EDT
No need to generate the details unless you want. I can easily confirm this as STDIN is handled by Java and not piped to the scripts. Whether or not that should be allowed is something I want to think on and discuss with the team first.
Comment 2 Joshua Wulf 2012-08-08 00:13:22 EDT
Here's my use case:

In my publish script I assemble the book, run some pre-processing on the xml, build it, then display it in a web browser for a final visual inspection before doing the rhpkg.

At that point I want to prompt: "Everything OK with this build? Shall I publish? [Y/N]"
Comment 3 Lee Newson 2012-08-08 02:43:00 EDT
I haven't talked this over with the team yet but I couldn't come up with any immediate reason not to add this besides trying block custom scripts somewhat. However in saying that I still think this should be added.
Comment 4 Lee Newson 2012-08-29 03:03:37 EDT
Added in 0.26.5.

The CSP will now pipe STDIN through to the underlying scripts for the publish command only.
Comment 5 Lee Newson 2013-06-06 21:29:59 EDT
Closing and setting as current release as no QA was performed by the original reporter. If there is still an issue with this bug still than please re-open it.

Note You need to log in before you can comment on or make changes to this bug.