notfound 654596 git/1:1.7.2.5-3
found 654596 git/1.7.8~rc3-1
found 654596 git/1.7.8.2-1
quit

Anders Kaseorg wrote:
> On Wed, 4 Jan 2012, Jon Dowland wrote:

>>>  mv: `/usr/lib/git-core/git-add.tmp' and `/usr/lib/git-core/git-add' are 
>>> the same file
>
> This was also reported by a user of the Ubuntu PPA: 
> https://bugs.launchpad.net/911906
>
> It seems mv -f refuses to replace a file with a symlink to the same inode 
> (WTF?)

Wow.  Not sure why this didn't show up before.

[...]
> This isn’t a limitation of the rename() syscall, so one silly fix that 
> preserves atomicity would be to invoke rename() from another language:
>
> -             mv -f "$f.tmp" "$f"
> +             perl -e 'rename($ARGV[0], $ARGV[1])' -- "$f.tmp" "$f"
>
> *whine*

Here's another silly fix.

 debian/git.preinst |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/debian/git.preinst b/debian/git.preinst
index c32fdbfe..33556ac8 100644
--- a/debian/git.preinst
+++ b/debian/git.preinst
@@ -45,9 +45,21 @@ rm_conffile /etc/emacs/site-start.d/50git-core.el "$1" "$2"
 
 if test "$1" = upgrade &&
    dpkg --compare-versions "$2" lt-nl '1:1.7.7-2'; then
-       refinode=$(stat -c%i /usr/lib/git-core/git)
+       refinode=$(stat -c%i /usr/lib/git-core/git-add)
+
+       # <http://debbugs.gnu.org/6960>: coreutils mv refuses to
+       # replace a file by a symlink to the same inode.
+       # Fine, let's give /usr/lib/git-core/git its own inode.
+       inode=$(stat -c%i /usr/lib/git-core/git)
+       if test "$inode" = "$refinode"; then
+               rm -f /usr/lib/git-core/git.tmp
+               cp -p /usr/lib/git-core/git /usr/lib/git-core/git.tmp
+               mv -f /usr/lib/git-core/git.tmp /usr/lib/git-core/git
+       fi
+
        for f in /usr/lib/git-core/*; do
-               test "$f" != /usr/lib/git-core/git || continue
+               test "$f" != /usr/lib/git-core/git &&
+               test "$f" != /usr/lib/git-core/git-add || continue
                rm -f "$f.tmp"
                inode=$(stat -c%i "$f")
                test "$inode" = "$refinode" || continue
-- 
1.7.8.2




--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to