chiark / gitweb /
mm it works on liberator now
[ian-dotfiles.git] / process
diff --git a/process b/process
index 513091890610b533e03631bee6c7198d31da57a1..1d8e39d025aa6512d8d8e307f0dd946b3d7de471 100755 (executable)
--- a/process
+++ b/process
@@ -32,7 +32,7 @@ sub read_prep ($) {
     if (!$c) { exec './gpt','config',$inputfile; die $!; }
 }
 sub fin_prep () {
-    $!=0; close P; die "$! $?" if $! or $?;
+    close P; die "$?" if $?;
 }
 
 read_prep('perms');
@@ -43,6 +43,8 @@ for (;;) {
     last if m/^\.$/;
     if (m/(.*\S)\s+\-\>\s+(\S.*)/) {
        $linktargs{$1}= $2;
+    } elsif (m/^(.*\S)\s+\-\-$/) {
+       $exclude{$1}= 1;
     } elsif (m/^(.*\S)\s+(\S+)$/) {
        ($of,$pe)=($1,$2);
        $isdir= $of =~ s,/$,,;
@@ -112,6 +114,7 @@ sub prep_proc ($$) {
 opendir D, "files" or die $!;
 while ($if=readdir D) {
     next unless $if =~ m/^[_a-z0-9\\]/;
+    next if $if =~ m/\~$/;
     $of= $if; 
     $of =~ s,_,/,g; 
     $of =~ s,^/,,;
@@ -120,6 +123,8 @@ while ($if=readdir D) {
        length $1 eq 1 ? $1 : sprintf '%c', hex $1 
            /ge;
 
+    next if $exclude{$of};
+
     mkparents($of);
     $newf= 'new/'.$if;
     prep_proc('files/'.$if,$newf);
@@ -158,11 +163,12 @@ foreach $link (keys %linktargs) {
        defined($rl= readlink $home.$link) or die $!;
     } else {
        die unless $!==&ENOENT;
-       $rl= '';
+       $rl= undef;
     }
     if ($rl ne $targ) {
        would($link, "symlink $targ <-");
        if ($action) {
+           unlink $home.$link if defined $rl;
            symlink $targ,$home.$link or die $!;
        }
     }