forked from mirrored-repos/manjaro-tools
buildpkg: simplfy devel group loading
util-*-chroot: small fixes
This commit is contained in:
parent
711397a74c
commit
7aa3c071eb
3 changed files with 33 additions and 42 deletions
|
@ -53,7 +53,7 @@ display_settings(){
|
|||
msg2 "create_first: %s" "${create_first}"
|
||||
msg2 "clean_first: %s" "${clean_first}"
|
||||
msg2 "update_first: %s" "${update_first}"
|
||||
msg2 "wipe_clean: %s" "${wipe_clean}"
|
||||
msg2 "purge: %s" "${purge}"
|
||||
msg2 "namcap: %s" "${namcap}"
|
||||
msg2 "sign: %s" "${sign}"
|
||||
msg2 "udev_root: %s" "${udev_root}"
|
||||
|
@ -76,42 +76,40 @@ load_config "${MT_USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}
|
|||
load_vars "${PAC_USERCONFDIR}/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
||||
load_vars /etc/makepkg.conf
|
||||
|
||||
create_first=false
|
||||
clean_first=false
|
||||
update_first=false
|
||||
wipe_clean=false
|
||||
purge=false
|
||||
namcap=false
|
||||
pretend=false
|
||||
is_build_list=false
|
||||
sign=false
|
||||
udev_root=false
|
||||
is_multilib=false
|
||||
create_first=false
|
||||
|
||||
mkchroot_args=()
|
||||
mkchroot_args=(-L)
|
||||
mkchrootpkg_args=()
|
||||
|
||||
install_pkgs=()
|
||||
|
||||
# $1: target_arch
|
||||
prepare_build(){
|
||||
local arch="$1"
|
||||
if ! is_valid_arch_pkg "${arch}";then
|
||||
die "%s is not a valid arch!" "${arch}"
|
||||
if ! is_valid_arch_pkg "${target_arch}";then
|
||||
die "%s is not a valid arch!" "${target_arch}"
|
||||
fi
|
||||
|
||||
local pac_arch='default'
|
||||
|
||||
if [[ "${arch}" == 'multilib' ]];then
|
||||
if [[ "${target_arch}" == 'multilib' ]];then
|
||||
pac_arch='multilib'
|
||||
is_multilib=true
|
||||
fi
|
||||
|
||||
local pacman_conf="${DATADIR}/pacman-$pac_arch.conf"
|
||||
|
||||
work_dir="${chroots_pkg}/${target_branch}/${arch}"
|
||||
pkg_dir="${cache_dir_pkg}/${target_branch}/${arch}"
|
||||
work_dir="${chroots_pkg}/${target_branch}/${target_arch}"
|
||||
pkg_dir="${cache_dir_pkg}/${target_branch}/${target_arch}"
|
||||
|
||||
local makepkg_conf=$(get_makepkg_conf "${arch}")
|
||||
local makepkg_conf=$(get_makepkg_conf "${target_arch}")
|
||||
|
||||
[[ "$pac_arch" == 'multilib' ]] && target_arch='x86_64'
|
||||
|
||||
|
@ -125,6 +123,8 @@ prepare_build(){
|
|||
|
||||
eval_build_list "${list_dir_pkg}" "${build_list_pkg}"
|
||||
|
||||
init_base_devel
|
||||
|
||||
timer_start=$(get_timer)
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ shift $(($OPTIND - 1))
|
|||
|
||||
check_root
|
||||
|
||||
prepare_build "${target_arch}"
|
||||
prepare_build
|
||||
|
||||
${pretend} && display_settings && exit
|
||||
|
||||
|
|
|
@ -262,7 +262,6 @@ chroot_create(){
|
|||
|
||||
chroot_clean(){
|
||||
local dest="$1"
|
||||
# msg "Cleaning chroot for [%s] (%s)..." "${target_branch}" "${target_arch}"
|
||||
for root in "$dest"/*; do
|
||||
[[ -d ${root} ]] || continue
|
||||
local name=${root##*/}
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
# GNU General Public License for more details.
|
||||
|
||||
load_compiler_settings(){
|
||||
local tarch="$1" conf
|
||||
conf=${make_conf_dir}/$tarch.conf
|
||||
local arch="$1" conf
|
||||
conf=${make_conf_dir}/$arch.conf
|
||||
|
||||
[[ -f $conf ]] || return 1
|
||||
|
||||
info "Loading compiler settings: %s" "$tarch"
|
||||
info "Loading compiler settings: %s" "$arch"
|
||||
source $conf
|
||||
|
||||
return 0
|
||||
|
@ -51,11 +51,12 @@ find_pkg(){
|
|||
[[ -z $result ]] && die "%s is not a valid package or build list!" "${bdir}"
|
||||
}
|
||||
|
||||
base_devel_udev(){
|
||||
init_base_devel(){
|
||||
if ${udev_root};then
|
||||
local _multi _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g"
|
||||
local devel_group='' file=${DATADIR}/base-devel-udev
|
||||
local file=${DATADIR}/base-devel-udev
|
||||
|
||||
info "Loading custom group: %s" "$file"
|
||||
# info "Loading custom group: %s" "$file"
|
||||
|
||||
if ${is_multilib}; then
|
||||
_multi="s|>multilib||g"
|
||||
|
@ -63,17 +64,10 @@ base_devel_udev(){
|
|||
_multi="s|>multilib.*||g"
|
||||
fi
|
||||
|
||||
devel_group=$(sed "$_com_rm" "$file" \
|
||||
base_packages=($(sed "$_com_rm" "$file" \
|
||||
| sed "$_space" \
|
||||
| sed "$_multi" \
|
||||
| sed "$_clean")
|
||||
|
||||
echo ${devel_group}
|
||||
}
|
||||
|
||||
init_base_devel(){
|
||||
if ${udev_root};then
|
||||
base_packages=( "$(base_devel_udev)" )
|
||||
| sed "$_clean"))
|
||||
else
|
||||
if ${is_multilib};then
|
||||
base_packages=('base-devel' 'multilib-devel')
|
||||
|
@ -147,13 +141,11 @@ post_build(){
|
|||
chroot_init(){
|
||||
local timer=$(get_timer)
|
||||
local dest="$1"
|
||||
init_base_devel
|
||||
# msg "Initialize chroot for [%s] (%s)..." "${target_branch}" "${target_arch}"
|
||||
mkdir -p "${dest}"
|
||||
setarch "${target_arch}" \
|
||||
mkchroot "${mkchroot_args[@]}" \
|
||||
"${dest}/root" \
|
||||
${base_packages[*]} || abort
|
||||
"${base_packages[@]}" || abort
|
||||
|
||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||
}
|
||||
|
@ -161,7 +153,7 @@ chroot_init(){
|
|||
build_pkg(){
|
||||
prepare_dir "${pkg_dir}"
|
||||
user_own "${pkg_dir}"
|
||||
${wipe_clean} && clean_up
|
||||
${purge} && clean_up
|
||||
setarch "${target_arch}" \
|
||||
mkchrootpkg "${mkchrootpkg_args[@]}"
|
||||
post_build
|
||||
|
|
Loading…
Reference in a new issue