From 238b5119eb2f78ea60571d3645785ad8ecb2e6b4 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Thu, 24 Feb 2011 21:32:01 +0100
Subject: [PATCH] begin to migrate from plural to singular, CONSISTENTLY

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist-config                              | 41 ++++++++-----------
 conf/{explorers => explorer}/hostname         |  0
 conf/{explorers => explorer}/os               |  0
 conf/{explorers => explorer}/pkg_system       |  0
 conf/{manifests => manifest}/init             |  0
 conf/{types => type}/__file/explorers/md5sum  |  0
 conf/{types => type}/__file/gencode           |  0
 .../__file/parameters/optional                |  0
 .../__file/parameters/required                |  0
 conf/{types => type}/__issue/README           |  0
 conf/{types => type}/__issue/files/archlinux  |  0
 conf/{types => type}/__issue/files/default    |  0
 conf/{types => type}/__issue/manifest         |  0
 .../__issue/parameters/optional               |  0
 .../__issue/parameters/required               |  0
 conf/{types => type}/__package/hints          |  0
 conf/{types => type}/__package/manifest       |  0
 .../__package/parameters/optional             |  0
 .../__package/parameters/required             |  0
 conf/{types => type}/__package_emerge/gencode |  0
 conf/{types => type}/__package_emerge/hints   |  0
 .../__package_emerge/parameters/optional      |  0
 .../__package_emerge/parameters/required      |  0
 23 files changed, 17 insertions(+), 24 deletions(-)
 rename conf/{explorers => explorer}/hostname (100%)
 rename conf/{explorers => explorer}/os (100%)
 rename conf/{explorers => explorer}/pkg_system (100%)
 rename conf/{manifests => manifest}/init (100%)
 rename conf/{types => type}/__file/explorers/md5sum (100%)
 rename conf/{types => type}/__file/gencode (100%)
 rename conf/{types => type}/__file/parameters/optional (100%)
 rename conf/{types => type}/__file/parameters/required (100%)
 rename conf/{types => type}/__issue/README (100%)
 rename conf/{types => type}/__issue/files/archlinux (100%)
 rename conf/{types => type}/__issue/files/default (100%)
 rename conf/{types => type}/__issue/manifest (100%)
 rename conf/{types => type}/__issue/parameters/optional (100%)
 rename conf/{types => type}/__issue/parameters/required (100%)
 rename conf/{types => type}/__package/hints (100%)
 rename conf/{types => type}/__package/manifest (100%)
 rename conf/{types => type}/__package/parameters/optional (100%)
 rename conf/{types => type}/__package/parameters/required (100%)
 rename conf/{types => type}/__package_emerge/gencode (100%)
 rename conf/{types => type}/__package_emerge/hints (100%)
 rename conf/{types => type}/__package_emerge/parameters/optional (100%)
 rename conf/{types => type}/__package_emerge/parameters/required (100%)

diff --git a/bin/cdist-config b/bin/cdist-config
index 5f712bff..8b5f5c69 100755
--- a/bin/cdist-config
+++ b/bin/cdist-config
@@ -31,40 +31,32 @@ set -u
 # Names / Constants
 : ${__cdist_name_bin:=bin}
 : ${__cdist_name_code:=code}
-: ${__cdist_name_explorer:=explorers}
+: ${__cdist_name_explorer:=explorer}
 : ${__cdist_name_gencode:=gencode}
-: ${__cdist_name_host:=hosts}
+: ${__cdist_name_host:=host}
 : ${__cdist_name_init:=init}
 : ${__cdist_name_manifest:=manifest}
-: ${__cdist_name_manifest_dir:=manifests}
 : ${__cdist_name_object:=object}
-: ${__cdist_name_objects:=objects}
 : ${__cdist_name_object_id:=object_id}
+: ${__cdist_name_parameter:=parameter}
+: ${__cdist_name_parameter_required:=required}
+: ${__cdist_name_parameter_optional:=optional}
+: ${__cdist_name_target_host:=target_host}
+: ${__cdist_name_type:=type}
+: ${__cdist_name_type_bin:=type_bin}
+: ${__cdist_name_type_explorer:=type_explorer}
+
 : ${__cdist_name_out_dir:=out}
 : ${__cdist_name_conf_dir:=conf}
-: ${__cdist_name_target_host:=target_host}
-: ${__cdist_name_type:=types}
-: ${__cdist_name_type_bin:=type_bin}
-: ${__cdist_name_type_explorers:=type_explores}
 
 # Exported variable names (usable for non core)
 : ${__cdist_name_var_explorer:=__$__cdist_name_explorer}
-: ${__cdist_name_var_type_explorer:=__$__cdist_name_type_explorers}
-: ${__cdist_name_var_manifest:=__$__cdist_name_manifest_dir}
+: ${__cdist_name_var_type_explorer:=__$__cdist_name_type_explorer}
+: ${__cdist_name_var_manifest:=__$__cdist_name_manifest}
 : ${__cdist_name_var_target_host:=__$__cdist_name_target_host}
 : ${__cdist_name_var_object:=__$__cdist_name_object}
 : ${__cdist_name_var_object_id:=__$__cdist_name_object_id}
 
-# Name of the base directory containing the initial manifests
-: ${__cdist_name_manifests:=manifests}
-
-: ${__cdist_name_params:=parameters}
-: ${__cdist_name_params_required:=required}
-: ${__cdist_name_params_optional:=optional}
-
-# Name of the executable generated
-: ${__cdist_name_exec:=exec}
-
 # File that contains source of a specific object creation
 : ${__cdist_name_object_source:=.source}
 
