[pacman-dev] [PATCH 1/2] buildsys: remove existing symlinks before installing

Dave Reisner d at falconindy.com
Wed Sep 14 14:03:03 EDT 2011


This fixes build errors when performing a manual install straight to a
filesystem where the files already exist.

Reported-by: Sergej Pupykin <ml at sergej.pp.ru>
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
We probably could also just add in the -f flag to the ln/cp calls, but I feel
safer doing it this way. $(RM) will unconditionally expand to 'rm -f'.

 doc/Makefile.am     |    1 +
 scripts/Makefile.am |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index a9aa78f..aa27b50 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -153,6 +153,7 @@ repo-remove.8: repo-add.8
 
 install-data-hook:
 	cd $(DESTDIR)$(mandir)/man8 && \
+		$(RM) repo-remove.8 && \
 		( $(LN_S) repo-add.8 repo-remove.8 || \
 		ln repo-add.8 repo-remove.8 || \
 		cp repo-add.8 repo-remove.8 )
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 52a784a..d89fd30 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -106,10 +106,12 @@ repo-elephant: $(srcdir)/repo-add.sh.in
 
 install-data-hook:
 	cd $(DESTDIR)$(bindir) && \
+		$(RM) repo-elephant && \
 		( $(LN_S) repo-add repo-elephant || \
 		ln repo-add repo-elephant || \
 		cp repo-add repo-elephant )
 	cd $(DESTDIR)$(bindir) && \
+		$(RM) repo-remove && \
 		( $(LN_S) repo-add repo-remove || \
 		ln repo-add repo-remove || \
 		cp repo-add repo-remove )
-- 
1.7.6.1



More information about the pacman-dev mailing list