canonical / ubuntu-frame

The foundation for many embedded graphical display implementations
GNU General Public License v3.0
159 stars 21 forks source link

display: run configure script after populating the config #188

Closed Saviq closed 5 months ago

Saviq commented 5 months ago

Otherwise the file doesn't get the DO NOT EDIT header and things don't work as expected.

Fixes #187

AlanGriffiths commented 5 months ago

Does this actually do the best thing?

The dance between run-daemon, configure and initialise-display-config already looks fragile. And executing configure to get the side effect of rewriting $SNAP_DATA/frame.display seems to add complexity to that.

It looks like the elif grep "DO NOT EDIT THIS FILE BY HAND"... clause in the configure script is the better place to handle this case. (By removing the file regardless of the header.)

Saviq commented 5 months ago

Does this actually do the best thing?

The dance between run-daemon, configure and initialise-display-config already looks fragile. And executing configure to get the side effect of rewriting $SNAP_DATA/frame.display seems to add complexity to that.

On the one hand, yes - on the other, configure should be idempotent, and safe… it already ran on refresh / installation just before this script. If we're not confident in it, that needs fixing.

I could just rewrite the file directly in the initialise- script, but that risks them going out of sync…

It looks like the elif grep "DO NOT EDIT THIS FILE BY HAND"... clause in the configure script is the better place to handle this case. (By removing the file regardless of the header.)

That would cause custom configuration (predating the display key) to be overwritten on the first run of the configure script e.g. on refresh. And we need to backport the fix to the 22 track.