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?), so this part of the preinst doesn’t work:

        refinode=$(stat -c%i /usr/lib/git-core/git)
        for f in /usr/lib/git-core/*; do
                test "$f" != /usr/lib/git-core/git || continue
                rm -f "$f.tmp"
                inode=$(stat -c%i "$f")
                test "$inode" = "$refinode" || continue
                ln -s git "$f.tmp"
                mv -f "$f.tmp" "$f"
        done

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*

Anders



--
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