Closed nim-nim closed 6 years ago
I can imagine we create new macro (e.g. __go_ignore
) that gets wired down to the golist
binary.
With https://github.com/gofed/symbols-extractor/pull/140 merged, we can do something like:
%global __go_ignore -d DIR1 -d DIR2 -t TREE1 -t TREE2 -r REGEX1 -r REGEX2
In cases the %goinstall
needs to ignore more resource, the same options can be used:
%goinstall -d DIR3 -t TREE3 ...
The %gochecks -d ... -t ... -r ...
is currently not supported.
@nim-nim is it sufficient? So far I had to specify:
%global __go_ignore -t %{gobaseipath}/_third_party
%global __go_ignore -t %{gobaseipath}/examples
%global __go_ignore -t %{gobaseipath}/examples
%global __go_ignore -r /testdata
%global __go_ignore -r /testdata -t %{gobaseipath}/_conformance
%global __go_ignore -t %{gobaseipath}/examples -t %{gobaseipath}/revel
%global __go_ignore -t %{gobaseipath}/examples
%global __go_ignore -t examples
%global __go_ignore -t %{gobaseipath}/_example
%global __go_ignore -r /testdata
It sucks to use the %{gobaseipath} prefix for the trees and directories. However, the buildroot can contain more import path prefixes so it needs to be distinguished (though it is only a fraction of all Go packages).
Real life is messy and excluding just the right bits of a Go project to make it work can take quite a lot of exclusion directives. Their number should not be limited
Also, since rpm does not like long flag names in macros, and to simplify the correspondance between the spec code and the Go code, single-letter flag names should be accepted
For example: -d exclude/ignore the content of a whole directory (not recursive, subdirectories are not ignored)
-t exclude/ignore the content of a whole directory tree (recursive, subdirectories are ignored too
-r exclude/ignore whatever marches the Go regexp
-f exclude/ignore a specific file (though that is quite rare and can be done via regexes in the short term)