source: CMT/v1r12p20020606/mgr/cmt_buildcvsinfos.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 2.4 KB
Line 
1#!/bin/sh
2
3#---------------------------------------------------------------------
4#
5# This script should be installed within the commitinfo file of CVS
6# using the following line :
7#
8# ...
9#.cvsinfos $CVSROOT/CVSROOT/cmt_buildcvsinfos.sh
10# ...
11#
12# and is used whenever one tries to import a file named cmt.cvsinfos
13#
14#  This file should only contain the name of a CVS module onto which
15# queries are to be done.
16#
17#---------------------------------------------------------------------
18
19#set -x
20
21echo $*
22
23if test "$1" = "" ; then
24  exit 1
25fi
26
27if test "$1" = "cmt.cvsinfos" ; then
28  module=`cat $1`
29elif test "$1" = "methods.cvsinfos" ; then
30  module=`cat $1`
31elif test "$2" = "cmt.cvsinfos" ; then
32  module=`cat $2`
33elif test "$2" = "methods.cvsinfos" ; then
34  module=`cat $2`
35else
36  exit 1
37fi
38
39if test "${module}" = "" ; then
40  exit 1
41fi
42
43if test -d ${CVSROOT}/${module} ; then
44  if test -r ${CVSROOT}/${module}/mgr/requirements,v ; then
45    test_file=${CVSROOT}/${module}/mgr/requirements,v
46  else
47    test_file=`find ${CVSROOT}/${module} -name '*,v' -print | head -n 1`
48  fi
49
50  tags=`tr ' ' '\n' < ${test_file} | \
51   awk '/symbols/,/locks/ {n=split($0,w,"."); if ((n == 2) || (n == 4)) print; }'  | \
52   sed -e 's#:.*##' -e 's#[     ]*##'`
53else
54  echo # Module ${module} not found.
55fi
56
57branches=
58for branch in `ls ${CVSROOT}/${module} | grep -v Attic` ; do
59  if test -d ${CVSROOT}/${module}/${branch} ; then
60    if test ! -r ${CVSROOT}/${module}/${branch}/cmt/requirements,v ; then
61      if test ! -r ${CVSROOT}/${module}/${branch}/mgr/requirements,v ; then
62        if test "${branches}" = "" ; then
63          branches="${branch}"
64        else
65          branches="${branches} ${branch}"
66        fi
67      fi
68    fi
69  fi
70done
71
72subpackages=
73for branch in `ls ${CVSROOT}/${module} | grep -v Attic` ; do
74  if test -d ${CVSROOT}/${module}/${branch} ; then
75    if test -r ${CVSROOT}/${module}/${branch}/cmt/requirements,v ; then
76      if test "${subpackages}" = "" ; then
77        subpackages="${branch}"
78      else
79        subpackages="${subpackages} ${branch}"
80      fi
81    elif test -r ${CVSROOT}/${module}/${branch}/mgr/requirements,v ; then
82      if test "${subpackages}" = "" ; then
83        subpackages="${branch}"
84      else
85        subpackages="${subpackages} ${branch}"
86      fi
87    fi
88  fi
89done
90
91echo tags=${tags}
92echo branches=${branches}
93echo subpackages=${subpackages}
94
95exit 1
Note: See TracBrowser for help on using the repository browser.