handle another permission case

This commit is contained in:
Ward Wouts 2004-01-25 20:12:09 +00:00
parent 5751c98e69
commit d1674bc27a

View file

@ -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;