From 2277880e4b75868300f7c958e50a289ae917c831 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 9 Mar 2011 09:52:43 +0100 Subject: [PATCH] in theory finish type-listing to reference migration Signed-off-by: Nico Schottelius --- Makefile | 6 +- ...reference.text => cdist-reference.text.sh} | 74 ++++++++++++++-- doc/man/cdist-type-listing.text.sh | 87 ------------------- 3 files changed, 70 insertions(+), 97 deletions(-) rename doc/man/{cdist-reference.text => cdist-reference.text.sh} (67%) mode change 100644 => 100755 delete mode 100755 doc/man/cdist-type-listing.text.sh diff --git a/Makefile b/Makefile index 689b4a5a..9e3460f7 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ MANSRC=$(MANDIR)/cdist-config-layout.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-terms.text \ -MANGENERATED=$(MANDIR)/cdist-type-listing.text +MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-bin-transfer.text \ @@ -52,8 +52,8 @@ doc/man/.marker: $(MANSRC) $(MANGENERATED) touch $@ # Only depends on cdist-type__*.text in reality -$(MANDIR)/cdist-type-listing.text: $(MANSRC) $(MANDIR)/cdist-type-listing.text.sh - $(MANDIR)/cdist-type-listing.text.sh +$(MANDIR)/cdist-reference.text: $(MANSRC) $(MANDIR)/cdist-reference.text.sh + $(MANDIR)/cdist-reference.text.sh clean: diff --git a/doc/man/cdist-reference.text b/doc/man/cdist-reference.text.sh old mode 100644 new mode 100755 similarity index 67% rename from doc/man/cdist-reference.text rename to doc/man/cdist-reference.text.sh index 72ee4f48..c8a49abd --- a/doc/man/cdist-reference.text +++ b/doc/man/cdist-reference.text.sh @@ -1,17 +1,53 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Generate manpage that lists available types +# + +__cdist_pwd="$(pwd -P)" +__cdist_mydir="${0%/*}"; +__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" +__cdist_myname=${0##*/}; +__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" + +filename="${__cdist_myname%.sh}" +dest="$__cdist_abs_mydir/$filename" + +cd "$__cdist_abs_mydir" + +# exec > "$dest" +cat << eof cdist-reference(7) ================== Nico Schottelius NAME ---- -cdist-reference - Variable, path and type reference +cdist-reference - Variable, path and type reference for cdist $(git describe) DESCRIPTION ----------- Various scripts which are not in the core need information on how to find information. This manpage summarises the available environment -variables and paths and clearifies with part may access with variables. +variables, types and paths and clearifies with part may access which variables. PATHS @@ -30,15 +66,15 @@ conf/manifest/init:: It should be primary used to define mapping from configurations to hosts. conf/manifest/*:: - All other files in this directory are not directly used by Cdist, but you + All other files in this directory are not directly used by cdist, but you can seperate configuration mappings, if you have a lot of code in the manifest/init file. This may also be very helpful to have different admins maintain different groups of hosts. -conf/explorer/: +conf/explorer/:: Contains explorers to be run on the target hosts, see cdist-explorer(7). -conf/type/: +conf/type/:: Contains all available types, which are used to provide some kind of functionality. See cdist-type(7). @@ -66,7 +102,7 @@ conf/type//explorer:: See cdist-explorer(7). -out/: +out/:: This directory contains output of cdist and is usually located in a temporary directory and thus will be removed after the run. @@ -86,11 +122,26 @@ out/object/:: out/object//explorers:: Output of type specific explorers, per object. -tmp_dir: Temporary storage: +tmp_dir:: A tempdir and a tempfile is used by cdist internally, which will be removed when the scripts end automatically. See cdist-config(1). +TYPES +----- +The following types are available: + +eof +for type in cdist-type__*.text; do + name_1="${type#cdist-type}" + name_2="${name_1%.text}" + + name="$name_2" + echo "- $name" +done + +cat << eof + VARIABLES --------- @@ -123,9 +174,18 @@ __type_explorers:: SEE ALSO -------- - cdist(7) +eof +for type in cdist-type__*.text; do + name_2="${type%.text}" + name="$name_2" + echo "- ${name}(7)" +done + +cat <. -# -# -# Generate manpage that lists available types -# - -__cdist_pwd="$(pwd -P)" -__cdist_mydir="${0%/*}"; -__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" -__cdist_myname=${0##*/}; -__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" - -filename="${__cdist_myname%.sh}" -dest="$__cdist_abs_mydir/$filename" - -cd "$__cdist_abs_mydir" - -exec > "$dest" - -cat << eof -cdist-type-listing(7) -===================== -Nico Schottelius - - -NAME ----- -cdist-type-listing - Available types in cdist - - -SYNOPSIS --------- -Types that are included in cdist $(git describe). - - -DESCRIPTION ------------ -The following types are available: - -eof -for type in cdist-type__*.text; do - name_1="${type#cdist-type}" - name_2="${name_1%.text}" - - name="$name_2" - echo "- $name" -done - -cat << eof - - -SEE ALSO --------- -- cdist-type(7) -eof -for type in cdist-type__*.text; do - name_2="${type%.text}" - - name="$name_2" - echo "- ${name}(7)" -done - -cat <