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
|
$cvspath
|
||||||
$editor
|
$editor
|
||||||
$catcmd
|
$catcmd
|
||||||
|
$chowncmd
|
||||||
$cpcmd
|
$cpcmd
|
||||||
$cvscmd
|
$cvscmd
|
||||||
$mkdircmd
|
$mkdircmd
|
||||||
|
|
@ -43,6 +44,7 @@ $hostname = hostname();
|
||||||
#my $cvspath = "$ENV{HOME}/worktrees/systems/$hostname";
|
#my $cvspath = "$ENV{HOME}/worktrees/systems/$hostname";
|
||||||
$editor = "vi";
|
$editor = "vi";
|
||||||
$catcmd = "/bin/cat";
|
$catcmd = "/bin/cat";
|
||||||
|
$chowncmd = "/sbin/chown";
|
||||||
$cpcmd = "/bin/cp";
|
$cpcmd = "/bin/cp";
|
||||||
$cvscmd = "/usr/bin/cvs";
|
$cvscmd = "/usr/bin/cvs";
|
||||||
$mkdircmd = "/bin/mkdir";
|
$mkdircmd = "/bin/mkdir";
|
||||||
|
|
@ -292,7 +294,12 @@ sub copytocvs($) {
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
my $cwd = cwd;
|
my $cwd = cwd;
|
||||||
my $path = "$cvspath/" . &fullpath($file);
|
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);
|
chdir($path);
|
||||||
system("$cvscmd ci " . &escape(basename($file)));
|
system("$cvscmd ci " . &escape(basename($file)));
|
||||||
chdir $cwd;
|
chdir $cwd;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue