chiark / gitweb /
Merge tag dgit/2.14 into `defence in dgit-repos-server' branch
[dgit.git] / Debian / Dgit.pm
index 1bac97bde55d02a5cc00e0ba388348f7f8537012..e9921d6a33435c5c34164eca3f2dc2174bf1e4ef 100644 (file)
@@ -54,7 +54,7 @@ BEGIN {
                       $debugprefix *debuglevel *DEBUG
                       shellquote printcmd messagequote);
     # implicitly uses $main::us
-    %EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO)] );
+    %EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO NOCOMMITCHECK)] );
     @EXPORT_OK   = @{ $EXPORT_TAGS{policyflags} };
 }
 
@@ -71,6 +71,7 @@ our $branchprefix = 'dgit';
 # dynamic loader, runtime, etc., failures, which report 127 or 255
 sub NOFFCHECK () { return 0x2; }
 sub FRESHREPO () { return 0x4; }
+sub NOCOMMITCHECK () { return 0x8; }
 
 our $debugprefix;
 our $debuglevel = 0;
@@ -289,7 +290,9 @@ sub link_ltarget ($$) {
     if (-l _) {
        $old = cmdoutput qw(realpath  --), $old;
     }
-    link $old, $new or die "link $old $new: $!";
+    my $r = link $old, $new;
+    $r = symlink $old, $new if !$r && $!==EXDEV;
+    $r or die "(sym)link $old $new: $!";
 }
 
 sub hashfile ($) {