RFC: adding shell scripting capabilities will bring PM2 to the next level

@adekker now¹, I put the @olf answer in the right dimension: PM2 is a tool useful to customise the UI because everything else cannot be correctly addressed with PM2.

While the PM3 never get into SFOS because wasn’t able to deal with fakeroot

¹ now - means - after having realised that the documentation on the github, it is the WHOLE documentation which exist.


DOCUMENTATION SHORT COMINGS

update: [WRONG] It is not necessary -p1, also a patch that requires -p0 works as well. Also diff -pruN generates valid patches. [/WRONG] The -p1 works well also with absolute paths like diff -pruN /usr/bin/ciao.sh.orig /usr/bin/ciao.sh

Most of the patches that I saw does not have such .json file. Moreover, creating and adding it would be a task for the Web Catalog which will receive all data from the patch author.

The syntax an example of .qml is completely missing or at least the link to - but in doc there is nothing about.

Finally, it has been said that Web Catalog is in charge for .json but Web Catalog does not add such a file into the archive. Moreover, if a .json is included into the patch then it should be removed to not conflicts with the one generated by Web Catalog. The the explanation of the .json shoud be posticipated after this section otherwise people need to read two times the documentation to understand the plot (it is a crime novel not a man page :rofl:).

DOCUMENTATION LACKS

It is not explained that Patch Manager is not a system service and it removes the patches at the shutdown and brings them up at the boot time because it uses a temporary not persistent folder to store some changes. This breaks the system services that has been patched but raised up BEFORE the Patch Manager completed his job. Because Patch Manager itself is part of the UI, then it depends by d-bus system service.


For everything below IMHO and AFAIK apply.


Patch Manager analisys

For most of system services wait for d-bus is too late or even completely unfeasible expecially if d-bus waits for them. Thus, PM2 need a system handler to apply patches before systemd will be started (e.g. at run-level 1 aka single user). Or it should work in a way that patches are persistent until disabled. This second option is compatible with giving the PM2 simply but powerful script capability.

And now we are again in a loop: persistence could not unversally achived because JailFish create temporary fake root. Therefore system patches that would benefits of the shell scripting capability cannot be delivered by this tool and this explain why @olf wrote that a “complex” patch needs to be delivered by a RPM.

Patch Manager evolution

It is clear that the current Patch Manager is a tool dedicated to customise the UI and nothing more than that. This SHOULD be clearly reported in its documentation.

As wrote before (here) and confuting the @poetaster 's humor that I appreciated very much and I hope you appreciated the analogy with the crime novel plot:

The next level for Patch Manager is a Web Catalog feature that ask the developer/patcher if s/he wants deliver a UI patch or a system patch. In the first case, everything remain the same as by now and in the second case create a RPM to install into the system¹.

I know, it would be a simple RPM that it will apply a patch (or explode an archive) and execute 4 scripts if they exists and it will. After all, doing pkcon search patch we discover that the repository is plenty of patches that the common user is not aware about by UI and Patch Manager.

Conclusion

First of all, I can had overlook or miss something (most probably) because it is my first month anniversary among the sailors.

IMHO, there is a lot of work done (pkcon search patch proves it), poor documentation, break-your-head-against-the-wall attitude and on the other side there is no a product because the current flag ships smartephones Xperia 10 II & III barerly work for the basic functions - they might work in some conditions and for some users - but in general they do not.

Now, it is pretty clear for me because Jolla is going to face a bankruptcy!

My be the last chance to change for the sailors, I suppose. :blush:

Notes

¹ there is no reason because a wo/man should do a work that a robot can do faster and even better unless you are a sadic which likes other people suffer an usless and tireless pain! :rofl: