| |
@@ -169,11 +169,14 @@
|
| |
# -z calls
|
| |
# -i <go import path> use the specified import path value instead of the one
|
| |
# found in %{goipath<number>}
|
| |
- %go_generate_buildrequires(z:ai:) %{lua:
|
| |
- local fedora = require "fedora.common"
|
| |
- local processall = (rpm.expand("%{-a}") ~= "") and (rpm.expand("%{-z}") == "")
|
| |
- local forcedgoipath = rpm.expand("%{?-i}")
|
| |
- local golistargs = ""
|
| |
+ %go_generate_buildrequires(z:ai:d:t:r:) %{lua:
|
| |
+ local fedora = require "fedora.common"
|
| |
+ local processall = (rpm.expand("%{-a}") ~= "") and (rpm.expand("%{-z}") == "")
|
| |
+ local forcedgoipath = rpm.expand("%{?-i}")
|
| |
+ local golistargs = ""
|
| |
+ local ignore_directory = rpm.expand("%{?-d*}")
|
| |
+ local ignore_directory_tree = rpm.expand("%{?-t*}")
|
| |
+ local ignore_regex = rpm.expand("%{?-r*}")
|
| |
if processall then
|
| |
for _, s in pairs(fedora.getsuffixes("goipath")) do
|
| |
golistargs = golistargs .. " --package-path %{goipath" .. s .. "}"
|
| |
@@ -184,6 +187,15 @@
|
| |
else
|
| |
golistargs = "--package-path %{goipath" .. rpm.expand("%{?-z*}") .. "}"
|
| |
end
|
| |
+ if ignore_directory ~= "" then
|
| |
+ golistargs = golistargs .. " " .. ignore_directory
|
| |
+ end
|
| |
+ if ignore_directory_tree ~= "" then
|
| |
+ golistargs = golistargs .. " " .. ignore_directory_tree
|
| |
+ end
|
| |
+ if ignore_regex ~= "" then
|
| |
+ golistargs = golistargs .. " " .. ignore_regex
|
| |
+ end
|
| |
print(rpm.expand('GOPATH="%{?gobuilddir:%{gobuilddir}:}${GOPATH:+${GOPATH}:}%{?gopath}" ' ..
|
| |
'GO111MODULE=off ' ..
|
| |
"golist --imported " .. golistargs ..
|
| |
Fix #53.
There is a limitation, for now you can onty pass one -d/-t/-r arguments, while golist accepts multiple ones.
It is worked on RPM upstream: https://github.com/rpm-software-management/rpm/pull/2449