rpm-software-management / mock

Mock is a tool for a reproducible build of RPM packages.
GNU General Public License v2.0
384 stars 235 forks source link

mock: avoid the %pre scriptlet if possible #1498

Open praiskup opened 3 weeks ago

praiskup commented 3 weeks ago

The script for generating the %pre scriptlet is non-existing on new distributions (like Mageia now, but Fedora will drop that sooner or later, too). The build of Mock on Mageia previously relied on sysusers.generate-pre.sh, and failed.

The sysusers feature is an RPM built-in anyway (on modern systems), so there's no reason to duplicate the logic in %pre. Generate the %pre scriptlet only for older distributions.

Complements: #1367 Relates: #289 Relates: https://github.com/fedora-copr/copr/issues/2789

Conan-Kudo commented 3 weeks ago

Wouldn't it be simpler to just vendor the script in the packaging so that it works everywhere?

praiskup commented 3 weeks ago

Nah, what a tiring dark packaging corner :-( I'm not sure. Not sure I understand what you are saying; forget about %sysusers_create_compat, and start hardwiring of the getent group 'mock' >/dev/null || groupadd -f -g '135' -r 'mock' || : ?

praiskup commented 3 weeks ago

@Conan-Kudo PTAL

praiskup commented 2 weeks ago

@Conan-Kudo does it make sense now?

praiskup commented 2 weeks ago

I think I did what you mentioned (not sure). This is tricky though, it would be nice to see a "reference" implementation.

praiskup commented 2 weeks ago

ptal