Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-10217

metatools: can't specify multiple versions in defaults

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Important (Ebuild) Important (Ebuild)
    • None
    • None
    • Fixing this makes it much easier to use the multi-version functionality in metatools to keep groups of packages in sync.

      Currently, metatools only looks for a "version" key in the "base pkginfo", before merging it with the default values, resulting in an error in the multiple versions case (when "version" is a dict) since it bypasses the logic that handles the "version" key and proceeds to blindly treat it as a string.

       

      Consider the following autogen.yaml:

      kitty_rule:
        generator: github-1
        defaults:
          tarball: kitty-{version}.tar.xz
          github:
            user: kovidgoyal
            repo: kitty
            query: releases
          revision:
            0.25.0: 1
          version:
            0.25.1:
              python_compat: python3+
              keywords: '*'
            latest:
              python_compat: python3_9+
              keywords: next
        packages:
          - kitty
          - kitty-terminfo
          - kitty-shell-integration

      Running `doit` on it results in the following output:

      [INFO 19:43:38] Autogen: x11-terms/kitty-{'0.25.1': {'python_compat': 'python3+', 'keywords': '*'}, 'latest': {'python_compat': 'python3_9+', 'keywords': 'next'}}
      [INFO 19:43:38] Autogen: x11-terms/kitty-terminfo-{'0.25.1': {'python_compat': 'python3+', 'keywords': '*'}, 'latest': {'python_compat': 'python3_9+', 'keywords': 'next'}}
      [INFO 19:43:38] Autogen: x11-terms/kitty-shell-integration-{'0.25.1': {'python_compat': 'python3+', 'keywords': '*'}, 'latest': {'python_compat': 'python3_9+', 'keywords': 'next'}} 

      As you can see, it's treating the stringified dict as a version string, which results in no release being found.

      I think this should be resolved since it's not too uncommon to need to lock multiple packages to the same versions.

            invakid404 invakid404
            invakid404 invakid404
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: