mirror of
https://github.com/termux/termux-packages.git
synced 2025-05-09 23:55:29 +00:00
For example: ```shell termux_step_create_debscripts() { termux_step_create_debscripts__copy_from_dir "$TERMUX_PKG_SRCDIR/build/output/packaging/debian" . } ```
33 lines
796 B
Bash
33 lines
796 B
Bash
termux_step_create_debscripts() {
|
|
return 0
|
|
}
|
|
|
|
termux_step_create_debscripts__copy_from_dir() {
|
|
|
|
local return_value
|
|
|
|
local src_dir="${1:-}"
|
|
local dest_dir="${2:-}"
|
|
|
|
if [[ ! -d "$src_dir" ]]; then
|
|
echo "Failed to find source directory '$src_dir' to copy debscripts from" 1>&2
|
|
return 1
|
|
fi
|
|
|
|
return_value=0
|
|
mkdir -p "$dest_dir" || return_value=$?
|
|
if [ $return_value -ne 0 ]; then
|
|
echo "Failed to create destination directory '$dest_dir' to copy debscripts to" 1>&2
|
|
return 1
|
|
fi
|
|
|
|
(
|
|
find "$src_dir" -mindepth 1 -maxdepth 1 -type f \
|
|
-regextype posix-extended -regex "^.*/(postinst|postrm|preinst|prerm|config|conffiles|templates|triggers|clilibs|fortran_mod|runit|shlibs|starlibs|symbols)$" \
|
|
-print0 | xargs -0 -n1 sh -c \
|
|
'cp -a "$0" '"'${dest_dir//\'/\'\\\'\'}/'"
|
|
|
|
)
|
|
|
|
}
|