summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-11-17 17:36:10 +0100
committerDave Reisner <dreisner@archlinux.org>2011-11-29 11:56:42 +0100
commit082e8bbacedd7d9be7162b5ab1779eff172e2530 (patch)
tree502d69d88c88d958f373a17986b4c0a3fcc5d86c
parentd9a4d1b6c501c2bc6c9a2bc57dc1d3fcfaddc1ff (diff)
downloadmkinitcpio-082e8bbacedd7d9be7162b5ab1779eff172e2530.tar.gz
mkinitcpio-082e8bbacedd7d9be7162b5ab1779eff172e2530.tar.xz
add_{file,symlink}: overwrite existing file
Now we fail silently if the file exists, which means there is no easy way to overwrite binaries. I think it makes the most sense to do the following: 1) add all the busybox stuff as a basic system; 2) overwrite some of the links with any binaries we add to base hook; 3) allow users to write their own hooks to overwrite even more stuff. This can now be done by this hook. v2: make sure we are able to overwrite a symlink pointing to a directory Signed-off-by: Tom Gundersen <teg@jklm.no>
-rw-r--r--functions4
1 files changed, 1 insertions, 3 deletions
diff --git a/functions b/functions
index ef4463e..401fa5c 100644
--- a/functions
+++ b/functions
@@ -82,7 +82,6 @@ _add_file() {
# $3: mode
(( $# == 3 )) || return $EINVAL
- [[ -e "$BUILDROOT$1" ]] && return $EEXIST
(( QUIET )) || plain "adding file: %s" "$1"
command install -Dm$3 "$2" "$BUILDROOT$1"
@@ -106,10 +105,9 @@ _add_symlink() {
# $2: target of $1
(( $# == 2 )) || return $EINVAL
- [[ -L "$BUILDROOT$1" ]] && return $EEXIST
(( QUIET )) || plain "adding symlink: %s -> %s" "$1" "$2"
- ln -s "$2" "$BUILDROOT$1"
+ ln -sfn "$2" "$BUILDROOT$1"
}
auto_modules() {