Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1366778 - filetrigger stdin filelist not available for <lua> stdin
Summary: filetrigger stdin filelist not available for <lua> stdin
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-12 19:15 UTC by Ville Skyttä
Modified: 2016-09-29 09:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-29 09:33:17 UTC


Attachments (Terms of Use)

Description Ville Skyttä 2016-08-12 19:15:12 UTC
$ rpm -q rpm
rpm-4.13.0-0.rc1.40.fc25.1.x86_64

File trigger scriptlets are supposed to receive a list of files in their stdin. This works ok for e.g. shell trigger scripts such as:

    %filetriggerin -- %{_bindir}/
    while read file; do
        echo $file
    done

But lua scriptlets seem to receive the stdin of the shell, not the list of files. rpm -ivh of a package containing the following hangs in the scriptlet until e.g. Ctrl-D:

    %filetriggerin -p <lua> -- %{_bindir}/
    while true do
        local line = io.read()
        if line == nil then break end
        print(line)
    end

Comment 1 Florian Festi 2016-09-29 09:33:17 UTC
Looks like this is intentional. For lua scriptlet there is a built-in function rpm_next_file. I added a brief section to http://rpm.org/wiki/PackagerDocs/FileTriggers pointing this out.


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