[pacman-dev] make install fails to replace repo-add

Lukas Fleischer archlinux at cryptocrack.de
Tue Sep 13 08:13:56 EDT 2011


On Tue, Sep 13, 2011 at 07:48:18AM -0400, Dave Reisner wrote:
> On Tue, Sep 13, 2011 at 01:33:08PM +0200, Lukas Fleischer wrote:
> > On Tue, Sep 13, 2011 at 07:25:29AM -0400, Dave Reisner wrote:
> > > On Tue, Sep 13, 2011 at 07:00:27AM -0400, Dan McGee wrote:
> > > > On Tue, Sep 13, 2011 at 6:54 AM, Sergej Pupykin <ml at sergej.pp.ru> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I have got following from "make install DESTDIR=..."
> > > > >
> > > > > cd /home/sergej/extent/pacman.git/PKG/usr/bin && \
> > > > >        ( ln -s repo-add repo-elephant || \
> > > > >        ln repo-add repo-elephant || \
> > > > >        cp repo-add repo-elephant )
> > > > > ln: failed to create symbolic link `repo-elephant': File exists
> > > > > ln: failed to create hard link `repo-elephant': File exists
> > > > > cp: `repo-add' and `repo-elephant' are the same file
> > > > > make[4]: *** [install-data-hook] Error 1
> > > > > make[4]: Leaving directory `/home2/home/sergej/pacman.git/scripts'
> > > > > make[3]: *** [install-data-am] Error 2
> > > > > make[3]: Leaving directory `/home2/home/sergej/pacman.git/scripts'
> > > > > make[2]: *** [install-am] Error 2
> > > > > make[2]: Leaving directory `/home2/home/sergej/pacman.git/scripts'
> > > > > make[1]: *** [install-recursive] Error 1
> > > > > make[1]: Leaving directory `/home2/home/sergej/pacman.git/scripts'
> > > > > make: *** [install-recursive] Error 1
> > > > >
> > > > > Problem probably here:
> > > > >
> > > > > scripts/Makefile.am
> > > > >
> > > > > install-data-hook:
> > > > >        cd $(DESTDIR)$(bindir) && \
> > > > >                ( $(LN_S) repo-add repo-elephant || \
> > > > >                ln repo-add repo-elephant || \
> > > > >                cp repo-add repo-elephant )
> > > > >        cd $(DESTDIR)$(bindir) && \
> > > > >                ( $(LN_S) repo-add repo-remove || \
> > > > >                ln repo-add repo-remove || \
> > > > >                cp repo-add repo-remove )
> > > > 
> > > > This probably wasn't tested with existing files in the way since none
> > > > of us have done that. Dave, I think we just need to add a `rm -f
> > > > <foobar>` call in this command?
> > > > 
> > > > -Dan
> > > > 
> > > 
> > > Either that or add an -f flag to ln/cp. Not sure if that's portable.
> > 
> > I think we should go with rm(1) [1].
> > 
> > [1] http://mailman.archlinux.org/pipermail/pacman-dev/2011-June/013562.html
> > 
> 
> This means that we need to hope that the $(RM) macro does the right
> thing on systems where the -f flag doesn't exist for rm.

I actually just double-checked and I can't find any document pointing
out that `ln -f` isn't POSIX'ish [1], [2]. *BSD [3], [4] and BusyBox [5]
support it as well, so I'm not sure about the rationale behind [6].

[1] http://pubs.opengroup.org/onlinepubs/000095399/utilities/ln.html
[2] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ln.html
[3] http://www.openbsd.org/cgi-bin/man.cgi?query=ln
[4] http://www.freebsd.org/cgi/man.cgi?query=ln
[5] http://busybox.net/downloads/BusyBox.html#ln
[6] http://projects.archlinux.org/pacman.git/commit/?id=51ed7dff


More information about the pacman-dev mailing list