diff --git a/README.md b/README.md index efedf25..2a0c2a3 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ overriding ################ deployiso ################ # the server user -# remote_user=[SetUser] +# account=[SetUser] # set upload bandwidth limit in kB/s # limit=100 diff --git a/bin/deployiso.in b/bin/deployiso.in index 04302c4..a968cff 100644 --- a/bin/deployiso.in +++ b/bin/deployiso.in @@ -22,9 +22,9 @@ import ${LIBDIR}/util-publish.sh show_profile(){ prepare_transfer "$1" info "Profile: [$1]" - msg2 "remote_project: %s" "${remote_project}" + msg2 "project: %s" "${project}" msg2 "src_dir: ${src_dir}" - msg2 "remote_dir: ${remote_dir}" + msg2 "target_dir: ${target_dir}" } display_settings(){ @@ -39,6 +39,7 @@ display_settings(){ msg "OPTIONS:" msg2 "limit: %s kB/s" "${limit}" + msg2 "dist_release: %s" "${dist_release}" msg "ARGS:" msg2 "update: %s" "${update}" @@ -46,11 +47,9 @@ display_settings(){ msg2 "verbose: %s" "${verbose}" msg2 "rsync_args: %s" "${rsync_args[*]}" - msg "HOST:" - msg2 "dist_release: %s" "${dist_release}" - msg "REMOTE:" - msg2 "remote_user: %s" "${remote_user}" + msg2 "account: %s" "${account}" + msg2 "host: %s" "${host}" msg "UPLOAD QUEUE:" run show_profile "${build_list_iso}" diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index 9093344..2454a5c 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -81,7 +81,7 @@ ################ deployiso ################ # the server user -# remote_user=[SetUser] +# account=[SetUser] # set upload bandwidth limit in kB/s # limit=100 diff --git a/data/profile.conf.example b/data/profile.conf.example index fd36527..5f77434 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -21,6 +21,8 @@ # use pxe # pxe_boot="true" +################ torrent ################ + # the torrent tracker urls, comma separated # tracker_url='udp://mirror.strits.dk:6969' diff --git a/docbook/manjaro-tools.conf.xml b/docbook/manjaro-tools.conf.xml index f8389c9..0d70fe0 100644 --- a/docbook/manjaro-tools.conf.xml +++ b/docbook/manjaro-tools.conf.xml @@ -120,17 +120,10 @@ @@ -298,7 +291,7 @@ - remote_user= + account= Default user to be used for upload. diff --git a/lib/util-iso.sh b/lib/util-iso.sh index e5a3742..4091992 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -646,6 +646,33 @@ prepare_images(){ find ${log_dir} -maxdepth 1 -name "$name*.log" -delete } +reset_profile(){ + unset displaymanager + unset autologin + unset multilib + unset pxe_boot + unset plymouth_boot + unset nonfree_xorg + unset efi_boot_loader + unset efi_part_size + unset hostname + unset username + unset plymouth_theme + unset password + unset addgroups + unset start_systemd + unset disable_systemd + unset start_openrc + unset disable_openrc + unset start_systemd_live + unset start_openrc_live + unset packages_custom + unset packages_mhwd + unset login_shell + unset tracker_url + unset piece_size +} + make_profile(){ msg "Start building [%s]" "${profile}" ${clean_first} && chroot_clean "${work_dir}" @@ -686,7 +713,7 @@ get_pacman_conf(){ gen_webseed(){ local mirrors=('lweb' 'jaist' 'vorboss' 'netcologne') webseed url - url=${remote_url}/projects/${remote_project}/files/${dist_release}/${profile}/${iso_file} + url=${host}/projects/${project}/files/${dist_release}/${profile}/${iso_file} for m in ${mirrors[@]};do webseed=${webseed:-}${webseed:+,}"http://${m}.${url}" done @@ -716,7 +743,7 @@ load_profile(){ mktorrent_args=(-v -p -l ${piece_size} -a ${tracker_url}) - set_remote_project "${edition}" + project=$(get_project "${edition}") if [[ "${edition}" == 'official' ]];then mktorrent_args+=(-w $(gen_webseed)) diff --git a/lib/util-publish.sh b/lib/util-publish.sh index c98cd4f..46f5773 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -11,7 +11,7 @@ create_release(){ msg "Create release (%s) ..." "${dist_release}" - rsync ${rsync_args[*]} /dev/null ${sf_url}/${dist_release}/ + rsync ${rsync_args[*]} /dev/null ${url}/${dist_release}/ show_elapsed_time "${FUNCNAME}" "${timer_start}" msg "Done (%s)" "${dist_release}" } @@ -24,12 +24,17 @@ get_edition(){ echo ${path##*/} } +connect(){ + local home="/home/frs/project" + echo "${account},$1@frs.${host}:${home}/$1" +} + prepare_transfer(){ - local edition=$(get_edition $1) - set_remote_project "${edition}" - sf_url=${remote_user},${remote_project}@frs.${remote_url}:${remote_target}/${remote_project} - remote_dir="${dist_release}/$1" - src_dir="${run_dir}/${edition}/${remote_dir}" + local edition=$(get_edition $1) project + project=$(get_project "${edition}") + url=$(connect "${project}") + target_dir="${dist_release}/$1" + src_dir="${run_dir}/${edition}/${target_dir}" } sync_dir(){ @@ -39,7 +44,7 @@ sync_dir(){ exists=true fi msg "Start upload [%s] ..." "$1" - rsync ${rsync_args[*]} ${src_dir}/ ${sf_url}/${remote_dir}/ + rsync ${rsync_args[*]} ${src_dir}/ ${url}/${target_dir}/ msg "Done upload [%s]" "$1" show_elapsed_time "${FUNCNAME}" "${timer_start}" } diff --git a/lib/util.sh b/lib/util.sh index 9d79692..f452443 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -141,14 +141,15 @@ show_elapsed_time(){ info "Time %s: %s minutes" "$1" "$(elapsed_time $2)" } -set_remote_project(){ -# case "$1" in -# 'community') remote_project='manjarolinux-community' ;; -# 'minimal') remote_project='manjarolinux-minimal' ;; -# 'official') remote_project='manjarolinux' ;; -# 'sonar') remote_project='sonargnulinux' ;; -# esac - remote_project='manjaro-testing' +get_project(){ + local project + case "$1" in + 'community'|'minimal') project='manjarolinux-community' ;; + 'official') project='manjarolinux' ;; + 'sonar') project='sonargnulinux' ;; + esac + project='manjaro-testing' + echo ${project} } lock() { @@ -237,9 +238,7 @@ init_common(){ [[ -z ${tmp_dir} ]] && tmp_dir='/tmp/manjaro-tools' - [[ -z ${remote_url} ]] && remote_url="sourceforge.net" - - [[ -z ${remote_target} ]] && remote_target="/home/frs/project" + [[ -z ${host} ]] && host="sourceforge.net" } init_buildtree(){ @@ -326,7 +325,7 @@ init_buildiso(){ init_deployiso(){ - [[ -z ${remote_user} ]] && remote_user="[SetUser]" + [[ -z ${account} ]] && account="[SetUser]" [[ -z ${limit} ]] && limit=100 } @@ -352,33 +351,6 @@ load_config(){ return 0 } -reset_profile(){ - unset displaymanager - unset autologin - unset multilib - unset pxe_boot - unset plymouth_boot - unset nonfree_xorg - unset efi_boot_loader - unset efi_part_size - unset hostname - unset username - unset plymouth_theme - unset password - unset addgroups - unset start_systemd - unset disable_systemd - unset start_openrc - unset disable_openrc - unset start_systemd_live - unset start_openrc_live - unset packages_custom - unset packages_mhwd - unset login_shell - unset tracker_url - unset piece_size -} - is_valid_bool(){ case $1 in 'true'|'false') return 0 ;;