From 6cee6e9d873f63b6ce15ffb875f4acfe6496d020 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Thu, 11 Jun 2009 17:59:47 +0000 Subject: [PATCH] Replace special rule by a module-list.mask file which enumerates all patterns matching the files which should not figure in module-list.nix. svn path=/nixos/branches/modular-nixos/; revision=15941 --- maintainers/scripts/gen-module-list.sh | 16 ++++++++++++++-- modules/module-list.mask | 4 ++++ modules/module-list.nix | 14 +++++++------- 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 modules/module-list.mask diff --git a/maintainers/scripts/gen-module-list.sh b/maintainers/scripts/gen-module-list.sh index c63d1a69521e..e964f11edd16 100755 --- a/maintainers/scripts/gen-module-list.sh +++ b/maintainers/scripts/gen-module-list.sh @@ -30,19 +30,31 @@ is_module(){ " | nix-instantiate - --eval-only } +find_mask(){ + local maskfile="$1" + if test -r "${maskfile}"; then + cat "${maskfile}" + echo + echo "./module-list.nix" + else + echo "./module-list.nix" + fi | \ + sed -ne 's/[ ]*#.*//; /^[ ]*$/ d; s/\(.*\)/-wholename '"'\1'"' -or /p' | tr -d '\n' +} + generate_index(){ local path="$1" cd "$path" echo -n "$path: " 1>&2 { echo "[ # This file has been generated by $(basename $prog)"; - for file in : $(find ./ -wholename '*.impl[./]*' -or -wholename './module-list.nix' -or -type f -name '*.nix' -print | sort); do + for file in : $(eval find ./ $(find_mask ./module-list.mask) -type f -name "'*.nix'" -print | sort); do [ "$file" = ':' ] && continue; echo -n . 1>&2 if test "$(is_module "$file" 2> /dev/null)" = "Bool(True)"; then echo " $file" else echo "##### $file" - is_module "$file" 2>&1 | sed 's/^/# /' + is_module "$file" 2>&1 | sed "s/^/# /; s,$(pwd),.," fi done echo ']'; diff --git a/modules/module-list.mask b/modules/module-list.mask new file mode 100644 index 000000000000..10e9f58925ee --- /dev/null +++ b/modules/module-list.mask @@ -0,0 +1,4 @@ +# CD-DVD modules are not generic. +# Avoid all modules from ./installer/cd-dvd/ + +./installer/cd-dvd/* diff --git a/modules/module-list.nix b/modules/module-list.nix index c6b2d930e5c5..7bdb0d685dcb 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -76,27 +76,27 @@ ##### ./services/web-servers/apache-httpd/per-server-options.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/services/web-servers/apache-httpd/per-server-options.nix:6:2': +# while evaluating the function at `./services/web-servers/apache-httpd/per-server-options.nix:6:2': # the argument named `forMainServer' required by the function is missing ##### ./services/web-servers/apache-httpd/subversion.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/services/web-servers/apache-httpd/subversion.nix:1:2': +# while evaluating the function at `./services/web-servers/apache-httpd/subversion.nix:1:2': # the argument named `serverInfo' required by the function is missing ##### ./services/web-servers/apache-httpd/tomcat-connector.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/services/web-servers/apache-httpd/tomcat-connector.nix:1:2': +# while evaluating the function at `./services/web-servers/apache-httpd/tomcat-connector.nix:1:2': # the argument named `serverInfo' required by the function is missing ##### ./services/web-servers/apache-httpd/twiki.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/services/web-servers/apache-httpd/twiki.nix:1:2': +# while evaluating the function at `./services/web-servers/apache-httpd/twiki.nix:1:2': # the argument named `serverInfo' required by the function is missing ##### ./services/web-servers/apache-httpd/zabbix.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/services/web-servers/apache-httpd/zabbix.nix:1:2': +# while evaluating the function at `./services/web-servers/apache-httpd/zabbix.nix:1:2': # the argument named `serverInfo' required by the function is missing ./services/web-servers/jboss.nix ./services/web-servers/tomcat.nix @@ -129,7 +129,7 @@ ##### ./system/etc/make-etc.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/system/etc/make-etc.nix:1:2': +# while evaluating the function at `./system/etc/make-etc.nix:1:2': # the argument named `stdenv' required by the function is missing ./system/upstart-events/ctrl-alt-delete.nix ./system/upstart-events/halt.nix @@ -137,7 +137,7 @@ ##### ./system/upstart/make-job.nix # error: while evaluating the attribute `' at `(string):2:8': # while evaluating the function at `(string):3:22': -# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/system/upstart/make-job.nix:1:2': +# while evaluating the function at `./system/upstart/make-job.nix:1:2': # the argument named `runCommand' required by the function is missing ./system/upstart/tools.nix ./system/upstart/upstart.nix