@@ -74,7 +66,7 @@ set -u
 # Base
 : ${__cdist_conf_dir:=/etc/cdist}
 : ${__cdist_explorer_dir:=$__cdist_conf_dir/$__cdist_name_explorer}
-: ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifests}
+: ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest}
 : ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init}
 : ${__cdist_type_dir:=$__cdist_conf_dir/$__cdist_name_type}
 
@@ -177,10 +169,11 @@ __cdist_type_gencode()
 
 __cdist_type_param_file()
 {
+   # FIXME: local == posix?
    local type="$1"; shift
    local paramtype="$1"; shift
 
-   echo "${__cdist_type_dir}/$type/$__cdist_name_params/$paramtype"
+   echo "${__cdist_type_dir}/$type/$__cdist_name_parameter/$paramtype"
 }
 
 __cdist_type_from_object()
@@ -195,7 +188,7 @@ __cdist_object_id_from_object()
 
 __cdist_object_param_dir()
 {
-   echo "${__cdist_object_base_dir}/$1/$__cdist_name_params}"
+   echo "${__cdist_object_base_dir}/$1/$__cdist_name_parameter}"
 }
 
 __cdist_object_type_explorer_dir()
@@ -210,7 +203,7 @@ __cdist_remote_object_type_explorer_dir()
 
 __cdist_remote_object_param_dir()
 {
-   echo "${__cdist_remote_object_base_dir}/$1/$__cdist_name_params}"
+   echo "${__cdist_remote_object_base_dir}/$1/$__cdist_name_parameter}"
 }
 
 # Find objects, remove ./ and /MARKER
diff --git a/conf/explorers/hostname b/conf/explorer/hostname
similarity index 100%
rename from conf/explorers/hostname
rename to conf/explorer/hostname
diff --git a/conf/explorers/os b/conf/explorer/os
similarity index 100%
rename from conf/explorers/os
rename to conf/explorer/os
diff --git a/conf/explorers/pkg_system b/conf/explorer/pkg_system
similarity index 100%
rename from conf/explorers/pkg_system
rename to conf/explorer/pkg_system
diff --git a/conf/manifests/init b/conf/manifest/init
similarity index 100%
rename from conf/manifests/init
rename to conf/manifest/init
diff --git a/conf/types/__file/explorers/md5sum b/conf/type/__file/explorers/md5sum
similarity index 100%
rename from conf/types/__file/explorers/md5sum
rename to conf/type/__file/explorers/md5sum
diff --git a/conf/types/__file/gencode b/conf/type/__file/gencode
similarity index 100%
rename from conf/types/__file/gencode
rename to conf/type/__file/gencode
diff --git a/conf/types/__file/parameters/optional b/conf/type/__file/parameters/optional
similarity index 100%
rename from conf/types/__file/parameters/optional
rename to conf/type/__file/parameters/optional
diff --git a/conf/types/__file/parameters/required b/conf/type/__file/parameters/required
similarity index 100%
rename from conf/types/__file/parameters/required
rename to conf/type/__file/parameters/required
diff --git a/conf/types/__issue/README b/conf/type/__issue/README
similarity index 100%
rename from conf/types/__issue/README
rename to conf/type/__issue/README
diff --git a/conf/types/__issue/files/archlinux b/conf/type/__issue/files/archlinux
similarity index 100%
rename from conf/types/__issue/files/archlinux
rename to conf/type/__issue/files/archlinux
diff --git a/conf/types/__issue/files/default b/conf/type/__issue/files/default
similarity index 100%
rename from conf/types/__issue/files/default
rename to conf/type/__issue/files/default
diff --git a/conf/types/__issue/manifest b/conf/type/__issue/manifest
similarity index 100%
rename from conf/types/__issue/manifest
rename to conf/type/__issue/manifest
diff --git a/conf/types/__issue/parameters/optional b/conf/type/__issue/parameters/optional
similarity index 100%
rename from conf/types/__issue/parameters/optional
rename to conf/type/__issue/parameters/optional
diff --git a/conf/types/__issue/parameters/required b/conf/type/__issue/parameters/required
similarity index 100%
rename from conf/types/__issue/parameters/required
rename to conf/type/__issue/parameters/required
diff --git a/conf/types/__package/hints b/conf/type/__package/hints
similarity index 100%
rename from conf/types/__package/hints
rename to conf/type/__package/hints
diff --git a/conf/types/__package/manifest b/conf/type/__package/manifest
similarity index 100%
rename from conf/types/__package/manifest
rename to conf/type/__package/manifest
diff --git a/conf/types/__package/parameters/optional b/conf/type/__package/parameters/optional
similarity index 100%
rename from conf/types/__package/parameters/optional
rename to conf/type/__package/parameters/optional
diff --git a/conf/types/__package/parameters/required b/conf/type/__package/parameters/required
similarity index 100%
rename from conf/types/__package/parameters/required
rename to conf/type/__package/parameters/required
diff --git a/conf/types/__package_emerge/gencode b/conf/type/__package_emerge/gencode
similarity index 100%
rename from conf/types/__package_emerge/gencode
rename to conf/type/__package_emerge/gencode
diff --git a/conf/types/__package_emerge/hints b/conf/type/__package_emerge/hints
similarity index 100%
rename from conf/types/__package_emerge/hints
rename to conf/type/__package_emerge/hints
diff --git a/conf/types/__package_emerge/parameters/optional b/conf/type/__package_emerge/parameters/optional
similarity index 100%
rename from conf/types/__package_emerge/parameters/optional
rename to conf/type/__package_emerge/parameters/optional
diff --git a/conf/types/__package_emerge/parameters/required b/conf/type/__package_emerge/parameters/required
similarity index 100%
rename from conf/types/__package_emerge/parameters/required
rename to conf/type/__package_emerge/parameters/required