Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%transfiletriggerin does not return file list #644

Closed
tpgxyz opened this issue Mar 20, 2019 · 5 comments
Closed

%transfiletriggerin does not return file list #644

tpgxyz opened this issue Mar 20, 2019 · 5 comments

Comments

@tpgxyz
Copy link

tpgxyz commented Mar 20, 2019

Hi,

i've a script in lua:
%transfiletriggerin -P 900901 -p <lua> -- /usr/share/foo

foo.spec file installs many files in /usr/share/foo
I'd like to catch that all the files which are now installed by foo.rpm using lua script in %transfiletriggerin
I've tired to carch arg[] from 0 to 6 and none of them returned file list.
Even stdin is empty

%transfiletriggerin -P 900901 -p <lua> -- /usr/share/foo
v=io.read()
print(v)

I've tried poorly documented rpm.next_file

%transfiletriggerin -P 900901 -p <lua> -- /usr/share/foo
a = rpm.next_file()
while a do
 print(a)
 a = rpm.next_file()
 end
print("")
io.flush()

Above returned list of files existing in /usr/share/foo already, not those which are about to be installed in foo.rpm

Looking for a help.

@pmatilai
Copy link
Member

With -p file triggers, rpm.next_file() is the right thing to do, -p scriptlets are not forked currently so the stdin is that of rpm itself.

What rpm version is this? File triggers are known to be rather buggy prior to rpm 4.13.1 (and I'm quite positive there are more lurking still)

@tpgxyz
Copy link
Author

tpgxyz commented Mar 20, 2019

@pmatilai I'm running here rpm-4.14.2.1-7.x86_64
rpm.next_file() throws files from path given in here %transfiletriggerin -P 900901 -p -- /usr/share/foo
not from actually installed rpm file index

@pmatilai
Copy link
Member

Right, this rings a bell: those pre-existing files invoke triggers on purpose, see #386
But you should really be getting both the pre-existing and ones from the current transaction. IIRC.

@tpgxyz
Copy link
Author

tpgxyz commented Mar 20, 2019

@pmatilai Sorry i can not confirm that rpm.next_file() returns files from current transaction. Maybe this is because my triggers dir is different that install dir ?

%transfiletriggerin -P 900901 -p -- /usr/share/foo
--   returns files that already exists in /usr/share/foo and one file which is installed in current transaction

foo.rpm does carry more files in different directory, but these are not listed on above call, which is quite important to me.

@tpgxyz
Copy link
Author

tpgxyz commented Mar 21, 2019

Anyways i've fixed this. Error was on my side. Thanks for your time.

OpenMandrivaAssociation/systemd@d56fdec

@tpgxyz tpgxyz closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants