diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2021-03-26 21:32:11 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2021-03-26 21:32:11 +0000 |
commit | b5c21c056bb0b2c1beec7452775157b7f9ed7fbc (patch) | |
tree | 7e53b777c0406acf1ca6470b77beb3e8a9d2ee80 /Keywords | |
parent | Update ZynAddSubFX to version 3.0.6-rc3: (diff) |
Validate the @sample usage at packaging time
Notes
Notes:
svn path=/head/; revision=569271
Diffstat (limited to 'Keywords')
-rw-r--r-- | Keywords/sample.ucl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Keywords/sample.ucl b/Keywords/sample.ucl index 5022254bcfd2..1a216f0836de 100644 --- a/Keywords/sample.ucl +++ b/Keywords/sample.ucl @@ -20,6 +20,22 @@ actions: [file(1)] arguments: true +prepackaging: <<EOS + if #arg == 1 then + if string.find(arg[1], "%.sample$") == nil then + io.stderr:write("@sample with 1 single argument expect \".sample\" extension\n") + return(1) + end + elseif #arg == 2 then + if arg[1] == arg[2] then + io.stderr:write("@sample: 2 identicals arguments are provided\n") + return(1) + end + else + io.stderr:write("@sample expect 1 or 2 arguments, got " .. #arg .. "\n") + return(1) + end +EOS post-install-lua: <<EOS args = {} for arg in string.gmatch("%@", "%S+") do |