From 80721a16b28eb564e1371e452b947f2caa356dfb Mon Sep 17 00:00:00 2001 From: asmeron Date: Tue, 19 Nov 2024 18:21:39 +0600 Subject: [PATCH] Fix pacman functions --- ublinux/rc.local.d/40-pacman | 28 ++++++++++++++++++++++++++++ ublinux/rc.local.d/40-pacman-keyring | 21 --------------------- ublinux/rc.post.d/08-install-pkg | 26 -------------------------- 3 files changed, 28 insertions(+), 47 deletions(-) create mode 100755 ublinux/rc.local.d/40-pacman delete mode 100755 ublinux/rc.local.d/40-pacman-keyring delete mode 100755 ublinux/rc.post.d/08-install-pkg diff --git a/ublinux/rc.local.d/40-pacman b/ublinux/rc.local.d/40-pacman new file mode 100755 index 0000000..1d589a0 --- /dev/null +++ b/ublinux/rc.local.d/40-pacman @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +ENABLED=yes +[[ ${ENABLED} == "yes" ]] || exit 0 +DEBUGMODE=no + +debug_mode "$0" "$@" + +exec_01_init_pacman_gpg(){ + /usr/bin/pacman-key -l &>/dev/null 2>&1 || rm -rdf /etc/pacman.d/gnupg + pacman-key --init &>/dev/null + pacman-key --populate $(ls /usr/share/pacman/keyrings/*.gpg | sed 's%.*/%%;s%\.[^.]*$%%') &>/dev/null + #usr/bin/pacman-key --updatedb +} + +exec_02_install_pkg_tar(){ + find /memory/layer-base/*/install -maxdepth 1 -type f -name "*.pkg.tar.*" -exec pacman -U --noprogressbar --noconfirm {} + 2>/dev/null +} + +################ +##### MAIN ##### +################ + + # Если файл подключен как ресурс с функциями, то выйти + return 0 2>/dev/null && return 0 + + 01_init_pacman_gpg $@ & + 02_exec_install_pkg_tar $@ & diff --git a/ublinux/rc.local.d/40-pacman-keyring b/ublinux/rc.local.d/40-pacman-keyring deleted file mode 100755 index 647c874..0000000 --- a/ublinux/rc.local.d/40-pacman-keyring +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/bash - -ENABLED=yes -[[ ${ENABLED} == yes ]] || exit 0 - -DEBUGMODE=no -. /usr/lib/ublinux/functions -debug_mode "$0" "$@" - -init_pacman_gpg() { - pacman-key --init &>/dev/null - pacman-key --populate $(ls /usr/share/pacman/keyrings/*.gpg | sed 's%.*/%%;s%\.[^.]*$%%') &>/dev/null - #usr/bin/pacman-key --updatedb -} - - [[ -d /etc/pacman.d/gnupg ]] || init_pacman_gpg - if ! /usr/bin/pacman-key -l &>/dev/null 2>&1; then - rm -rdf /etc/pacman.d/gnupg - init_pacman_gpg - fi - diff --git a/ublinux/rc.post.d/08-install-pkg b/ublinux/rc.post.d/08-install-pkg deleted file mode 100755 index b60083c..0000000 --- a/ublinux/rc.post.d/08-install-pkg +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -ENABLED=yes -[[ ${ENABLED} == "yes" ]] || exit 0 -DEBUGMODE=no - -[[ -d /usr/lib/ublinux ]] && { ROOTFS= ; CMD_CHROOT= ; } || { [[ -d /sysroot ]] && ROOTFS="/sysroot" || ROOTFS="."; CMD_CHROOT="chroot ${ROOTFS}"; } -SOURCE=${ROOTFS}/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0 -SOURCE=${ROOTFS}/usr/lib/ublinux/default; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0 -debug_mode "$0" "$@" - -SYSCONF="${ROOTFS}${SYSCONF}" -SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null - -exec_install_pkg_tar(){ - find /memory/layer-base/*/install -maxdepth 1 -type f -name "*.pkg.tar.*" -exec pacman -U --noprogressbar --noconfirm {} + 2>/dev/null -} - -################ -##### MAIN ##### -################ - - # Если файл подключен как ресурс с функциями, то выйти - return 0 2>/dev/null && return 0 - - exec_install_pkg_tar $@