From b4ac8de1cfa29f1882c6bfee4b0f2b394e31daf2 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 13 Nov 2011 13:43:50 +0100 Subject: add install_alternative_tree command for targetinstall Signed-off-by: Michael Olbrich --- rules/post/install.make | 24 ++++++++++++++++++++++++ scripts/lib/ptxd_make_xpkg_pkg.sh | 10 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/rules/post/install.make b/rules/post/install.make index 0fc4b3b3e..35b00349b 100644 --- a/rules/post/install.make +++ b/rules/post/install.make @@ -138,6 +138,30 @@ install_tree = \ $(call install_check, install_tree); \ echo "ptxd_install_tree '$$DIR' '$$DST' '$$OWN' '$$GRP' '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds" +# +# install_alternative_tree +# +# Installs all files and subdirectories with user/group ownership and +# permissions via fakeroot. +# +# +# $1: xpkg label +# $2: OWN, use '-' to use the real UID of each file/directory +# $3: GID, use '-' to use the real GID of each file/directory +# $4: the toplevel directory, searched for like install_alternative +# $5: strip +# $6: the target directory (optional) +# +install_alternative_tree = \ + XPKG=$(subst _,-,$(strip $(1))); \ + OWN=$(strip $(2)); \ + GRP=$(strip $(3)); \ + DIR=$(strip $(4)); \ + STRIP=$(strip $(5)); \ + DST=$(strip $(6)); \ + $(call install_check, install_alternative_tree); \ + echo "ptxd_install_alternative_tree '$$DIR' '$$DST' '$$OWN' '$$GRP' '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds" + # # install_archive # diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index 38225357e..89d631974 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -463,6 +463,16 @@ ptxd_install_tree() { } export -f ptxd_install_tree +ptxd_install_alternative_tree() { + local cmd="alternative" + local src="${1}" + local dst="${2}" + shift 2 + ptxd_install_find "${src}" "${dst:-${src}}" "$@" || + ptxd_install_error "install_alternative_tree failed!" +} +export -f ptxd_install_alternative_tree + ptxd_install_archive() { local archive="$1" shift -- cgit v1.2.3