do
sz=80x55
y=$[35*$x+100+$pixels_y]
- xb=$[(($pixels_x-503)*(3-$x))/2]
+ xb=$(( (($pixels_x-503)*(3-$x))/2 ))
xterm-CT "chiark ssh #$x" -geometry $sz+$xb+$y \
-e ssh chiark.greenend.org.uk -l ijackson &
echo -n :
- xterm-CT "chiark ssh ian #$x" -geometry $sz+$[$pixels_x+$xb]+$y \
+ xterm-CT "chiark ssh ian #$x" -geometry $sz+$(( $pixels_x+$xb ))+$y \
-e ssh chiark.greenend.org.uk -l ian &
echo -n :
done
chomp; s/^\s+//; s/\s+$//;
next if m/^\#/; next unless m/\S/;
last if m/^\.$/;
- m/^(.*\S)\s+([0-7]+)$/ or die;
- ($of,$pe)=($1,oct $2);
- $isdir= $of =~ s,/$,,;
- ($isdir ? $dirperms{$of} : $fileperms{$of}) = $pe;
+ if (m/(.*\S)\s+\-\>\s+(\S.*)/) {
+ $linktargs{$1}= $2;
+ } elsif (m/^(.*\S)\s+(\S+)$/) {
+ ($of,$pe)=($1,$2);
+ $isdir= $of =~ s,/$,,;
+ if ($pe =~ m/^[0-7]+$/) {
+ $pe= oct $&;
+ } elsif ($pe eq '+x') {
+ $pe= 0777&~$umask;
+ } elsif ($pe eq '/') {
+ $pe= 02777&~$umask;
+ } else {
+ die "$pe ?";
+ }
+ ($isdir ? $dirperms{$of} : $fileperms{$of}) = $pe;
+ }
}
fin_prep();
if ($nowperms != $perms) {
would($of, sprintf 'chmod %04o -> %04o', $nowperms, $perms);
}
- if (!$action) {
- system 'diff','-u',$home.$of,$newf;
- $?==0 or $?==256 or die $?;
- $changes++ if $?;
- }
+ system 'diff','-u',$home.$of,$newf;
+ $?==0 or $?==256 or die $?;
+ $changes++ if $?;
} else {
+ die unless $!==&ENOENT;
would($of, sprintf 'create %04o', $perms);
}
if ($action) {
die join(', ', keys %fileperms) if %fileperms;
+foreach $link (keys %linktargs) {
+ mkparents($link);
+ $targ= $linktargs{$link};
+ if (lstat $home.$link) {
+ -l _ or die "$link is not a link!";
+ defined($rl= readlink $home.$link) or die $!;
+ } else {
+ die unless $!==&ENOENT;
+ $rl= '';
+ }
+ if ($rl ne $targ) {
+ would($link, "symlink $targ <-");
+ if ($action) {
+ symlink $targ,$home.$link or die $!;
+ }
+ }
+}
+
foreach $dir (keys %dirperms) {
ensuredir($dir);
}