Rignchen / Depot

Software to easily access your package manager whatever the os may be
Other
1 stars 1 forks source link

Chose a syntaxe to store "wich packages should be sync" #15

Open Rignchen opened 1 month ago

Rignchen commented 1 month ago

If we want to synchronize packages between 2 computers, we need to know how what packages to install however

For these reasons I thing the syntax we chose should support

Rignchen commented 1 month ago

I suggest to use a json like this one which does support all features above (comments are here to explain which part of the json is responsible of what but won't be there in the file)

[ // List of all packages to install
    [ // List of alternative
        {
            "os": ["Os1", "Os2", "Os3"], // List of operating system where this alternative should be chosen
            "packages": [ // List of packages contained in this alternative
                {
                    "name": "package1", // Name of the package
                    "package_manager": { // Package manager used to install the package on the operating system
                        "Os1": "package_manager1",
                        "Os2": "package_manager2",
                        "Os3": "package_manager3"
                    }
                }
            ]
        }
    ]
]

or to use a yml equivalent

- - os:
    - Os1
    - Os2
    - Os3
    packages:
    - name: package1
      package_manager:
        Os1: package_manager1
        Os2: package_manager2
        Os3: package_manager3

Now this may seems really verbose but in most case there won't be multiple alternative with a dedicated package_manager for each operating system so some parts of it are optional:

Of course the json here is in nice format but it will be stored as 1 line without insignificant white-space to reduce storage taken on the user's disk