UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Script for updating apps [help needed]

    Scheduled Pinned Locked Moved App Development
    scriptsclickableunfinished
    4 Posts 2 Posters 90 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • CiberSheepC Offline
        CiberSheep
        last edited by CiberSheep

        I was collecting some of the regex and code I found here to make a script to update apps from Xenial to Focal.

        I've put some of this in an unfinished sh:
        https://gitlab.com/cibersheep/update-apps
        MR are welcome to finish the process that are missing

        Warning: It is not complete, I'm sure there's a better way of doing things and it is a good moment to do the same for Noble. Here's where I need your help.

        Xenial to FocalUpdate to Morph

        • clickable.json to yaml
          • this is pretty bad, is there a better way of doing this? I mean, with the default tool in the system, without an external tool
          • it will leave a dirty yaml file that need to be edited by hand
        • Framework update
          • I think this is ok
          • I'm sure I forgot something here
        • Update to Morph
          • Probably ok
        • Update imports and Ubuntu qml items
          • It turned out pretty well

        Another planet, another time, another universe!

        G 2 Replies Last reply Reply Quote 0
        • CiberSheepC CiberSheep pinned this topic
        • G Offline
          gpatel-fr @CiberSheep
          last edited by

          @CiberSheep said in Script for updating apps [help needed]:

          it will leave a dirty yaml file that need to be edited by hand

          I tried it on this project: https://github.com/august-alt/filemanager-app
          and the result of your script could be loaded by the python yaml library, so what's wrong ? is the software used less lenient than the yaml python library, or is there more complicated clickable.json files ?

          CiberSheepC 1 Reply Last reply Reply Quote 0
          • CiberSheepC Offline
            CiberSheep @gpatel-fr
            last edited by

            @gpatel-fr said in Script for updating apps [help needed]:

            or is there more complicated clickable.json files ?

            Thanks for asking. Yep, when the json has nested elements it would fail?
            For example applying the script to this json:

            }
            [...]
              "kill": "qmlscene",
              "dependencies_host" : [
            	"qml-module-ubuntu-onlineaccounts2"
              ]
            }
            

            will leave a yml file similar to

            [...]
              "kill": "qmlscene"
              "dependencies_host":
            	"qml-module-ubuntu-onlineaccounts2"
            

            and, I think, it should end with a list

            "dependencies_host":
                - "qml-module-ubuntu-onlineaccounts2"
            

            Another planet, another time, another universe!

            1 Reply Last reply Reply Quote 0
            • G Offline
              gpatel-fr @CiberSheep
              last edited by

              @CiberSheep said in Script for updating apps [help needed]:

              with the default tool in the system, without an external tool

              what's the 'system' in fact ? python as installed in 24.04 has json (of course, it's part of the 'batteries') and yaml is packaged too. So if the system is a phone under noble it has everything needed for a conversion.

              If the job is done in a context where for some reason the yaml package is not present, there is always json. Having imported the json file a basic exporting 'by hand' should not be too difficult if one can afford to ignore handling the myriad of special cases that are certainly in the big yaml libraries.

              This assumes that UT clickable.json files are always valid json.
              If it can be false (comments springs to mind) a python solution will fail badly.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post