Skip to content

Commit b04e225

Browse files
committed
Merge branch 'ignorepkg' into pipewire
2 parents 2aafe1e + 17603fa commit b04e225

4 files changed

Lines changed: 40 additions & 28 deletions

File tree

build.sh

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module_dir="${script_path}/modules"
2222
customized_username=false
2323
customized_password=false
2424
customized_kernel=false
25+
pkglist_args=""
2526
DEFAULT_ARGUMENT=""
2627
alteriso_version="3.1"
2728

@@ -514,15 +515,21 @@ prepare_build() {
514515
msg_error "${channel_name} channel does not support current architecture (${arch})." "1"
515516
fi
516517

518+
# Set argument of pkglist.sh
519+
pkglist_args=("-a" "${arch}" "-k" "${kernel}" "-c" "${channel_dir}" "-l" "${locale_name}")
520+
if [[ "${boot_splash}" = true ]]; then pkglist_args+=("-b"); fi
521+
if [[ "${debug}" = true ]]; then pkglist_args+=("-d"); fi
522+
if [[ "${memtest86}" = true ]]; then pkglist_args+=("-m"); fi
523+
if (( "${#additional_exclude_pkg[@]}" >= 1 )); then pkglist_args+=("-e" "${additional_exclude_pkg[*]}"); fi
524+
pkglist_args+=("${modules[*]}")
525+
517526
# Unmount
518527
umount_chroot
519528
}
520529

521530

