add configurable blacklist
This commit is contained in:
parent
4447630fb2
commit
90c0fc1348
3 changed files with 32 additions and 13 deletions
|
@ -17,7 +17,8 @@ shopt -s nullglob
|
|||
[[ -r @libdir@/util.sh ]] && source @libdir@/util.sh
|
||||
|
||||
display_settings(){
|
||||
msg "manjaro-tools version: ${version}"
|
||||
msg "manjaro-tools"
|
||||
msg2 "version: ${version}"
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "arch: ${arch}"
|
||||
|
@ -131,12 +132,8 @@ clean_up(){
|
|||
}
|
||||
|
||||
blacklist_pkg(){
|
||||
local blacklist=('libsystemd') \
|
||||
cmd=$(pacman -Q ${blacklist[@]} -r $1/root 2> /dev/null)
|
||||
|
||||
if [[ -n $cmd ]] ; then
|
||||
msg "Removing ${blacklist[@]}..."
|
||||
chroot-run $1/root pacman -Rdd "${blacklist[@]}" --noconfirm
|
||||
fi
|
||||
}
|
||||
|
||||
prepare_cachedir(){
|
||||
|
@ -159,9 +156,11 @@ chroot_build(){
|
|||
msg "Start building profile: [${profile}]"
|
||||
for pkg in $(cat ${profiledir}/${profile}.set); do
|
||||
cd $pkg
|
||||
if [[ $pkg == 'eudev' ]] || [[ $pkg == 'lib32-eudev' ]]; then
|
||||
for p in ${blacklist_trigger[@]}; do
|
||||
if [[ $pkg == $p ]]; then
|
||||
blacklist_pkg "${chrootdir}"
|
||||
fi
|
||||
done
|
||||
setarch "${arch}" \
|
||||
mkchrootpkg ${mkchrootpkg_args[*]} -- ${makepkg_args[*]} || break
|
||||
move_pkg
|
||||
|
@ -170,9 +169,11 @@ chroot_build(){
|
|||
msg "Finished building profile: [${profile}]"
|
||||
else
|
||||
cd ${profile}
|
||||
if [[ ${profile} == 'eudev' ]] || [[ ${profile} == 'lib32-eudev' ]]; then
|
||||
for p in ${blacklist_trigger[@]}; do
|
||||
if [[ ${profile} == $p ]]; then
|
||||
blacklist_pkg "${chrootdir}"
|
||||
fi
|
||||
done
|
||||
setarch "${arch}" \
|
||||
mkchrootpkg ${mkchrootpkg_args[*]} -- ${makepkg_args[*]} || abort
|
||||
move_pkg
|
||||
|
|
|
@ -14,3 +14,9 @@
|
|||
|
||||
# default set; name without .set extension
|
||||
# profile=default
|
||||
|
||||
# default packages to trigger blacklist
|
||||
# blacklist_trigger=('eudev' 'lib32-eudev' 'upower-pm-utils' 'eudev-systemdcompat' 'lib32-eudev-systemdcompat')
|
||||
|
||||
# default blacklisted packages to remove from chroot
|
||||
# blacklist=('libsystemd')
|
||||
|
|
12
lib/util.sh
12
lib/util.sh
|
@ -195,6 +195,18 @@ load_config(){
|
|||
else
|
||||
pkgdir='/var/cache/manjaro-tools'
|
||||
fi
|
||||
|
||||
if [[ -n ${blacklist_trigger[@]} ]];then
|
||||
blacklist_trigger=${blacklist_trigger[@]}
|
||||
else
|
||||
blacklist_trigger=('eudev' 'lib32-eudev' 'upower-pm-utils' 'eudev-systemdcompat' 'lib32-eudev-systemdcompat')
|
||||
fi
|
||||
|
||||
if [[ -n ${blacklist[@]} ]];then
|
||||
blacklist=${blacklist[@]}
|
||||
else
|
||||
blacklist=('libsystemd')
|
||||
fi
|
||||
}
|
||||
|
||||
load_sets(){
|
||||
|
|
Loading…
Reference in a new issue