Hello,

On Mon, 07 Jan 2013 00:12:29 +0100
Michael Biebl <bi...@debian.org> wrote:

> > ifupdown to add that support), so anyone can split their network
> > config into small chucks and place them
> > under /etc/network/interfaces.d — it's not done by default,
> > however, yet.

> Please keep in mind that such a setup will break existing tools and
> scripts, which rely on finding the interface definitions in /e/n/i.
> E.g. the ifupdown plugin in NetworkManager doesn't know anything about
> such a source directive.
> If you are going to use such a interfaces.d/ directory this will break
> the NM integration.

If I understand the code correctly, the attached patch should do the
job. I haven't tried to compile it, however.

-- 
WBR, Andrew
--- a/src/settings/plugins/ifupdown/interface_parser.c
+++ b/src/settings/plugins/ifupdown/interface_parser.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wordexp.h>
 #include "nm-utils.h"
 
 if_block* first;
@@ -211,6 +212,25 @@
 				add_block(token[0], token[i]);
 			skip_to_block = 0;
 		}
+		else if (strcmp(token[0], "source") == 0) {
+			wordexp_t p;
+			char ** w;
+			size_t i;
+			const char * rest = join_values_with_spaces(value, token + 1);
+			int fail = wordexp(rest, &p, WRDE_NOCMD);
+			if (!fail)
+			{
+				w = p.we_wordv;
+				for (i = 0; i < p.we_wordc; i++)
+				{
+					ifparser_init(w[i], quiet);
+				}
+				wordfree(&p);
+			} else {
+				g_message ("Error: failed to match files using %s\n",
+						rest);
+            }
+		}
 		else {
 			if (skip_to_block) {
 				if (!quiet) {

Attachment: signature.asc
Description: PGP signature

Reply via email to