522531
# Setup custom pacman.conf with current cache directories.
523532
make_pacman_conf() {
524-
msg_debug "Use ${build_pacman_conf}"
525-
526533
# Pacman configuration file used only when building
527534
# If there is pacman.conf for each channel, use that for building
528535
if [[ -f "${channel_dir}/pacman-${arch}.conf" ]]; then
@@ -531,6 +538,8 @@ make_pacman_conf() {
531538
build_pacman_conf="${script_path}/system/pacman-${arch}.conf"
532539
fi
533540

541+
msg_debug "Use ${build_pacman_conf}"
542+
534543
if [[ "${nosigcheck}" = true ]]; then
535544
sed -r "s|^#?\\s*SigLevel.+|SigLevel = Never|g" ${build_pacman_conf} > "${work_dir}/pacman-${arch}.conf"
536545
else
@@ -553,15 +562,7 @@ make_basefs() {
553562

554563
# Additional packages (airootfs)
555564
make_packages_repo() {
556-
local _pkg _pkglist_args="-a ${arch} -k ${kernel} -c ${channel_dir} -l ${locale_name}"
557-
558-
# get pkglist
559-
if [[ "${boot_splash}" = true ]]; then _pkglist_args+=" -b"; fi
560-
if [[ "${debug}" = true ]]; then _pkglist_args+=" -d"; fi
561-
if [[ "${memtest86}" = true ]]; then _pkglist_args+=" -m"; fi
562-
_pkglist_args+=" ${modules[*]}"
563-
564-
local _pkglist=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
565+
local _pkglist=($("${tools_dir}/pkglist.sh" "${pkglist_args[@]}"))
565566

566567
# Create a list of packages to be finally installed as packages.list directly under the working directory.
567568
echo -e "# The list of packages that is installed in live cd.\n#\n\n" > "${work_dir}/packages.list"
@@ -572,20 +573,10 @@ make_packages_repo() {
572573
}
573574

574575
make_packages_aur() {
575-
local _pkg _pkglist_args="--aur -a ${arch} -k ${kernel} -c ${channel_dir} -l ${locale_name}"
576-
577-
# get pkglist
578-
# get pkglist
579-
if [[ "${boot_splash}" = true ]]; then _pkglist_args+=" -b"; fi
580-
if [[ "${debug}" = true ]]; then _pkglist_args+=" -d"; fi
581-
if [[ "${memtest86}" = true ]]; then _pkglist_args+=" -m"; fi
582-
_pkglist_args+=" ${modules[*]}"
583-
584-
local _pkglist_aur=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
576+
local _pkglist_aur=($("${tools_dir}/pkglist.sh" --aur "${pkglist_args[@]}"))
585577

586578
# Create a list of packages to be finally installed as packages.list directly under the working directory.
587579
echo -e "\n\n# AUR packages.\n#\n\n" >> "${work_dir}/packages.list"
588-
#for _pkg in ${_pkglist_aur[@]}; do echo ${_pkg} >> "${work_dir}/packages.list"; done
589580
printf "%s\n" "${_pkglist_aur[@]}" >> "${work_dir}/packages.list"
590581

591582
# prepare for yay

default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ msgdebug=false
267267
# $ git rev-parse --short HEAD
268268
gitversion=false
269269

270+
# Additional list of packages to exclude from channel
271+
# Works the same as an exclude file
272+
# Use this array for debugging only
273+
# This setting cannot be changed by an argument.
274+
additional_exclude_pkg=(
275+
276+
)
277+
270278

271279
# List of packages required for build
272280
# The following packages are checked to see if they are installed before running build.sh

system/aur.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ls "/usr/share/pacman/keyrings/"*".gpg" | sed "s|.gpg||g" | xargs | pacman-key -
6262

6363
# Build and install
6464
chmod +s /usr/bin/sudo
65-
for _pkg in "pamac-aur" "${@}"; do
65+
for _pkg in "${@}"; do
6666
yes | sudo -u aurbuild \
6767
yay -Sy \
6868
--mflags "-AcC" \

tools/pkglist.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ line=false
1313
debug=false
1414
memtest86=false
1515

16+
additional_exclude_pkg=()
17+
1618
arch=""
1719
channel_dir=""
1820
kernel=""
@@ -29,6 +31,7 @@ _help() {
2931
echo " -b | --boot-splash Enable boot splash"
3032
echo " -c | --channel [dir] Specify the channel directory"
3133
echo " -d | --debug Enable debug message"
34+
echo " -e | --exclude [pkgs] List of packages to be additionally excluded"
3235
echo " -k | --kernel [kernel] Specify the kernel"
3336
echo " -l | --locale [locale] Specify the locale"
3437
echo " -m | --memtest86 Enable memtest86 package"
@@ -70,15 +73,15 @@ msg_debug() {
7073

7174

7275
# Parse options
73-
ARGUMENT="${@}"
74-
OPTS="a:bc:dk:l:mh"
75-
OPTL="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
76-
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
76+
ARGUMENT=("${@}")
77+
OPTS="a:bc:de:k:l:mh"
78+
OPTL="arch:,boot-splash,channel:,debug,exclude:,kernel:,locale:,memtest86,aur,help,line"
79+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- "${ARGUMENT[@]}"); then
7780
exit 1
7881
fi
7982

8083
eval set -- "${OPT}"
81-
unset OPT OPTS OPTL
84+
unset OPT OPTS OPTL ARGUMENT
8285

8386
while true; do
8487
case "${1}" in
@@ -98,6 +101,10 @@ while true; do
98101
debug=true
99102
shift 1
100103
;;
104+
-e | --exclude)
105+
additional_exclude_pkg=(${2})
106+
shift 2
107+
;;
101108
-k | --kernel)
102109
kernel="${2}"
103110
shift 2
@@ -206,6 +213,12 @@ for _file in ${_excludefile[@]}; do
206213
fi
207214
done
208215

216+
#-- additional_exclude_pkg のパッケージを_excludelistに追加 --#
217+
if (( "${#additional_exclude_pkg[@]}" >= 1 )); then
218+
_excludelist+=(${additional_exclude_pkg[@]})
219+
msg_debug "Additional excluded packages: ${additional_exclude_pkg[*]}"
220+
fi
221+
209222
#-- excludeに記述されたパッケージを除外 --#
210223
# _pkglistを_subpkglistにコピーしexcludeのパッケージを除外し再代入
211224
_subpkglist=(${_pkglist[@]})

0 commit comments

Comments
 (0)