handle another permission case
This commit is contained in:
parent
5751c98e69
commit
d1674bc27a
1 changed files with 8 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ use vars qw(
|
|||
$cvspath
|
||||
$editor
|
||||
$catcmd
|
||||
$chowncmd
|
||||
$cpcmd
|
||||
$cvscmd
|
||||
$mkdircmd
|
||||
|
|
@ -43,6 +44,7 @@ $hostname = hostname();
|
|||
#my $cvspath = "$ENV{HOME}/worktrees/systems/$hostname";
|
||||
$editor = "vi";
|
||||
$catcmd = "/bin/cat";
|
||||
$chowncmd = "/sbin/chown";
|
||||
$cpcmd = "/bin/cp";
|
||||
$cvscmd = "/usr/bin/cvs";
|
||||
$mkdircmd = "/bin/mkdir";
|
||||
|
|
@ -292,7 +294,12 @@ sub copytocvs($) {
|
|||
my $file = shift;
|
||||
my $cwd = cwd;
|
||||
my $path = "$cvspath/" . &fullpath($file);
|
||||
copy($file, $path);
|
||||
if ( -r $file ) {
|
||||
copy($file, $path) or die "Couldn't copy file: $!";
|
||||
} else {
|
||||
system("$sudocmd $cpcmd $file $path");
|
||||
system("$sudocmd $chowncmd $<:" . (split(' ', $())[0] . " $path/" . basename($file));
|
||||
}
|
||||
chdir($path);
|
||||
system("$cvscmd ci " . &escape(basename($file)));
|
||||
chdir $cwd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue