ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/scripts/projectlist.sh
Revision: 1.1
Committed: Wed Aug 28 11:19:22 2002 UTC (22 years, 8 months ago) by sashby
Content type: application/x-sh
Branch: MAIN
Log Message:
Added projectlist.sh for providing list of projects to Releases.cgi.

File Contents

# User Rev Content
1 sashby 1.1 #!/bin/sh
2     #===========================================================================#
3     # NAME: projectlist.sh #
4     #===========================================================================#
5     # #
6     # DATE: Wed Aug 28 12:49:33 2002 #
7     # #
8     # AUTHOR: Shaun Ashby #
9     # #
10     # MOD LOG: #
11     # #
12     # #
13     #===========================================================================#
14     # DESCRIPTION: Script produces a list of released projects. Run from an #
15     # acrontab entry under pubzh. #
16     #===========================================================================#
17     CMS_PATH=/afs/cern.ch/cms
18     PATH=$PATH:$CMS_PATH/utils
19     export CMS_PATH PATH
20    
21     # Work from AFS public directory:
22     cd $HOME/public
23    
24     scriptname=`basename $0`
25     self=`echo $scriptname |awk -F. '{print $1}'| tr a-z A-Z`
26     grepopt=-v greppat=".*"
27    
28     ######################
29     case $self in
30     PROJECTLIST ) grepopt=-v greppat="ORCA_3|_pre|CMSToolBox|VALIDATION|optimised|TEST" ;;
31     * ) grepopt= greppat="$self" ;;
32     esac
33    
34     scram list | tail +7 | sed 's/...//g' | perl -e '
35     @lines = ();
36     while (<STDIN>) {
37     chomp;
38     s/\s+/ /g; s/^\s*//; s/\s*$//;
39     /^$/ && next;
40     if (/^Projects available/) {
41     next;
42     } elsif (/^-->/) {
43     next;
44     } elsif (/^([A-Za-z]+) ([A-Za-z]+[A-Za-z0-9_]+)$/) {
45     ($name, $v) = ($1, $2);
46     push(@lines, "$v");
47     } else {
48     push(@lines, $_)
49     }
50     }
51     print join("\n", @lines), "\n";' | egrep $grepopt "$greppat" | sort -rd > "released-projects.txt"