xbps
xbps copied to clipboard
pre-install broken for bootstrapping new chroots
Since xbps was changed to not run scripts within the transaction, installing into a new empty root directory will fail when it tries to execute pre install scripts as nothing is unpacked yet.
Not sure what the best solution to that would:
- Don't run pre-install when installing a package, only for updates.
- Don't run scripts at all when bootstrapping with an empty pkgdb so that one has to use reconfigure.
- Only skip pre-install when bootstrapping with an empty pkgdb.
By third point do you mean "Only skip pre-install ..."? Anyway, I would go for marking packages as unpacked when there is no shell to run scripts, rathrer than cheching for empty pkgdb. This would allow to use very minimal rootdirs, or to pre-populate rootdir with busybox so scripts do run.
For the record, there are three pre-install scripts in packages repo. Two compensate xbps bugs about filetypes, third one creates directiories and assigns their permissions.
By third point do you mean "Only skip pre-install ..."?
Yes.
Anyway, I would go for marking packages as unpacked when there is no shell to run scripts, rathrer than cheching for empty pkgdb. This would allow to use very minimal rootdirs, or to pre-populate rootdir with busybox so scripts do run.
Marking them as "unpacked" would work, but xbps-reconfigure
does not run them at the moment and they kinda lose their purpose if they would be equivalent to post-install scripts.
I think the only good option is to simply not run pre-install scripts when a package is being installed, only run them for updates, we kinda do this already by never running pre-install when bootstrapping with XBPS_TARGET_ARCH
and then reconfiguring with qemu or whatever.