new: add dirct-install

This commit is contained in:
2025-12-21 15:38:12 -05:00
parent 8a88a892c2
commit bd21ccaf48

20
leaf
View File

@@ -45,7 +45,7 @@ main() {
else else
local _item local _item
case $1 in case $1 in
prepare|build|install|force-install|remove|pack) prepare|build|install|force-install|remove|pack|dirct-install)
leaf_check_permission leaf_check_permission
for _item in "${@:2}"; do for _item in "${@:2}"; do
leaf_find_pkgbuild "${_item}" leaf_find_pkgbuild "${_item}"
@@ -54,7 +54,9 @@ main() {
leaf_parse_options leaf_parse_options
srcdir="${BUILD_DIR}/${PKG_PREFIX}/${PKG_NAME}" srcdir="${BUILD_DIR}/${PKG_PREFIX}/${PKG_NAME}"
pkgdir="${srcdir}"/__pkgdir__ pkgdir="${srcdir}"/__pkgdir__
if [[ x"$1" != x"dirct-install" ]]; then
rm -rf "${srcdir}" && install -dm755 "${srcdir}" && cd "${srcdir}" rm -rf "${srcdir}" && install -dm755 "${srcdir}" && cd "${srcdir}"
fi
leaf_${1}_package leaf_${1}_package
done done
;; ;;
@@ -264,6 +266,7 @@ Option: prepare prepare packages but do not build
build build packages but do not install build build packages but do not install
install install packages install install packages
forece-install install packages even if test faild forece-install install packages even if test faild
dirct-install install packages directly from previous build
remove remove packages remove remove packages
clean clean all source folders clean clean all source folders
list list installed packages list list installed packages
@@ -453,6 +456,21 @@ leaf_install_package() {
echo -e "${GREEN_COLOR}* Package ${PKG_PREFIX}/${PKG_NAME} has been installed${CLEAR_COLOR}\n" echo -e "${GREEN_COLOR}* Package ${PKG_PREFIX}/${PKG_NAME} has been installed${CLEAR_COLOR}\n"
} }
leaf_dirct-install_package() {
# install need to be in fakeroot
#leaf_build_package
# trace need to to in the same fakeroot
leaf_trace_package "${pkgdir}"
# ROOT starts
src_preinstall
leaf_merge_package "${pkgdir}"
src_postinstall
leaf_update_package_database add "${PKG_PREFIX}/${PKG_NAME}"
leaf_update_environment
# ROOT ends
echo -e "${GREEN_COLOR}* Package ${PKG_PREFIX}/${PKG_NAME} has been installed${CLEAR_COLOR}\n"
}
leaf_force-install_package(){ leaf_force-install_package(){
FORCE_INSTALL=1 FORCE_INSTALL=1
leaf_install_package leaf_install_package