Skip to content

Commit fae7623

Browse files
committed
[update] : Install packages from AUR that do not exist in the official repository
1 parent d8c069d commit fae7623

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

build.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ modules=()
2929
DEFAULT_ARGUMENT=""
3030
ARGUMENT=("${@}")
3131
alteriso_version="3.1"
32+
norepopkg=()
3233

3334
# Load config file
3435
[[ ! -f "${defaultconfig}" ]] && "${tools_dir}/msg.sh" -a 'build.sh' error "${defaultconfig} was not found." && exit 1
@@ -554,18 +555,30 @@ make_packages_repo() {
554555
msg_debug "pkglist.sh ${pkglist_args[*]}"
555556
readarray -t _pkglist < <("${tools_dir}/pkglist.sh" "${pkglist_args[@]}")
556557

558+
local _pkg
559+
for _pkg in "${_pkglist[@]}"; do
560+
msg_info "Checking ${_pkg}..."
561+
if pacman -Ssq "${_pkg}" 2> /dev/null 1> /dev/null; then
562+
_pkglist_install+=("${_pkg}")
563+
else
564+
msg_info "${_pkg} was not found. Install it with yay from AUR"
565+
norepopkg+=("${_pkg}")
566+
fi
567+
done
568+
557569
# Create a list of packages to be finally installed as packages.list directly under the working directory.
558570
echo -e "# The list of packages that is installed in live cd.\n#\n" > "${build_dir}/packages.list"
559-
printf "%s\n" "${_pkglist[@]}" >> "${build_dir}/packages.list"
571+
printf "%s\n" "${_pkglist_install[@]}" >> "${build_dir}/packages.list"
560572

561573
# Install packages on airootfs
562-
_pacstrap "${_pkglist[@]}"
574+
_pacstrap "${_pkglist_install[@]}"
563575

564576
return 0
565577
}
566578

567579
make_packages_aur() {
568580
readarray -t _pkglist_aur < <("${tools_dir}/pkglist.sh" --aur "${pkglist_args[@]}")
581+
_pkglist_aur=("${_pkglist_aur[@]}" "${norepopkg[@]}")
569582

570583
# Create a list of packages to be finally installed as packages.list directly under the working directory.
571584
echo -e "\n# AUR packages.\n#\n" >> "${build_dir}/packages.list"

0 commit comments

Comments
 (0)