<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Allow include statement to operate on directories and/or wildcards"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1154#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Allow include statement to operate on directories and/or wildcards"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1154">bug 1154</a>
from <span class="vcard"><a class="email" href="mailto:hoxu@users.sf.net" title="hoxu@users.sf.net">hoxu@users.sf.net</a>
</span></b>
<pre>(In reply to Ismo Puustinen from <a href="show_bug.cgi?id=1154#c6">comment #6</a>)
<span class="quote">> Consider this directory structure where dir1 and dir2 are include directories
> (nft -I dir1 -I dir2 ...):
>
> dir1/
> cba.nft
> acb.nft
> dir2/
> abc.nft
> dir3/
> a.nft
>
> What about the following include cases:
>
> include "*"
>
> This means that all files in all include directories get added. However,
> what do
> we do for directory "dir3"? Should that cause an error or not?</span >
Would a recursive include cause problems?
<span class="quote">> include "a*"
>
> Files starting with 'a' are in both include directories. Should we add the
> files
> in alphabetic order [abc.nft, acb.nft] or in include directory order
> [acb.nft, abc.nft]?</span >
I would probably expect the latter; an alphabetical order including the
directories.
<span class="quote">> include "foo*.nft"
>
> There is no match. I think this shouldn't cause an error, because the whole
> point of implementing globbing is that we can include files from potentially
> empty directories. Do you agree?</span >
Absolutely!
<span class="quote">> include "foo.nft"
>
> There is no match. Should this be an error, or do we think of this as a
> special
> case of glob with no wild cards, and thus not an error?</span >
This leaves me wondering whether the globbing include should be a distinct
keyword/statement?
Otherwise I'd expect an error.
<span class="quote">> include "dir4/*"
>
> There is no such directory. Should this be an error? Or what would it mean?</span >
I see this as a similar case to the earlier "foo*.nft". No matches with a
wildcard = no errors.
For example, a distribution could ship /etc/nftables.conf with:
include "nftables/rules-enabled/*.nft"
and that directory wouldn't need to exist by default. (granted, a naive
example)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>