#! /bin/sh

# $Id: GetIdList,v 1.2 93/12/09 22:21:40 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 '\.[oa]$' | egrep -v '(,v|RCS/|/tags$)' | xargs ident 2>&1 |
	egrep '(\$Id:|/)' | uniq | nawk '
    
    BEGIN {
	Name = ""
	E = "cat 1>&2"
    }

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

    /\$Id:/ {
	# Format:
	# $Id: GetIdList,v 1.2 93/12/09 22:21:40 lee Exp $ 

	Line = $0
	sub(/^.*\$Id:[ 	]/, "")
	if (Name ",v" != $1) {
	    printf "Warning: %s: not checked in?\n", FullName # | E
	}
	Rev = $2
	if ($0 ~ /[lL]ocker/) {
	    printf "Warning: locked: %s: %s\n", FullName, Line # | E
	}
	sub(/,v.*$/, "")
	if ($0 == Name) {
	    printf "%s\t%s\n", FullName, Rev
	} else if (Name != "") {
	    printf "%s\n%s\n", FullName, Line
	} else {
	    print Line
	}
	Name = ""
    }
'
