deployiso: make the project configurable

This commit is contained in:
udeved 2017-02-12 21:10:24 +01:00
parent 9b96382c59
commit b350b29b31
4 changed files with 36 additions and 31 deletions

View file

@ -76,6 +76,9 @@
# the server user
# account=[SetUser]
# the server project
# project="manjarolinux"
# set upload bandwidth limit in kB/s
# limit=100

View file

@ -513,10 +513,6 @@ make_profile(){
${verbose} && archive_logs
exit 1
fi
# if ${boot_only}; then
# prepare_boot_loaders
# exit 1
# fi
if ${images_only}; then
prepare_images
${verbose} && archive_logs
@ -562,7 +558,7 @@ load_profile(){
mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K)
work_dir=${chroots_iso}/${profile}/${target_arch}
iso_dir="${cache_dir_iso}/${edition}/${dist_release}/${profile}"
iso_dir="${cache_dir_iso}/${edition}/${profile}/${dist_release}"
iso_root=${chroots_iso}/${profile}/iso
mnt_dir=${chroots_iso}/${profile}/mnt

View file

@ -29,44 +29,48 @@ connect(){
echo "${account},$1@frs.${host}:${home}/$1"
}
get_project(){
local project
case "$1" in
'community') project='manjarolinux-community' ;;
'manjaro') project='manjarolinux' ;;
'sonar') project='sonargnulinux' ;;
esac
echo ${project}
}
# get_project(){
# local project
# case "$1" in
# 'community') project='manjarolinux-community' ;;
# 'manjaro') project='manjarolinux' ;;
# 'sonar') project='sonargnulinux' ;;
# # manjarotest
# # manjarotest-community
# esac
# echo ${project}
# }
gen_webseed(){
local webseed url project=$(get_project "${edition}")
url=${host}/project/${project}/${dist_release}/${profile}/${iso_file}
local mirrors=('heanet' 'jaist' 'netcologne' 'iweb' 'kent')
local webseed seed="$1"
local mirrors=('heanet' 'jaist' 'netcologne' 'iweb' 'kent')
for m in ${mirrors[@]};do
webseed=${webseed:-}${webseed:+,}"http://${m}.dl.${url}"
webseed=${webseed:-}${webseed:+,}"http://${m}.dl.${seed}"
done
echo ${webseed}
}
make_torrent(){
local fn=${iso_file}.torrent
msg2 "Creating (%s) ..." "${fn}"
[[ -f ${iso_dir}/${fn} ]] && rm ${iso_dir}/${fn}
mktorrent ${mktorrent_args[*]} -o ${iso_dir}/${fn} ${iso_dir}/${iso_file}
for iso in $(ls {src_dir}/${1}/*.iso);do
local iso_dir="${cache_dir_iso}/${edition}/${1}/${dist_release}"
local seed=${host}/project/${project}/${1}/${dist_release}/${iso}
local mktorrent_args=(-v -p -l ${piece_size} -a ${tracker_url} -w $(gen_webseed ${seed}))
local fn=${iso}.torrent
msg2 "Creating (%s) ..." "${fn}"
[[ -f ${iso_dir}/${fn} ]] && rm ${iso_dir}/${fn}
mktorrent ${mktorrent_args[*]} -o ${iso_dir}/${fn} ${iso_dir}/${iso}
done
}
prepare_transfer(){
local edition=$(get_edition $1)
project=$(get_project "${edition}")
edition=$(get_edition $1)
# project=$(get_project "${edition}")
url=$(connect "${project}")
mktorrent_args=(-v -p -l ${piece_size} -a ${tracker_url} -w $(gen_webseed))
target_dir="${dist_release}/$1"
target_dir="$1/${dist_release}"
src_dir="${run_dir}/${edition}/${target_dir}"
${torrent} && make_torrent
${torrent} && make_torrent "$1"
}
sync_dir(){

View file

@ -218,8 +218,6 @@ init_common(){
[[ -z ${build_mirror} ]] && build_mirror='http://mirror.netzspielplatz.de/manjaro/packages'
[[ -z ${tmp_dir} ]] && tmp_dir='/tmp/manjaro-tools'
[[ -z ${host} ]] && host="sourceforge.net"
}
init_buildtree(){
@ -304,6 +302,10 @@ init_buildiso(){
init_deployiso(){
host="sourceforge.net"
[[ -z ${project} ]] && project="manjarolinux"
[[ -z ${account} ]] && account="[SetUser]"
[[ -z ${limit} ]] && limit=100