-
-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Description
Description:
I found that the RPM packager implementation is missing critical functionality for executing scripts after installation and uninstallation.
Analyzing the source code in packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart:
-
Missing
%postsupport:
TheMakeRPMConfigclass does not have apostfield definition at all. This makes it impossible to define a post-installation script (needed forudevrules, permissions, etc.) via configuration. -
Broken
%postunsupport:
Thepostunfield exists in theMakeRPMConfigclass, but it is ignored in thetoJson()method. The%postunsection in the Spec file generation is hardcoded, rendering the configuration field useless.
Source Code Reference:
- Missing Field: The class properties list
prep,build,install,postun, butpostis missing. - Hardcoded Logic (
toJsonmethod):
// Current implementation ignores 'this.postun'
'%postun': ['update-mime-database %{_datadir}/mime &> /dev/null || :']
.join('\n'),Proposed Solution:
- Add
String? post;to theMakeRPMConfigclass and its constructor/factory. - Map the configuration key (e.g.,
post_install_script) to this newpostfield infromJson. - Update
toJsonto correctly inject bothpostandpostuninto the generated map, respecting the user's configuration.
// Expected behavior in toJson():
'%post': [
'update-mime-database %{_datadir}/mime &> /dev/null || :',
post ?? '',
].join('\n'),
'%postun': [
'update-mime-database %{_datadir}/mime &> /dev/null || :',
postun ?? '', // Use the class field instead of ignoring it
].join('\n'),Metadata
Metadata
Assignees
Labels
No labels