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

metatools: github GRABBY matcher fail when there are number in tag name (for example xfce4-session-4.18.1)

    • Icon: Bug Bug
    • Resolution: Expected Behavior
    • Icon: Normal Normal
    • None
    • None
    • None
    • Hide
      a) example script in "description"
      b) try to autogen package which have prefix with numbers, for example 'xfce4-4.18.1', 'awesome2-5.13' ...
      Show
      a) example script in "description" b) try to autogen package which have prefix with numbers, for example 'xfce4-4.18.1', 'awesome2-5.13' ...

      The metatools github.RegexMatcher class method match only examines first match of expresion and returning wrong version:

       

      #!/usr/bin/env python
      from funtoo.pkgtools import github
      if __name__ == '__main__':
        r = github.RegexMatcher()
        v = r.match("xfce4-session-4.18.1") # matches first occurence, returns '4'
        should_be = "4.18.1"
        print(f"GRABBY    => `{v}`")
        print(f"should be => `{should_be}`")
       

      One of possible solutions:

       

      1. use findall method and return result of last occurrence of regex

      2. throw exception if expresion matches multiple regex occurences

       

            Unassigned Unassigned
            tautvis tautvis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: