forked from mirrored-repos/manjaro-tools
parent
32d6269158
commit
ccaf01d6fc
7 changed files with 20 additions and 169 deletions
|
@ -1,94 +0,0 @@
|
|||
_mkchrootpkg() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-I -c -h -l -r -u' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
true
|
||||
} &&
|
||||
complete -F _mkchrootpkg mkchrootpkg
|
||||
|
||||
_mkchroot() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-C -M -S -c -L -B -h' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
true
|
||||
} &&
|
||||
complete -F _mkchroot mkchroot
|
||||
|
||||
_chroot_run() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-C -M -S -c -B -h' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
true
|
||||
} &&
|
||||
complete -F _chroot_run chroot-run
|
||||
|
||||
_buildpkg() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-a -b -p -c -r -w -s -q -h' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
true
|
||||
} &&
|
||||
complete -F _buildpkg buildpkg
|
||||
|
||||
_buildiso() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-a -b -p -c -r -i -s -x -l -q -h' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
true
|
||||
} &&
|
||||
complete -F _buildiso buildiso
|
|
@ -58,6 +58,8 @@ display_settings(){
|
|||
msg2 "work_dir: %s" "${work_dir}"
|
||||
msg2 "pkg_dir: %s" "${pkg_dir}"
|
||||
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
|
||||
msg2 "pacman_conf: %s" "${pacman_conf}"
|
||||
msg2 "makepkg_conf: %s" "${makepkg_conf}"
|
||||
|
||||
if ${clean_first};then
|
||||
msg "PKG:"
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
#compdef build-set chroot-run finddeps mkchrootpkg mkchroot
|
||||
|
||||
m4_include(lib/valid-tags.sh)
|
||||
|
||||
_build_set_args=(
|
||||
'-c[Recreate chroot]'
|
||||
'-r[Chroots directory]:base_dir:_files -/'
|
||||
'-b[Set branch]:branch:_branch -/'
|
||||
'-a[Set arch]:arch:_arch -/'
|
||||
'-p[Set profile or pkg]:base_dir:_files -/'
|
||||
'-w[Clean up]'
|
||||
'-s[Sign packages]'
|
||||
)
|
||||
|
||||
_chroot_run_args=(
|
||||
'-C[Location of a pacman config file]:pacman_config:_files'
|
||||
'-M[Location of a makepkg config file]:makepkg_config:_files'
|
||||
'-S[Location of a pacman-mirrors config file]:pacman_mirrors_config:_files'
|
||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||
'-h[Display usage]'
|
||||
)
|
||||
|
||||
_finddeps_args=(
|
||||
'1:packages:_devtools_completions_all_packages'
|
||||
)
|
||||
|
||||
_mkchrootpkg_args=(
|
||||
'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
|
||||
'-c[Clean the chroot before building]'
|
||||
'-h[Display usage]'
|
||||
'-l[The directory to use as the working copy]:copy_dir:_files -/'
|
||||
'-r[The chroot dir to use]:chroot_dir:_files -/'
|
||||
'-u[Update the working copy of the chroot before building]'
|
||||
)
|
||||
|
||||
_mkchroot_args=(
|
||||
'-C[Location of a pacman config file]:pacman_config:_files'
|
||||
'-M[Location of a makepkg config file]:makepkg_config:_files'
|
||||
'-S[Location of a pacman-mirrors config file]:pacman_mirrors_config:_files'
|
||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||
'-h[Display usage]'
|
||||
)
|
||||
|
||||
_manjaro_tools_completions_all_packages() {
|
||||
typeset -U packages
|
||||
packages=($(_call_program packages pacman -Sql))
|
||||
compadd - "${(@)packages}"
|
||||
}
|
||||
|
||||
_manjaro_tools() {
|
||||
local argname="_${service//-/_}_args[@]"
|
||||
_arguments -s "${(P)argname}"
|
||||
}
|
||||
|
||||
_manjaro_tools
|
|
@ -76,7 +76,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-a i686|x86_64|multilib</option></term>
|
||||
<term><option>-a i686|x86_64|multilib|arm|armv6h|armv7h|aarch64</option></term>
|
||||
|
||||
<listitem><para>Architecture that the iso will be built. Can be i686, x86_64 or multilib.</para></listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -27,19 +27,26 @@ preconf_arm(){
|
|||
}
|
||||
|
||||
preconf(){
|
||||
work_dir="${chroots_pkg}/${target_branch}/$1"
|
||||
pkg_dir="${cache_dir_pkg}/${target_branch}/$1"
|
||||
if [[ "$1" == 'multilib' ]];then
|
||||
local arch="$1" tarch="$2"
|
||||
work_dir="${chroots_pkg}/${target_branch}/$tarch"
|
||||
pkg_dir="${cache_dir_pkg}/${target_branch}/$tarch"
|
||||
if [[ "$arch" == 'multilib' ]];then
|
||||
target_arch='x86_64'
|
||||
is_multilib=true
|
||||
else
|
||||
is_multilib=false
|
||||
fi
|
||||
makepkg_conf="${DATADIR}/makepkg-${target_arch}.conf"
|
||||
pacman_conf="${DATADIR}/pacman-$1.conf"
|
||||
pacman_conf="${DATADIR}/pacman-$arch.conf"
|
||||
}
|
||||
|
||||
configure_chroot_arch(){
|
||||
if ! is_valid_arch_pkg "$1";then
|
||||
die "%s is not a valid arch!" "$1"
|
||||
fi
|
||||
if ! is_valid_branch "$1";then
|
||||
die "%s is not a valid branch!" "${target_branch}"
|
||||
fi
|
||||
local conf_arch chost_desc cflags
|
||||
case "$1" in
|
||||
'arm')
|
||||
|
@ -317,15 +324,17 @@ chroot_init(){
|
|||
|
||||
build_pkg(){
|
||||
setarch "${target_arch}" \
|
||||
mkchrootpkg ${mkchrootpkg_args[*]}
|
||||
mkchrootpkg ${mkchrootpkg_args[*]} || return 1
|
||||
if [ $? -eq 0 ]; then
|
||||
post_build
|
||||
fi
|
||||
}
|
||||
|
||||
make_pkg(){
|
||||
check_build "$1"
|
||||
msg "Start building [%s]" "$1"
|
||||
cd $1
|
||||
build_pkg || die
|
||||
post_build
|
||||
build_pkg
|
||||
cd ..
|
||||
msg "Finished building [%s]" "$1"
|
||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||
|
|
|
@ -536,7 +536,7 @@ is_valid_init(){
|
|||
|
||||
is_valid_arch_pkg(){
|
||||
case $1 in
|
||||
'i686'|'x86_64'|'multilib') return 0 ;;
|
||||
'i686'|'x86_64'|'multilib'|'arm'|'armv6h'|'armv7h'|'aarch64') return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
_arch=(
|
||||
i686
|
||||
x86_64
|
||||
any
|
||||
)
|
||||
|
||||
_branch=(
|
||||
stable
|
||||
testing
|
||||
unstable
|
||||
)
|
Loading…
Reference in a new issue