#! /bin/sh

# $Id: GetIdList,v 1.1 92/08/24 00:28:37 lee Exp $

# make a list of files & revisions.

echo "# Revision list for lq-text distribution as of `date`"
grep LQTEXTREVISION h/Revision.h
echo "#"
echo "# This file was generated automatically by $0"

find filters h liblq* lqtext menu -type f -print |
	grep -v '\.o$' | egrep -v '(,v|RCS/|/tags$)' | xargs ident |
	egrep '(\$Id:|/)' | uniq | nawk '
    
    BEGIN {
	Name = ""
    }

    /^[^ 	].*\/.*:/ {
	if (Name) {
	    print FullName
	}
	sub(/:$/, "")
	FullName = $0
	gsub(/.*\//, "")
	Name = $0
    }

    /\$Id:/ {
	# Format:
	# $Id: GetIdList,v 1.1 92/08/24 00:28:37 lee Exp $
	Line = $0
	Rev = $3
	if ($0 ~ /[lL]ocker/) {
	    printf "Warning: locked: %s: %s\n", FullName, $0 | "cat -u 1>&2"
	}
	sub(/,v.*$/, "")
	sub(/^.*[ 	]/, "")
	if ($0 == Name) {
	    printf "%s\t%s\n", FullName, Rev
	} else if (Name != "") {
	    printf "%s\n%s\n", FullName, Line
	} else {
	    print Line
	}
	Name = ""
    }
    '
