#64 %license LICENSE vendor/modules.txt fails with certain module.txt files
Closed by gotmax23. Opened by buckaroogeek.

Processing vendor/modules.txt file for kubernetes will fail. Error (using modified code to show problem) is similar to:

# gopkg.in/yaml.v2 v2.4.0
# gopkg.in/yaml.v3 v3.0.1
# k8s.io/api v0.0.0 => ./staging/src/k8s.io/api
Traceback (most recent call last):
  File "/home/bgsmith/tmp/go/vendor2provides.py", line 55, in <module>
    exit(main())
         ^^^^^^
  File "/home/bgsmith/tmp/go/vendor2provides.py", line 38, in main
    ipath, version = replace_regex.sub("", dep[2:]).split(" ")[:2]
    ^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

The modules.txt file can be found at: https://github.com/kubernetes/kubernetes/blob/master/vendor/modules.txt.

In https://github.com/kubernetes/kubernetes/blob/master/staging/README.md the kubernetes team writes: "Kubernetes code uses the repositories in this directory via a Go workspace and module replace statements. For example, when Kubernetes code imports a package from the k8s.io/client-go repository, that import is resolved to staging/src/k8s.io/client-go relative to the project root:"

It appears that using Replace directive in go.mod and/or go.work results in the lines like # k8s.io/api v0.0.0 => ./staging/src/k8s.io/api which are not (yet) handled by the script. I do not know if these lines should be parsed or just skipped? If parsing is needed, then how to get the correct version?


https://pagure.io/go-rpm-macros/pull-request/65

Metadata Update from @gotmax23:
- Issue status updated to: Closed (was: Open)

Metadata
Related Pull Requests