forked from ungleich-public/cdist
		
	add source record information to created objects
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								489639f8e0
							
						
					
				
			
			
				commit
				
					
						7c8dba566f
					
				
			
		
					 2 changed files with 7 additions and 3 deletions
				
			
		|  | @ -60,6 +60,9 @@ __cdist_bin_prefix="__" | ||||||
| # Used for IDs | # Used for IDs | ||||||
| __cdist_sane_chars='[A-Za-z0-9_]' | __cdist_sane_chars='[A-Za-z0-9_]' | ||||||
| 
 | 
 | ||||||
|  | # Used to mark file that created a specific type | ||||||
|  | __cdist_object_source=".source" | ||||||
|  | 
 | ||||||
| ################################################################################ | ################################################################################ | ||||||
| # Function list | # Function list | ||||||
| # | # | ||||||
|  |  | ||||||
|  | @ -38,9 +38,8 @@ __cdist_tid="${__cdist_myname}/${__cdist_id}" | ||||||
| __cdist_ddir="$(__cdist_cache_host)/${__cdist_tid}" | __cdist_ddir="$(__cdist_cache_host)/${__cdist_tid}" | ||||||
| 
 | 
 | ||||||
| if [ -e "${__cdist_ddir}" ]; then | if [ -e "${__cdist_ddir}" ]; then | ||||||
|    # FIXME: add source! $cdist_config_base/source |    source="$(cat "${__cdist_ddir}/${__cdist_object_source}")" | ||||||
|    # FIXME: force $source information to be present from outside! |    __cdist_usage "${__cdist_tid} already exists (source: $source)" | ||||||
|    __cdist_usage "${__cdist_tid} already exists" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| mkdir -p "${__cdist_ddir}" | mkdir -p "${__cdist_ddir}" | ||||||
|  | @ -61,4 +60,6 @@ while [ $# -gt 0 ]; do | ||||||
| 
 | 
 | ||||||
|    echo "${value}" > "${__cdist_ddir}/${opt_file}" |    echo "${value}" > "${__cdist_ddir}/${opt_file}" | ||||||
| 
 | 
 | ||||||
|  |    echo "${__cdist_abs_myname}" > "${__cdist_ddir}/${__cdist_object_source}" | ||||||
|  | 
 | ||||||
| done | done | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue