chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Dgit.pm: rename_link_xf: Always use cp
[dgit.git]
/
Debian
/
Dgit.pm
diff --git
a/Debian/Dgit.pm
b/Debian/Dgit.pm
index 08a5b6c29a9ae21fc414d49f0eb18b02ae40931f..19ea85b6ebe887c36ead2c44a6d409a17e5bfee6 100644
(file)
--- a/
Debian/Dgit.pm
+++ b/
Debian/Dgit.pm
@@
-445,8
+445,7
@@
sub rename_link_xf ($$$) {
return 0;
}
$!=0; $?=0;
return 0;
}
$!=0; $?=0;
- my @cmd = ($keeporig ? qw(cp) : qw(mv));
- push @cmd, (qw(--), $src, "$dst.tmp");
+ my @cmd = (qw(cp --), $src, "$dst.tmp");
debugcmd '+',@cmd;
if (system @cmd) {
failedcmd_report_cmd undef, @cmd;
debugcmd '+',@cmd;
if (system @cmd) {
failedcmd_report_cmd undef, @cmd;
@@
-454,12
+453,17
@@
sub rename_link_xf ($$$) {
$! = -1;
return 0;
}
$! = -1;
return 0;
}
- if (rename "$dst.tmp", $dst) {
- return 1;
- } else {
- $@ = f_ "finally install file after mv: %S", $!;
+ if (!rename "$dst.tmp", $dst) {
+ $@ = f_ "finally install file after cp: %S", $!;
return 0;
}
return 0;
}
+ if (!$keeporig) {
+ if (!unlink $src) {
+ $@ = f_ "delete old file after cp: %S", $!;
+ return 0;
+ }
+ }
+ return 1;
}
sub hashfile ($) {
}
sub hashfile ($) {