summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-10-11 00:19:41 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-10-11 00:58:26 +0100
commit0f37a4cac41ca7dc266b9e9af877f0d6a6e49b01 (patch)
tree3292eba545165977a3bbbb6ffd69d76081d6b857
parent32c22f0a584874d61ff1697cd63b2f8eba8b75ab (diff)
dgit: Handle EXDEV when saving origs
Replace two link calls with rename_link_xf, and change the subsequent error handling to use $@ iff appropriate. Part of the fix to #910730. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit12
1 files changed, 6 insertions, 6 deletions
diff --git a/dgit b/dgit
index d443c34..6b961f5 100755
--- a/dgit
+++ b/dgit
@@ -2224,18 +2224,18 @@ sub generate_commits_from_dsc () {
printdebug "considering saving $f: ";
- if (link $f, $upper_f) {
+ if (rename_link_xf 1, $f, $upper_f) {
printdebug "linked.\n";
- } elsif ((printdebug "($!) "),
+ } elsif ((printdebug "($@) "),
$! != EEXIST) {
- fail f_ "saving %s: %s", "$buildproductsdir/$f", $!;
+ fail f_ "saving %s: %s", "$buildproductsdir/$f", $@;
} elsif (!$refetched) {
printdebug "no need.\n";
- } elsif (link $f, "$upper_f,fetch") {
+ } elsif (rename_link_xf 1, $f, "$upper_f,fetch") {
printdebug "linked (using ...,fetch).\n";
- } elsif ((printdebug "($!) "),
+ } elsif ((printdebug "($@) "),
$! != EEXIST) {
- fail f_ "saving %s: %s", "$buildproductsdir/$f,fetch", $!;
+ fail f_ "saving %s: %s", "$buildproductsdir/$f,fetch", $@;
} else {
printdebug "cannot.\n";
}