diff options
-rw-r--r-- | rules/post/install.make | 24 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 10 |
2 files changed, 34 insertions, 0 deletions
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 @@ -139,6 +139,30 @@ 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 # # Installs all files and directories in an archive with user/group ownership and 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 |