OrderWithRequires(pre) would probably be better for the use case which is 
described in this PR, but OrderWithRequires without pre also worked. This is 
probably some undocumented behaviour in dependency resolution, probably it 
tries to install required packages before the package which requires them, but 
I'm not sure.

```
# rpm -E %systemd_ordering
OrderWithRequires(post): systemd 
OrderWithRequires(preun): systemd 
OrderWithRequires(postun): systemd 
```

Implemention of Requires(pre) etc. generators will be ugly because it will 
requires to add each RPMTAG separately. It would be nice if the generator could 
print e.g. `post: xxx` to stdout, but it cannot be implemented with the current 
architecture of generators as far as I understand.
Scriptlets can be converted into files 
(https://github.com/rpm-software-management/rpm/issues/1033#issuecomment-583142300),
 it would easify making generators for them.

@Conan-Kudo pointed that most scriptlets are designed to fail silently, e.g. 
scriptlets that call `systemctl` fail silently if systemd is not installed, 
what allows to make a minmal system aithout systemd. Adding 'Requires(pre): 
systemd' will break this usecase. 'OrderWithRequires(pre): systemd' would solve 
that. In some other cases it is useful to make sure that the binary which is 
called is already installed and has all its dependencies satisfied when the 
scriptlet is executed. `bash --rpm-requires` can be used to generate 
(OrderWith)Requires for scriptlets.

Maybe generatore 'Provides: cmd(xxx)' for files inside /sbin /usr/sbin /bin 
/usr/bin and convert the output of `bash --rpm-requires` to 
'OrderWithRequires(scriptlet type): cmd(xxx)'

These are just some thoughts...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1257#issuecomment-641245796
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to