root/trunk/tsuite/auto/cp2ftp.pl

Revision 13, 3.8 kB (checked in by gary, 3 years ago)

adjust file properties for ascii and perl files - no source change

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!perl -w
2# all statements that start with a # are comments in perl
3# -w turns on some warnings in above
4
5
6# this is the perl script that is automatically run every night to verify cloudy
7# it ends with sending an email message announcing success or failure - this needs
8# to be modifies of deleted if you are not me
9
10# the variable $exe must be set below to point to a valid cloudy executable
11# for the OS in use
12
13# bring in the perl module that includes copy
14use File::Copy;
15
16# input and output directories
17$source_dir = "c:/projects/cloudy/trunk/source/";
18$data_dir = "c:/projects/cloudy/trunk/data/";
19$tests_dir = "c:/projects/cloudy/trunk/tsuite/auto/";
20$ftp_dir = "c:/Inetpub/ftproot/pub/cloudy/";
21$hazy_dir = "c:/projects/hazy/";
22
23
24# ===========================================================================
25# data
26# remove all files in ftp data subdir
27system(
28"rm \"$ftp_dir\"\"data/\"*.*");
29
30# move to the data directory
31if( !chdir( $data_dir ) )
32{
33       printf(" could not move to data directory\n");
34       printf(" was ==%s==\n",$data_dir );
35       exit(1);
36}
37
38# copy all dat files
39while( defined( $input = glob("*.dat") ) )
40{
41   copy( $input , "$ftp_dir"."data/"."$input" );
42
43# copy all htm scripts
44while( defined( $input = glob("*.htm") ) )
45{
46   copy( $input , "$ftp_dir"."data/"."$input" );
47
48# copy all jpg scripts
49while( defined( $input = glob("*.jpg") ) )
50{
51   copy( $input , "$ftp_dir"."data/"."$input" );
52
53# copy all in scripts
54while( defined( $input = glob("*.in") ) )
55{
56   copy( $input , "$ftp_dir"."data/"."$input" );
57
58# copy all ini scripts
59while( defined( $input = glob("*.ini") ) )
60{
61   copy( $input , "$ftp_dir"."data/"."$input" );
62
63# copy all rfi scripts
64while( defined( $input = glob("*.rfi") ) )
65{
66   copy( $input , "$ftp_dir"."data/"."$input" );
67
68# copy all szd scripts
69while( defined( $input = glob("*.szd") ) )
70{
71   copy( $input , "$ftp_dir"."data/"."$input" );
72
73print( "data copy complete\n");
74
75# ===========================================================================
76# hazy
77# remove all files in ftp hazy subdir
78system(
79"rm \"$ftp_dir\"\"hazy/\"*.*");
80
81# move to the main hazy directory
82if( !chdir( $hazy_dir ) )
83{
84       printf(" could not move to hazy directory\n");
85       printf(" was ==%s==\n",$hazy_dir );
86       exit(1);
87}
88
89while( defined( $input = glob("*.pdf") ) )
90{
91   copy( $input , "$ftp_dir"."hazy/"."$input" );
92
93print( "Hazy copy complete\n");
94
95# ===========================================================================
96# tests
97# remove all files in ftp tsuite subdir
98system(
99"rm \"$ftp_dir\"\"tests/\"*.*");
100
101# move to the tsuite/auto directory
102if( !chdir( $tests_dir ) )
103{
104       printf(" could not move to tests directory\n");
105       printf(" was ==%s==\n",$tests_dir );
106       exit(1);
107}
108
109# copy all input files
110while( defined( $input = glob("*.in") ) )
111{
112   copy( $input , "$ftp_dir"."tests/"."$input" );
113
114# copy all data files
115while( defined( $input = glob("*.dat") ) )
116{
117   copy( $input , "$ftp_dir"."tests/"."$input" );
118
119# copy all perl scripts
120while( defined( $input = glob("*.pl") ) )
121{
122   copy( $input , "$ftp_dir"."tests/"."$input" );
123
124# copy all html scripts
125while( defined( $input = glob("*.htm") ) )
126{
127   copy( $input , "$ftp_dir"."tests/"."$input" );
128
129# copy all jpg scripts
130while( defined( $input = glob("*.jpg") ) )
131{
132   copy( $input , "$ftp_dir"."tests/"."$input" );
133
134print( "tsuite copy complete\n");
135
136# ===========================================================================
137# source
138# remove all files in ftp source subdir
139system(
140"rm \"$ftp_dir\"\"source/\"*.*");
141
142# move to the main source directory
143if( !chdir( $source_dir ) )
144{
145       printf(" could not move to source directory\n");
146       printf(" was ==%s==\n",$source_dir );
147       exit(1);
148}
149
150# copy all files
151while( defined( $input = glob("*") ) )
152{
153   copy( $input , "$ftp_dir"."source/"."$input" );
154
155print( "source copy complete\n");
156
157exit(0);
158
Note: See TracBrowser for help on using the browser.