Subversion Repositories camp_sysinfo_client_3

Rev

Rev 229 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 229 Rev 236
Line 57... Line 57...
57
   --debug      - Show extra information (--nodebug is default)
57
   --debug      - Show extra information (--nodebug is default)
58
END
58
END
59
}
59
}
60
 
60
 
61
 
61
 
-
 
62
# returns 0 on success, so call with
-
 
63
# if ( my $return = &doCommand $command ) {
-
 
64
#    failure code
-
 
65
# } else {
-
 
66
#    success code
-
 
67
# }
-
 
68
# 
-
 
69
sub doCommand {
-
 
70
   my $command = shift;
-
 
71
   system $command;
-
 
72
   if ($? == -1) { # Could not even find the file?? Or not executable
-
 
73
       return -1;
-
 
74
   }
-
 
75
   elsif ($? & 127) { # major failure with, possibly, code dump
-
 
76
       return $? & 127;
-
 
77
   } else { # we had some kind of failure, just return the failure code
-
 
78
       return $? >> 8;
-
 
79
   }
-
 
80
   return 0;
-
 
81
}
-
 
82
 
62
################################################################
83
################################################################
63
#               Main Code                                      #
84
#               Main Code                                      #
64
################################################################
85
################################################################
65
 
86
 
66
# handle any command line parameters that may have been passed in
87
# handle any command line parameters that may have been passed in
Line 91... Line 112...
91
            . " -o $os" 
112
            . " -o $os" 
92
            . ( $quiet ? ' -q' : '' ) 
113
            . ( $quiet ? ' -q' : '' ) 
93
            . ( $DEBUG ? ' --debug' : '')
114
            . ( $DEBUG ? ' --debug' : '')
94
            . ( $dryRun ? ' -n' : '' );
115
            . ( $dryRun ? ' -n' : '' );
95
&logIt( "Running command $command" );
116
&logIt( "Running command $command" );
96
system $command;
117
if ( doCommand( $command ) ) {
-
 
118
   die "I had an error executing $command\n";
-
 
119
}
97
&logIt( "\tReturn value is $returnValue" );
120
&logIt( "\tReturn value is $returnValue" );
98
 
121
 
99
$command = $scriptDir . '/checkFiles'
122
$command = $scriptDir . '/checkFiles'
100
            . " -o $os" 
123
            . " -o $os" 
101
            . ( $quiet ? ' -q' : '' ) 
124
            . ( $quiet ? ' -q' : '' ) 
102
            . ( $DEBUG ? ' --debug' : '')
125
            . ( $DEBUG ? ' --debug' : '')
103
            . ( $dryRun ? ' -n' : '')
126
            . ( $dryRun ? ' -n' : '')
104
            . ( $seedFileName ? " -s $seedFileName " : '' );
127
            . ( $seedFileName ? " -s $seedFileName " : '' );
105
&logIt( "Running command $command" );
128
&logIt( "Running command $command" );
106
system $command;
129
if ( doCommand( $command ) ) {
-
 
130
   die "I had an error executing $command\n";
-
 
131
}
107
&logIt( "\tReturn value is $returnValue" );
132
&logIt( "\tReturn value is $returnValue" );
108
 
133
 
109
# check permissions
134
# check permissions
110
$command = $scriptDir . '/permissions';
135
$command = $scriptDir . '/permissions';
111
&logIt( "Running command $command" );
136
&logIt( "Running command $command" );
112
system $command;
137
if ( doCommand( $command ) ) {
-
 
138
   die "I had an error executing $command\n";
-
 
139
}
113
 
140
 
114
# run configure
141
# run configure
115
$command = $scriptDir . "/../configure"
142
$command = $scriptDir . "/../configure"
116
            . ( $quiet ? ' -q' : '' ) 
143
            . ( $quiet ? ' -q' : '' ) 
117
            . ( $DEBUG ? ' --debug' : '')
144
            . ( $DEBUG ? ' --debug' : '')
118
            . ( $dryRun ? ' -n' : '' );
145
            . ( $dryRun ? ' -n' : '' );
119
&logIt( "Running command $command" );
146
&logIt( "Running command $command" );
120
system $command;
147
if ( doCommand( $command ) ) {
-
 
148
   die "I had an error executing $command\n";
-
 
149
}
121
&logIt( "\tReturn value is $returnValue" );
150
&logIt( "\tReturn value is $returnValue" );