From 25b3bc1d6199868030da97ac9857daffbb634738 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Sun, 1 Mar 2020 11:50:56 +0100 Subject: [PATCH 1/4] Adding `office_installer` to profile.conf - default to `false` Added `-o` to buildiso to activate office_installer per build Modified `util-yaml.sh` to handle setting Modified `util.sh` to handle the setting --- bin/buildiso.in | 8 ++++++-- data/profile.conf.example | 3 +++ lib/util-yaml.sh | 14 +++++++------- lib/util.sh | 11 +++++++++++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 471e16a..24427aa 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -29,6 +29,7 @@ show_profile(){ [[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}" msg2 "extra: %s" "${extra}" + msg2 "office_installer: %s" "${office_installer}" msg2 "permalink: %s" "${permalink}" msg2 "netinstall: %s" "${netinstall}" @@ -63,7 +64,7 @@ display_settings(){ show_config msg "PROFILE:" - msg2 "gitlab brach: %s" "${branch}" + msg2 "gitlab branch: %s" "${branch}" msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})" msg2 "build_list_iso: %s" "${build_list_iso}" msg2 "is_build_list: %s" "${is_build_list}" @@ -81,6 +82,7 @@ display_settings(){ msg2 "persist: %s" "${persist}" msg2 "extra: %s" "${full_iso}" msg2 "permalink: %s" "${permalink}" + msg2 "office_installer: %s" "${office_installer}" msg "DIST SETTINGS:" msg2 "dist_name: %s" "${dist_name}" @@ -128,6 +130,7 @@ usage() { echo ' -l Create permalink' echo ' -m Set SquashFS image mode to persistence' echo " -p Buildset or profile [default: ${build_list_iso}]" + echo ' -o Enable office installer module' echo ' -q Query settings and pretend build' echo ' -r Chroots directory' echo " [default: ${chroots_iso}]" @@ -145,7 +148,7 @@ usage() { orig_argv=("$@") -opts='p:a:b:r:t:k:g:d:cfzxmvqhil' +opts='p:a:b:r:t:k:g:d:cfzxmvqhilon' while getopts "${opts}" arg; do case "${arg}" in @@ -166,6 +169,7 @@ while getopts "${opts}" arg; do x) images_only=true ;; z) iso_only=true ;; l) permalink=true ;; + n) office_installer=false ;; h|?) usage 0 ;; *) echo "invalid argument '${arg}'"; usage 1 ;; esac diff --git a/data/profile.conf.example b/data/profile.conf.example index fb34109..83904e9 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -8,6 +8,9 @@ # use extra packages as defined in pkglist to activate a full profile # extra="false" +# use office installer module +# office_installer="false" + ################ install ################ # default displaymanager: none diff --git a/lib/util-yaml.sh b/lib/util-yaml.sh index f4e6c81..a53c6ff 100644 --- a/lib/util-yaml.sh +++ b/lib/util-yaml.sh @@ -294,15 +294,15 @@ write_settings_conf(){ else echo " - users" >> "$conf" && write_users_conf fi + # WIP - OfficeChooser - if ${extra}; then - if ${oem_used}; then - msg2 "Skipping enabling PackageChooser module." - else - msg2 "Enabling PackageChooser module." - echo " - packagechooser" >> "$conf" - fi + if ${oem_used} || ! ${office_installer}; then + msg2 "Skipping enabling PackageChooser module." + else + msg2 "Enabling PackageChooser module." + echo " - packagechooser" >> "$conf" fi + if ${netinstall}; then echo " - netinstall" >> "$conf" && write_netinstall_conf fi diff --git a/lib/util.sh b/lib/util.sh index d9e69af..a964454 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -460,6 +460,8 @@ load_profile_config(){ basic='true' [[ ${extra} == 'true' ]] && basic='false' + [[ -z ${office_installer} ]] && office_installer="false" + return 0 } @@ -622,6 +624,13 @@ load_pkgs(){ ;; esac + local _office _office_rm + if ${office_chooser}; then + _office="s|>office||g" + else + _office_rm="s|>office.*||g" + fi + local _blacklist="s|>blacklist.*||g" \ _kernel="s|KERNEL|$kernel|g" \ _used_kernel=${kernel:5:2} \ @@ -649,6 +658,8 @@ load_pkgs(){ | sed "$_basic_rm" \ | sed "$_extra" \ | sed "$_extra_rm" \ + | sed "$_office" \ + | sed "$_office_rm" \ | sed "$_clean") if [[ $1 == "${packages_mhwd}" ]]; then From 76d6d697e12fe6cdfec073fa9460a194c5a3de89 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Sun, 1 Mar 2020 12:11:44 +0100 Subject: [PATCH 2/4] reset variables rename to office_installer updated pacman-mirrors.conf --- README.md | 1 + data/pacman-mirrors.conf | 4 ++++ lib/util.sh | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ef8a61..b24176f 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,7 @@ Usage: buildiso [options] [default: linux49] -l Create permalink -m Set SquashFS image mode to persistence + -o Enable office installer -p Buildset or profile [default: default] -q Query settings and pretend build -r Chroots directory diff --git a/data/pacman-mirrors.conf b/data/pacman-mirrors.conf index 7141548..566e409 100644 --- a/data/pacman-mirrors.conf +++ b/data/pacman-mirrors.conf @@ -10,6 +10,10 @@ Branch = stable ## 2) random - randomly generate the output mirrorlist # Method = rank +## Filename to use when ranking mirrors +## The file must be present in core repo +# TestFile = core.db.tar.gz + ## Define protocols and priority ## separated by comma 'https,http' or 'http,https' ## ATM available protocols are: http, https, ftp diff --git a/lib/util.sh b/lib/util.sh index a964454..73d40fe 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -462,6 +462,8 @@ load_profile_config(){ [[ -z ${office_installer} ]] && office_installer="false" + [[ -z ${permalink} ]] && permalink="false" + return 0 } @@ -508,6 +510,8 @@ reset_profile(){ unset geoip unset extra unset full_iso + unset office_installer + unset permalink } check_profile(){ @@ -625,7 +629,7 @@ load_pkgs(){ esac local _office _office_rm - if ${office_chooser}; then + if ${office_installer}; then _office="s|>office||g" else _office_rm="s|>office.*||g" From f4dd5b3bd0b021aacb1a3b83e8caba4477270d58 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Sun, 1 Mar 2020 12:29:59 +0100 Subject: [PATCH 3/4] forgot to remove --- bin/buildiso.in | 4 ++-- lib/util.sh | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 24427aa..186ee13 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -148,7 +148,7 @@ usage() { orig_argv=("$@") -opts='p:a:b:r:t:k:g:d:cfzxmvqhilon' +opts='p:a:b:r:t:k:g:d:cfzxmvqhilo' while getopts "${opts}" arg; do case "${arg}" in @@ -169,7 +169,7 @@ while getopts "${opts}" arg; do x) images_only=true ;; z) iso_only=true ;; l) permalink=true ;; - n) office_installer=false ;; + o) office_installer=true ;; h|?) usage 0 ;; *) echo "invalid argument '${arg}'"; usage 1 ;; esac diff --git a/lib/util.sh b/lib/util.sh index 73d40fe..ca5619d 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -462,8 +462,6 @@ load_profile_config(){ [[ -z ${office_installer} ]] && office_installer="false" - [[ -z ${permalink} ]] && permalink="false" - return 0 } @@ -511,7 +509,6 @@ reset_profile(){ unset extra unset full_iso unset office_installer - unset permalink } check_profile(){ From 3917a6818ee6c4f85033cb285dc34796e683aa09 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Fri, 27 Mar 2020 08:54:41 +0100 Subject: [PATCH 4/4] rm trailing whitespace --- lib/util.sh | 106 ++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index ca5619d..f024f93 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -246,10 +246,10 @@ init_buildpkg(){ get_iso_label(){ local label="$1" - #label="${label//_}" # relace all _ - label="${label//-}" # relace all - - label="${label^^}" # all uppercase - label="${label::32}" # limit to 32 characters + #label="${label//_}" # relace all _ + label="${label//-}" # relace all - + label="${label^^}" # all uppercase + label="${label::32}" # limit to 32 characters echo ${label} } @@ -316,16 +316,16 @@ init_buildiso(){ [[ -z ${iso_compression} ]] && iso_compression='zstd' [[ -z ${kernel} ]] && kernel="linux54" - + load_run_dir "${profile_repo}" - + if [[ -d ${run_dir}/.git ]]; then - current_path=$(pwd) - cd ${run_dir} - branch=$(git rev-parse --abbrev-ref HEAD) - cd ${current_path} + current_path=$(pwd) + cd ${run_dir} + branch=$(git rev-parse --abbrev-ref HEAD) + cd ${current_path} else - [[ -z ${branch} ]] && branch="v18.0" #current branch release + [[ -z ${branch} ]] && branch="v18.0" #current branch release fi [[ -z ${gpgkey} ]] && gpgkey='' @@ -334,26 +334,26 @@ init_buildiso(){ } init_calamares(){ - - [[ -z ${welcomestyle} ]] && welcomestyle=false - - [[ -z ${welcomelogo} ]] && welcomelogo=true - - [[ -z ${windowexp} ]] && windowexp=noexpand - - [[ -z ${windowsize} ]] && windowsize="800px,520px" - [[ -z ${windowplacement} ]] && windowplacement="center" - - [[ -z ${sidebarbackground} ]] && sidebarbackground=#454948 - - [[ -z ${sidebartext} ]] && sidebartext=#efefef - - [[ -z ${sidebartextselect} ]] && sidebartextselect=#4d915e - - [[ -z ${sidebartexthighlight} ]] && sidebartexthighlight=#1a1c1b + [[ -z ${welcomestyle} ]] && welcomestyle=false + + [[ -z ${welcomelogo} ]] && welcomelogo=true + + [[ -z ${windowexp} ]] && windowexp=noexpand + + [[ -z ${windowsize} ]] && windowsize="800px,520px" + + [[ -z ${windowplacement} ]] && windowplacement="center" + + [[ -z ${sidebarbackground} ]] && sidebarbackground=#454948 + + [[ -z ${sidebartext} ]] && sidebartext=#efefef + + [[ -z ${sidebartextselect} ]] && sidebartextselect=#4d915e + + [[ -z ${sidebartexthighlight} ]] && sidebartexthighlight=#1a1c1b } - + init_deployiso(){ @@ -386,8 +386,8 @@ load_config(){ init_buildiso - init_calamares - + init_calamares + init_deployiso return 0 @@ -611,7 +611,7 @@ load_pkgs(){ fi ;; esac - + # We can reuse this code local _edition _edition_rm case "${edition}" in @@ -660,7 +660,7 @@ load_pkgs(){ | sed "$_extra" \ | sed "$_extra_rm" \ | sed "$_office" \ - | sed "$_office_rm" \ + | sed "$_office_rm" \ | sed "$_clean") if [[ $1 == "${packages_mhwd}" ]]; then @@ -824,25 +824,25 @@ create_chksums() { sha256sum $1 > $1.sha256 } -init_profiles() { - _workdir='/usr/share/manjaro-tools' - if [[ -d ${_workdir}/iso-profiles ]]; then - rm -Rf ${_workdir}/iso-profiles ]] - fi - git clone -q --depth 1 -b ${branch} https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git ${_workdir}/iso-profiles/ - - #Check if git clone is done - if [[ -d ${_workdir}/iso-profiles/manjaro ]] && [[ -d ${_workdir}/iso-profiles/community ]]; then - - for i in ${_workdir}/iso-profiles/.gitignore ${_workdir}/iso-profiles/README.md; do - rm -f $i - done - - for i in ${_workdir}/iso-profiles/.git ${_workdir}/iso-profiles/sonar; do - rm -Rf $i - done - else msg2 "Impossible to initialize iso-profiles, please check internet connection or browse at 'https://gitlab.manjaro.org/profiles-and-settings/iso-profiles'" - exit 1 - fi +init_profiles() { + _workdir='/usr/share/manjaro-tools' + if [[ -d ${_workdir}/iso-profiles ]]; then + rm -Rf ${_workdir}/iso-profiles ]] + fi + git clone -q --depth 1 -b ${branch} https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git ${_workdir}/iso-profiles/ + + #Check if git clone is done + if [[ -d ${_workdir}/iso-profiles/manjaro ]] && [[ -d ${_workdir}/iso-profiles/community ]]; then + + for i in ${_workdir}/iso-profiles/.gitignore ${_workdir}/iso-profiles/README.md; do + rm -f $i + done + + for i in ${_workdir}/iso-profiles/.git ${_workdir}/iso-profiles/sonar; do + rm -Rf $i + done + else msg2 "Impossible to initialize iso-profiles, please check internet connection or browse at 'https://gitlab.manjaro.org/profiles-and-settings/iso-profiles'" + exit 1 + fi }