components/texinfo/svc-texinfo-update
changeset 971 345f87d27ffb
parent 599 3493d2848bde
equal deleted inserted replaced
970:96684f3b89ff 971:345f87d27ffb
    19 #
    19 #
    20 # CDDL HEADER END
    20 # CDDL HEADER END
    21 #
    21 #
    22 
    22 
    23 #
    23 #
    24 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    24 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    25 #
    25 #
    26 
    26 
    27 . /lib/svc/share/smf_include.sh
    27 . /lib/svc/share/smf_include.sh
    28 
    28 
    29 PATH=/usr/bin
    29 PATH=/usr/bin
    82 
    82 
    83 ### Begin Here ###
    83 ### Begin Here ###
    84 
    84 
    85 case "$1" in
    85 case "$1" in
    86 'start'|'refresh')
    86 'start'|'refresh')
       
    87 	if [[ "$1" = 'start' ]]; then
       
    88 		if [[ ! -f "/.SELF-ASSEMBLY-REQUIRED" ]]; then
       
    89 			exit $SMF_EXIT_OK
       
    90 		fi
       
    91 	fi
       
    92 
    87 	# refresh texinfo directories
    93 	# refresh texinfo directories
    88 	for dir_link in $(pkg search -H -l -o path ':link:path:*/info/dir' | \
    94 	for dir_link in $(pkg search -H -l -o path ':link:path:*/info/dir' | \
    89 			  sort -u) ; do
    95 			  sort -u) ; do
    90 		populate_texinfo_directory /${dir_link}
    96 		# test the directory is writable
       
    97 		if [[ ! -w /${dir_link} ]]; then 
       
    98 			echo $SMF_EXIT_OK
       
    99 		else
       
   100 			populate_texinfo_directory /${dir_link}
       
   101 
       
   102 		fi
    91 	done
   103 	done
    92 	# remove any unreferenced directories
   104 	# remove any unreferenced directories
    93 	for link in $(find ${TEXINFO_DATA_DIR} -type l -name '*.backlink') ; do
   105 	for link in $(find ${TEXINFO_DATA_DIR} -type l -name '*.backlink') ; do
    94 		path=$(readlink ${link})
   106 		path=$(readlink ${link})
    95 		if [[ ! -L ${path} ]] ; then
   107 		if [[ ! -L ${path} ]] ; then