-
-
Notifications
You must be signed in to change notification settings - Fork 209
Description
Bug Description
When building an RPM package as a non-root user (which is standard practice), the build fails during the %install phase with I/O error : Permission denied.
Logs
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.ts4X56
...
+ /usr/lib/rpm/brp-compress /usr
+ update-mime-database /usr/share/mime
I/O error : Permission denied
I/O error : Permission denied
Failed to write XML file; For permission problems, try rerunning as root
Analysis
The issue is located in packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart.
The command update-mime-database %{_datadir}/mime is wrongly placed inside the %install list.
The %install section is meant for copying files into the %{buildroot}. Running update-mime-database against the system path %{_datadir}/mime (which resolves to /usr/share/mime on the host) attempts to modify the developer's operating system, leading to permission errors.
Solution
Remove the following line from the %install section in MakeRPMConfig.dart:
'update-mime-database %{_datadir}/mime &> /dev/null || :',This command should only be run in %post and %postun scripts (after the package is installed on the target machine), not during the build.