Changeset 48 for devel/dploy-common
- Timestamp:
- 04/16/08 15:57:46 (4 years ago)
- File:
-
- 1 edited
-
devel/dploy-common/lib/Dploy/Base.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devel/dploy-common/lib/Dploy/Base.pm
r46 r48 58 58 my $cmt=shift || $cmd; 59 59 60 pb_log(0,"$cmt... ");60 dploy_log(0,"$cmt... "); 61 61 #system("$cmd 2>&1 > $ENV{'PBTMP'}/system.log"); 62 62 system($cmd); 63 pb_log(1,"Executing $cmd\n");63 dploy_log(1,"Executing $cmd\n"); 64 64 my $res = $?; 65 65 if ($res == -1) { 66 pb_log(0,"failed to execute ($cmd) : $!\n");67 pb_display_file("$ENV{'PBTMP'}/system.log");66 dploy_log(0,"failed to execute ($cmd) : $!\n"); 67 dploy_display_file("$ENV{'PBTMP'}/system.log"); 68 68 } elsif ($res & 127) { 69 pb_log(0, "child ($cmd) died with signal ".($? & 127).", ".($? & 128) ? 'with' : 'without'." coredump\n");70 pb_display_file("$ENV{'PBTMP'}/system.log");69 dploy_log(0, "child ($cmd) died with signal ".($? & 127).", ".($? & 128) ? 'with' : 'without'." coredump\n"); 70 dploy_display_file("$ENV{'PBTMP'}/system.log"); 71 71 } elsif ($res == 0) { 72 pb_log(0,"OK\n");72 dploy_log(0,"OK\n"); 73 73 } else { 74 pb_log(0, "child ($cmd) exited with value ".($? >> 8)."\n");75 pb_display_file("$ENV{'PBTMP'}/system.log");74 dploy_log(0, "child ($cmd) exited with value ".($? >> 8)."\n"); 75 dploy_display_file("$ENV{'PBTMP'}/system.log"); 76 76 } 77 77 return($res); … … 96 96 97 97 my @param = @_; 98 my @return = pb_conf_get_if(@param);98 my @return = dploy_conf_get_if(@param); 99 99 100 100 die "No params found for $ENV{'PBPROJ'}" if (not @return); … … 116 116 my @ptr1 = (); 117 117 my @ptr2 = (); 118 @ptr1 = pb_conf_read_if("$ENV{'PBETC'}", @param) if (defined $ENV{'PBETC'});119 @ptr2 = pb_conf_read_if("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb", @param) if ((defined $ENV{'PBROOTDIR'}) and (defined $ENV{'PBPROJ'}));118 @ptr1 = dploy_conf_read_if("$ENV{'PBETC'}", @param) if (defined $ENV{'PBETC'}); 119 @ptr2 = dploy_conf_read_if("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb", @param) if ((defined $ENV{'PBROOTDIR'}) and (defined $ENV{'PBPROJ'})); 120 120 121 121 my $p1; 122 122 my $p2; 123 123 124 pb_log(2,"DEBUG: pb_conf_get param1: ".Dumper(@ptr1)."\n");125 pb_log(2,"DEBUG: pb_conf_get param2: ".Dumper(@ptr2)."\n");124 dploy_log(2,"DEBUG: dploy_conf_get param1: ".Dumper(@ptr1)."\n"); 125 dploy_log(2,"DEBUG: dploy_conf_get param2: ".Dumper(@ptr2)."\n"); 126 126 127 127 foreach my $i (0..$#param) { … … 163 163 $ptr1[$i] = $p1; 164 164 } 165 pb_log(2,"DEBUG: pb_conf_get param ptr1: ".Dumper(@ptr1)."\n");165 dploy_log(2,"DEBUG: dploy_conf_get param ptr1: ".Dumper(@ptr1)."\n"); 166 166 return(@ptr1); 167 167 } … … 177 177 open(CONF,$conffile) || return((undef)); 178 178 close(CONF); 179 return( pb_conf_read($conffile,@param));179 return(dploy_conf_read($conffile,@param)); 180 180 } 181 181 … … 193 193 while(<CONF>) { 194 194 if (/^\s*([A-z0-9-_]+)\s+([[A-z0-9-_]+)\s*=\s*(.+)$/) { 195 pb_log(3,"DEBUG: 1:$1 2:$2 3:$3\n");195 dploy_log(3,"DEBUG: 1:$1 2:$2 3:$3\n"); 196 196 $h{$1}{$2}=$3; 197 197 } … … 210 210 my $uri = shift || undef; 211 211 212 pb_log(2,"DEBUG: uri:$uri\n");212 dploy_log(2,"DEBUG: uri:$uri\n"); 213 213 # A URL has the format protocol://[ac@]host[:port][path[?query][#fragment]]. 214 214 # Cf man URI … … 224 224 $port = "" if (not defined $port); 225 225 226 pb_log(2,"DEBUG: scheme:$scheme ac:$account host:$host port:$port path:$path\n");226 dploy_log(2,"DEBUG: scheme:$scheme ac:$account host:$host port:$port path:$path\n"); 227 227 return($scheme, $account, $host, $port, $path); 228 228 }
Note: See TracChangeset
for help on using the changeset viewer.
