update patch

This commit is contained in:
Tobias Powalowski 2022-12-04 09:05:22 +01:00
parent 823ff2405b
commit 0d55c8c013
2 changed files with 4 additions and 11 deletions

View file

@ -22,7 +22,7 @@ build ()
xfs_scrub xfs_scrub_all xfs_spaceman compile_et mk_cmds fsck.xfs xfs_admin xfs_bmap xfs_freeze \
xfs_info xfs_metadump xfs_mkfile xfs_ncheck gpart
map add_file "/etc/nilfs_cleanerd.conf" "/etc/nvme/discovery.conf"
map add_full_dir "/etc/cifs-utils" "etc/request-key.d"
map add_full_dir "/etc/cifs-utils" "/etc/request-key.d"
# fix licenses
add_file "/usr/share/licenses/e2fsprogs/MIT-LICENSE"
}

View file

@ -633,7 +633,7 @@ add_file() {
(( $# )) || return 1
# determine source and destination
local src=$1 dest=${2:-$1} mode=$3 srcrealpath
local src="$1" dest="${2:-$1}" mode="$3" srcrealpath
if [[ ! -f $src ]]; then
error "file not found: \`%s'" "$src"
@ -650,19 +650,12 @@ add_file() {
# add the file
srcrealpath="$(realpath -- "$src")"
add_file "$srcrealpath" "$srcrealpath" "$mode"
[[ -d "${BUILDROOT}${dest%/*}" ]] || add_dir "${dest%/*}"
# create the symlink
add_symlink "$dest" "$src"
else
add_dir "${dest%/*}"
if [[ -z "$mode" ]]; then
# check if destination is same
if [[ "$src" == "$dest" ]]; then
command cp --preserve=mode,ownership --parents "$src" "$BUILDROOT"
else
# cp cannot handle mkdir :(
[[ -d "${BUILDROOT}${dest%/*}" ]] || add_dir "${dest%/*}"
command cp --preserve=mode,ownership "$src" "${BUILDROOT}${dest}"
fi
command cp --preserve=mode,ownership "$src" "${BUILDROOT}${dest}"
else
command install -Dm"$mode" "$src" "${BUILDROOT}${dest}"
fi