代码拉取完成,页面将自动刷新
同步操作将从 Ethan Tang/WorkScripts 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/local/bin/perl
use strict;
use warnings;
use File::Copy;
use File::Path;
#This script is used to do leap frog on multiple files
#arguments: filelist.file comment
#Prepare dir for top files ( to leap back )
our $topFileDir = 'top_files';
mkdir $topFileDir unless ( -e $topFileDir );
system( 'chmod 777 -R '.$topFileDir );
our $mso_top = $ENV{'MSO_TOP'};
my $listFile = $ARGV[0];
our $prodDir = $ARGV[1];
my $comment = $ARGV[2];
$prodDir =~ /(mso|msc|msr).*/;
my $prod = $1;
open FILELIST, $listFile or die "Unable to open filelist $listFile :$!\n";
open VERSION, '>versions' or die "Unable to open versions for writing:$!\n";
print "File versions will be saved as versions\n";
while(<FILELIST>)
{
chomp;
if( /rev-up (.*)/ )
{
#justCheckin($1,'leapback');
leapFrog( $1, 'revup'.$comment );
}else{
#justCheckin($_,'leapback');
leapFrog($_,$comment );
}
}
close FILELIST;
close VERSION;
print "All jobs done!\n";
sub justCheckin
{
my $file = $_[0];
my $comment = $_[1];
print "Rev up $file\n";
my $status = system("arcs unlock $file");
$status = system("arcs lock $file");
$status = system("arcs in $file ".'\\'.$comment.'\\');
}
sub leapFrog
{
my $file = $_[0];
my $comment = $_[1];
my $status = 1;
print "Leap frog : $file comment=$comment ...";
copy( $prodDir.'/'.$file, './') or die "Unable to copy $file";
chdir $topFileDir;
$status = system( "arcs unlock $file" );
die" arcs unlock $file failure status:$status" if( $status<0 );
$status = system("arcs out $file ");
die "arcs out $file failure status:$status " if ( $status <0);
chdir '..';
$status = system("arcs in $file ".'\\'.$comment.'\\');
die "arcs in $file failure :$status" if ($status<0);
my $fileVersion = getFileVersion($mso_top.'/'.$file);
$file =~ /(.*)\/([^\/]+)$/;
my $srcDir = $1;
my $fileName = $2;
print VERSION "$prod $srcDir $fileName $fileVersion\n";
#Leap back
chdir $topFileDir;
$status = system("arcs lock $file");
die "arcs lock failure $status" if ($status <0);
Y
$status = system("arcs in $file ".'\\leapback\\' );
die "arcs in failure while rev up $status" if ($status < 0);
chdir '..';
print " [Done]\n";
}
sub getFileVersion
{
my $fileName = $_[0];
my $fileVersion;
unless ( open IDENT_PIPE, "-|" )
{
exec "ident $fileName";
exit;
}
while ( <IDENT_PIPE> )
{
chomp;
if( /\s([0-9.]+)\s/ )
{
$fileVersion = $1;
}
}
close IDENT_PIPE;
$fileVersion;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。