Fix pacman functions

master
Dmitry Razumov 1 year ago
parent e8f9d35afa
commit 80721a16b2
Signed by: asmeron
GPG Key ID: 50BC1DB583B79706

@ -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 $@ &

@ -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

@ -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 $@
Loading…
Cancel
Save