info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Developer branches


From: Paul Sander
Subject: Re: Developer branches
Date: Sat, 2 Feb 2002 12:33:14 -0800

Oops,  my previous post referred to a script that collects a bill of
material, which was omitted.  Here's one that I quickly threw together,
updated for CVS v1.10 and later.  Its command line lists directories in
which bills of materials are gathered, with recursive descent.  If no
command line arguments are given, the present working directory is assumed.

The output is a list of 4-tuples:  CVSROOT, path to RCS file relative to
CVSROOT, path to working file, RCS revision number.  I tend to ignore the
CVSROOT field because for me it always points to the same repository.
The fields are tab-separated.

>--- Forwarded mail from address@hidden

>However, I can discuss the details of the relevant algorithms.  Below is a
>script that creates a bill of materials for a checked out work area.  It
>scans the CVS (1.3) state and writes a list of entries for each file under
>CVS control.  Each entry is a single line with three fields, separated by
>tabs.  The entries include a path (relative to $CVSROOT) to the RCS file,
>a path (relative to the root of the work area) to the working file, and
>the version number.  The whole process revolves around lists like this.
>By the way, the RCS file paths should be unique; this is important if you
>wish to track changes made in the modules database.

>--- End of forwarded message from address@hidden

#!/bin/sh

sep="/"
cvsname="CVS"
entname="Entries"
repname="Repository"
rootname="Root"
vsuff=",v"

if [ $# = 0 ]
then
        set -- .
fi

for x in "$@"
do
        find "$x" -type d -a ! -name "$cvsname" -print
done |
while read dir
do
        cvs="${dir}${sep}${cvsname}"
        if [ -d "$cvs" ]
        then
                entfile="${cvs}${sep}${entname}"
                repfile="${cvs}${sep}${repname}"
                rootfile="${cvs}${sep}${rootname}"

                root=`cat "$rootfile"`
                rep=`cat "$repfile"`

                awk '
                BEGIN {
                        FS = "/"
                        OFS = " "       # tab
                }
                $1 == "" { print root, rep sep $2 suf, dir sep $2, $3 }
                ' "dir=$dir" "root=$root" "rep=$rep" "sep=$sep" "suf=$vsuff" 
"$entfile"
        fi
done



reply via email to

[Prev in Thread] Current Thread [Next in Thread]