#! /bin/sh
#
# Copyright (c) 1992 by Sun Microsystems, Inc.
#
# @(#)def.dir.flp.sh	1.12	96/07/16 SMI
#
# Default directory file list program (FLP).
# Decides which FLP to run.  
#
# Look first for a shell environment variable named CODEMGR_DIR_FLP.
# If it is exists, assume it names an FLP and run it.
#
# Next look for a file named "dir.flp" in the current
# directory.  If that exists, run it.
#
# Finally, do the standard thing - look for files under SCCS.
#

if [ $# -gt 0 ]; then
  if [ $1 -eq "-V" ]; then
	echo def.dir.flp: TeamWare 2.0 10/16/96 def.dir.flp
    exit 0
  fi
fi

if [ -n "$CODEMGR_DIR_FLG" ]; then
	#
	# Print a warning to stderr
	#
	echo $0: Warning:  The environment variable CODEMGR_DIR_FLG 1>&2
	echo has been renamed to \"CODEMGR_DIR_FLP\".  Please change it in your 1>&2
	echo environemnt. 1>&2
	$CODEMGR_DIR_FLG
elif [ -n "$CODEMGR_DIR_FLP" ]; then
	$CODEMGR_DIR_FLP
elif [ -f dir.flg ]; then
	#
	# Print a warning to stderr
	#
	echo $0: Warning:  Files named \"./dir.flg\" should be renamed to 1>&2
	echo \"./dir.flp\". 1>&2
	./dir.flg
elif [ -f dir.flp ]; then
	./dir.flp
else
	#
	# Recursively find all the files in SCCS subdirectories below the
	# current directory
	#
	find `pwd` -name 's.*' -print | grep '/SCCS/s\.'

	#
	# If find doesn't find anything it will exit 1 and bringover
	# and putback will stop.  Always exit 0 here.
	#
	exit 0
fi
