summaryrefslogtreecommitdiff
path: root/pkg/nginx
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-12-30 22:43:47 -0800
committerMichael Forney <mforney@mforney.org>2017-12-30 22:43:47 -0800
commitf4c50108da9e4674516112ace7f0097d264fe7e4 (patch)
treeec9475a56ea86d1638c45abb546122d8c0532fe4 /pkg/nginx
parentb5d6c2aaedeb6f1dd760da9461739328666e18b7 (diff)
Add raw mode for iterlines
Diffstat (limited to 'pkg/nginx')
-rw-r--r--pkg/nginx/gen.lua25
1 files changed, 10 insertions, 15 deletions
diff --git a/pkg/nginx/gen.lua b/pkg/nginx/gen.lua
index c70321f9..f17523ba 100644
--- a/pkg/nginx/gen.lua
+++ b/pkg/nginx/gen.lua
@@ -8,10 +8,8 @@ local libs = {}
pkg.deps = {}
local modules = {}
-for line in io.lines(pkg.dir..'/modules.txt') do
- if #line > 0 then
- modules[line] = true
- end
+for line in iterlines('modules.txt') do
+ modules[line] = true
end
if modules['openssl'] then
@@ -28,7 +26,7 @@ if modules['regex'] then
table.insert(pkg.deps, 'pkg/pcre/headers')
end
local zlib = modules['http_gzip_filter'] or modules['http_gunzip_filter']
-for line in io.lines(pkg.dir..'/ngx_auto_config.h') do
+for line in iterlines('ngx_auto_config.h', 1) do
if line == 'NGX_ZLIB 1' then
zlib = true
break
@@ -130,15 +128,13 @@ local sources = paths[[src/(
ngx_linux_sendfile_chain.c
)
)]]
-for line in io.lines(pkg.dir..'/sources.txt') do
- if #line > 0 and not line:hasprefix('#') then
- local i = line:find(' ', 1, true)
- if modules[line:sub(1, i and i - 1)] then
- while i do
- local j = line:find(' ', i + 1, true)
- table.insert(sources, 'src/'..line:sub(i + 1, j and j - 1))
- i = j
- end
+for line in iterlines('sources.txt') do
+ local i = line:find(' ', 1, true)
+ if modules[line:sub(1, i and i - 1)] then
+ while i do
+ local j = line:find(' ', i + 1, true)
+ table.insert(sources, 'src/'..line:sub(i + 1, j and j - 1))
+ i = j
end
end
end
@@ -158,4 +154,3 @@ build('sed', '$outdir/nginx.8', '$srcdir/docs/man/nginx.8', {
man{'$outdir/nginx.8'}
fetch 'git'
-table.insert(pkg.inputs.gen, {'$dir/sources.txt', '$dir/modules.txt', '$dir/ngx_auto_config.h'})