Closed TSAnsari closed 5 years ago
Did you write or copied those lua scripts from somewhere?
The scripts are from before. They had preinst function implemented. I have only added postinst function to them. Also split the single emmcsetup.lua scripts into 2 emmcsetup1.lua and emmcsetup2.lua as logic in postinst changes for different partitions.
And there was no way of creating a helper lua script that contained common functionality, hence, this duplication of code.
There are a lot of duplicate code (lua-code). Would it be possible to refactor the code/files, and put the duplicate code into a file with common functions taking the variants as arguments?
Yes I tried to find a way to refactor code to so that there is no duplication. But its not possible to add a common helper lua file based on the swupdate design. We can only add one lua file per handler. So everything needs to be in that file. I discussed this with swupdate author and his reply was this is not supported.
Signed-off-by: Tariq Ansari tansari@luxoft.com