diff options
-rw-r--r-- | etc/pkgtool.msgs.en | 50 | ||||
-rw-r--r-- | etc/pkgtool.theme | 56 | ||||
-rwxr-xr-x | pkgtool.sh | 58 |
3 files changed, 107 insertions, 57 deletions
diff --git a/etc/pkgtool.msgs.en b/etc/pkgtool.msgs.en index 95deb0f8..eb9d25ab 100644 --- a/etc/pkgtool.msgs.en +++ b/etc/pkgtool.msgs.en @@ -2,28 +2,32 @@ # en_* locale messages file for pkgtool.sh # -MSG_pkgtool_build_group="1;Build group: %s"; -MSG_pkgtool_pkg_archive_mirroring="2;Mirroring package \`%s', archive URL(s): \`%s'..."; -MSG_pkgtool_pkg_archive_mirroring_parent="3;Mirroring package \`%s' (parent package: \`%s'), archive URL(s): \`%s'..."; -MSG_pkgtool_pkg_deps_fail="1;Warning: failed to unfold dependency-expanded package name list for \`%s'."; -MSG_pkgtool_pkg_deps_full_disabled="2;Full dependencies of \`%s' (disabled packages:) %s"; -MSG_pkgtool_pkg_deps_full="2;Full dependencies of \`%s': %s"; -MSG_pkgtool_pkg_deps_rev_none="1;Package \`%s' has no reverse dependencies."; -MSG_pkgtool_pkg_direct_deps="2;Direct dependencies of \`%s': %s"; -MSG_pkgtool_pkg_disabled="2;Package \`%s' (parent package: \`%s') disabled, skipping."; -MSG_pkgtool_pkg_git_mirroring="2;Mirroring package \`%s', Git URL(s): \`%s'..."; -MSG_pkgtool_pkg_git_mirroring_parent="3;Mirroring package \`%s' (parent package: \`%s'), Git URL(s): \`%s'..."; -MSG_pkgtool_pkg_link_fail="3;Failed to create symbolic link \`%s' for package \`%s' w/ parent package \`%s'."; -MSG_pkgtool_pkg_mirror_fail="1;Failed to mirror package \`%s', skipping."; -MSG_pkgtool_pkg_no_deps="1;Package \`%s' has no dependencies."; -MSG_pkgtool_pkgs_deps_rev_disabled="2;Reverse dependencies of \`%s' (disabled packages:) %s"; -MSG_pkgtool_pkgs_deps_rev="2;Reverse dependencies of \`%s': %s"; -MSG_pkgtool_pkg_skip_archive_mirror="1;Archive URL(s) mirroring disabled, skipping \`%s'."; -MSG_pkgtool_pkg_skip_git_mirror_disabled="1;Package \`%s' specifies to skip Git URL(s) mirroring, skipping."; -MSG_pkgtool_pkg_skip_git_mirror="1;Git URL(s) mirroring disabled, skipping \`%s'."; -MSG_pkgtool_pkg_skip_no_urls="1;Package \`%s' has neither archive nor Git URL(s), skipping."; -MSG_pkgtool_tarball_created="2;Created compressed tarball of \`%s' and \`%s_stderrout.log'."; -MSG_pkgtool_tarball_creating="2;Creating compressed tarball of \`%s' and \`%s_stderrout.log'..."; -MSG_pkgtool_updated_patches="2;Updated \`%s/patches/%s'."; +MSG_info_build_group="1;Build group: [0m%s"; +MSG_info_pkg_deps_fail="1;Warning: failed to unfold dependency-expanded package name list for \`%s'."; +MSG_info_pkg_direct_deps="2;Direct dependencies of \`%s': [0m%s"; +MSG_info_pkg_no_deps="1;Package \`%s' has no dependencies."; +MSG_info_pkg_disabled="1;Package \`%s' is disabled."; +MSG_info_pkg_deps_full="2;Full dependencies of \`%s': [0m%s"; +MSG_info_pkg_deps_full_disabled="2;Full dependencies of \`%s' (disabled packages:) [0m%s"; + +MSG_mirror_pkg_disabled="2;Package \`%s' (parent package: \`%s') disabled, skipping."; +MSG_mirror_pkg_skip_archive_mirror="1;Archive URL(s) mirroring disabled, skipping \`%s'."; +MSG_mirror_pkg_archive_mirroring="2;Mirroring package \`%s', archive URL(s): \`%s'..."; +MSG_mirror_pkg_archive_mirroring_parent="3;Mirroring package \`%s' (parent package: \`%s'), archive URL(s): \`%s'..."; +MSG_mirror_pkg_mirror_fail="1;Failed to mirror package \`%s', skipping."; +MSG_mirror_pkg_skip_git_mirror="1;Git URL(s) mirroring disabled, skipping \`%s'."; +MSG_mirror_pkg_skip_git_mirror_disabled="1;Package \`%s' specifies to skip Git URL(s) mirroring, skipping."; +MSG_mirror_pkg_link_fail="3;Failed to create symbolic link \`%s' for package \`%s' w/ parent package \`%s'."; +MSG_mirror_pkg_git_mirroring="2;Mirroring package \`%s', Git URL(s): \`%s'..."; +MSG_mirror_pkg_git_mirroring_parent="3;Mirroring package \`%s' (parent package: \`%s'), Git URL(s): \`%s'..."; +MSG_mirror_pkg_skip_no_urls="1;Package \`%s' has neither archive nor Git URL(s), skipping."; + +MSG_rdepends_pkg_deps_rev_none="1;Package \`%s' has no reverse dependencies."; +MSG_rdepends_pkgs_deps_rev_disabled="2;Reverse dependencies of \`%s' (disabled packages:) [0m%s"; +MSG_rdepends_pkgs_deps_rev="2;Reverse dependencies of \`%s': [0m%s"; +MSG_rdepends_pkgs_deps_rev_recurse="2;Recursive reverse dependencies of \`%s': %s"; + +MSG_tarball_created="2;Created compressed tarball of \`%s' and \`%s_stderrout.log'."; +MSG_tarball_creating="2;Creating compressed tarball of \`%s' and \`%s_stderrout.log'..."; # vim:foldmethod=marker ft=sh diff --git a/etc/pkgtool.theme b/etc/pkgtool.theme index 31ea331e..cba6c9f9 100644 --- a/etc/pkgtool.theme +++ b/etc/pkgtool.theme @@ -35,22 +35,60 @@ # # Tag sets # -LOG_TAGS_all="fileop,install,fatal,info,verbose,warning"; -LOG_TAGS_normal="fatal,info,warning"; +LOG_TAGS_all="fileop,install,fatal,info,verbose,warning,package_vars,info_build_group,info_pkg_direct_deps,info_pkg_no_deps,info_pkg_disabled,info_pkg_deps_full,info_pkg_deps_full_disabled,mirror_pkg_archive_mirroring,mirror_pkg_archive_mirroring_parent,mirror_pkg_git_mirroring,mirror_pkg_git_mirroring_parent"; +LOG_TAGS_normal="fatal,info,warning,package_vars,info_build_group,info_pkg_direct_deps,info_pkg_no_deps,info_pkg_disabled,info_pkg_deps_full,info_pkg_deps_full_disabled,mirror_pkg_archive_mirroring,mirror_pkg_archive_mirroring_parent,mirror_pkg_git_mirroring,mirror_pkg_git_mirroring_parent"; LOG_TAGS_verbose="${LOG_TAGS_normal:+${LOG_TAGS_normal},}verbose"; - # # Subsystem tags # -LOG_TAG_fileop=36; # Cyan -LOG_TAG_install=36; # Cyan +LOG_TAG_fileop=36; # Cyan +LOG_TAG_install=36; # Cyan # # General level tags # -LOG_TAG_fatal=91; # Bright red -LOG_TAG_info=93; # Bright yellow -LOG_TAG_verbose=96; # Bright cyan -LOG_TAG_warning=31; # Dark red +LOG_TAG_fatal=91; # Bright red +LOG_TAG_info=93; # Bright yellow +LOG_TAG_verbose=96; # Bright cyan +LOG_TAG_warning=31; # Dark red + +# +# General build tags +# +LOG_TAG_package_vars=33; # Dark yellow +LOG_TAG_package_vars_even_256="38;5;228"; # RGB #ffaf5f +LOG_TAG_package_vars_odd_256="38;5;226"; # RGB #ffaf00 + +# +# Package info tags +# +LOG_TAG_info_build_group=93; # Bright yellow +LOG_TAG_info_build_group_256="38;5;221"; # RGB #ffd75f +LOG_TAG_info_pkg_direct_deps=93; # Bright yellow +LOG_TAG_info_pkg_direct_deps_256="38;5;215"; # RGB #ffaf5f +LOG_TAG_info_pkg_no_deps=96; # Bright cyan +LOG_TAG_info_pkg_no_deps_256="38;5;205"; # RGB #ff5faf +LOG_TAG_info_pkg_disabled=96; # Bright cyan +LOG_TAG_info_pkg_disabled_256="38;5;207"; # RGB #ff5fff +LOG_TAG_info_pkg_deps_full=93; # Bright yellow +LOG_TAG_info_pkg_deps_full_256="38;5;208"; # RGB #ff8700 +LOG_TAG_info_pkg_deps_full_disabled=96; # Bright cyan +LOG_TAG_info_pkg_deps_full_disabled_256="38;5;147"; # RGB #afafff + +# +# Package mirror tags +# +LOG_TAG_mirror_pkg_archive_mirroring=93; # Bright yellow +LOG_TAG_mirror_pkg_archive_mirroring_even_256="38;5;123"; # RGB #87ffff +LOG_TAG_mirror_pkg_archive_mirroring_odd_256="38;5;122"; # RGB #87ffd7 +LOG_TAG_mirror_pkg_archive_mirroring_parent=93; # Bright yellow +LOG_TAG_mirror_pkg_archive_mirroring_parent_even_256="38;5;123"; # RGB #87ffff +LOG_TAG_mirror_pkg_archive_mirroring_parent_odd_256="38;5;122"; # RGB #87ffd7 +LOG_TAG_mirror_pkg_git_mirroring=93; # Bright yellow +LOG_TAG_mirror_pkg_git_mirroring_even_256="38;5;117"; # RGB #87d7ff +LOG_TAG_mirror_pkg_git_mirroring_odd_256="38;5;116"; # RGB #87d7d7 +LOG_TAG_mirror_pkg_git_mirroring_parent=93; # Bright yellow +LOG_TAG_mirror_pkg_git_mirroring_parent_even_256="38;5;117"; # RGB #87d7ff +LOG_TAG_mirror_pkg_git_mirroring_parent_odd_256="38;5;116"; # RGB #87d7d7 # vim:foldmethod=marker ft=sh @@ -220,30 +220,34 @@ pkgtoolp_info() { rtl_setrstatus "${_ppi_rstatus}" 'Error: failed to set package environment for \`'"${_ppi_pkg_name}'"'.'; else rtl_get_var_unsafe \$_ppi_pkg_version -u "PKG_${_ppi_pkg_name}_VERSION"; - rtl_log_env_vars "info" "package" $(rtl_get_vars_fast "^PKG_${_ppi_pkg_name_uc}"); - rtl_log_msg "info" "${MSG_pkgtool_build_group}" "${_ppi_group_name}"; + rtl_log_env_vars "package_vars" "Package variables" $(rtl_get_vars_fast "^PKG_${_ppi_pkg_name_uc}"); + rtl_log_msg "info_build_group" "${MSG_info_build_group}" "${_ppi_group_name}"; + + if [ "${PKG_DISABLED:-0}" -eq 1 ]; then + rtl_log_msg "info_pkg_disabled" "${MSG_info_pkg_disabled}" "${_ppi_pkg_name}"; + fi; if [ "${PKG_DEPENDS:+1}" != 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_no_deps}" "${_ppi_pkg_name}"; + rtl_log_msg "info_pkg_no_deps" "${MSG_info_pkg_no_deps}" "${_ppi_pkg_name}"; else - rtl_log_msg "info" "${MSG_pkgtool_pkg_direct_deps}" "${_ppi_pkg_name}" "${PKG_DEPENDS}"; + rtl_log_msg "info_pkg_direct_deps" "${MSG_info_pkg_direct_deps}" "${_ppi_pkg_name}" "${PKG_DEPENDS}"; if ! ex_pkg_unfold_depends \ \$_ppi_pkg_disabled \$_ppi_pkg_finished \ \$_ppi_pkg_names 1 1 "${_ppi_group_name}" \ "${_ppi_pkg_names}" "${_ppi_pkg_name}" 0 \ "${BUILD_WORKDIR}"; then - rtl_log_msg "warning" "${MSG_pkgtool_pkg_deps_fail}" "${_ppi_pkg_name}"; + rtl_log_msg "warning" "${MSG_info_pkg_deps_fail}" "${_ppi_pkg_name}"; else rtl_lfilter \$_ppi_pkg_names "${_ppi_pkg_name}"; if [ "${_ppi_pkg_names:+1}" = 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_deps_full}"\ + rtl_log_msg "info_pkg_deps_full" "${MSG_info_pkg_deps_full}"\ "${_ppi_pkg_name}" "$(rtl_lsort "${_ppi_pkg_names}")"; fi; if [ "${_ppi_pkg_disabled:+1}" = 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_deps_full_disabled}"\ + rtl_log_msg "info_pkg_deps_full_disabled" "${MSG_info_pkg_deps_full_disabled}"\ "${_ppi_pkg_name}" "$(rtl_lsort "${_ppi_pkg_disabled}")"; fi; fi; @@ -319,7 +323,7 @@ pkgtoolp_mirror_fetch() { if rtl_get_var_unsafe \$_ppmf_pkg_disabled -u "PKG_${_ppmf_pkg_name_real}_DISABLED"\ && [ "${_ppmf_pkg_disabled:-0}" -eq 1 ]; then - rtl_log_msg "verbose" "${MSG_pkgtool_pkg_disabled}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}"; + rtl_log_msg "verbose" "${MSG_mirror_pkg_disabled}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}"; else if rtl_get_var_unsafe \$_ppmf_pkg_url -u "PKG_${_ppmf_pkg_name_real}_URL"\ && rtl_get_var_unsafe \$_ppmf_pkg_sha256sum -u "PKG_${_ppmf_pkg_name_real}_SHA256SUM"\ @@ -328,12 +332,12 @@ pkgtoolp_mirror_fetch() { then if [ "${_ppmf_mirror_dname:+1}" != 1 ]; then - _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_pkgtool_pkg_skip_archive_mirror}" "${_ppmf_pkg_name}"; + _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_mirror_pkg_skip_archive_mirror}" "${_ppmf_pkg_name}"; elif [ "${_ppmf_pkg_name}" != "${_ppmf_pkg_name_real}" ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_archive_mirroring_parent}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}" "${_ppmf_pkg_url}"; + rtl_log_msg "mirror_pkg_archive_mirroring_parent" "${MSG_mirror_pkg_archive_mirroring_parent}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}" "${_ppmf_pkg_url}"; if ! rtl_fileop ln_symbolic "${_ppmf_pkg_name_real}" "${_ppmf_mirror_dname}/${_ppmf_pkg_name}"; then - _ppmf_rc=1; rtl_log_msg "warning" "${MSG_pkgtool_pkg_link_fail}"\ + _ppmf_rc=1; rtl_log_msg "warning" "${MSG_mirror_pkg_link_fail}"\ "${_ppmf_mirror_dname}/${_ppmf_pkg_name}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}"; fi; @@ -342,7 +346,7 @@ pkgtoolp_mirror_fetch() { && [ "${_ppmf_pkg_fname:+1}" != 1 ]; then _ppmf_pkg_fname="${_ppmf_pkg_url##*/}"; fi; - rtl_log_msg "info" "${MSG_pkgtool_pkg_archive_mirroring}" "${_ppmf_pkg_name}" "${_ppmf_pkg_url}"; + rtl_log_msg "mirror_pkg_archive_mirroring" "${MSG_mirror_pkg_archive_mirroring}" "${_ppmf_pkg_name}" "${_ppmf_pkg_url}"; if ! rtl_fileop mkdir "${_ppmf_mirror_dname}/${_ppmf_pkg_name}"\ || ! rtl_fetch_url_wget \ @@ -353,7 +357,7 @@ pkgtoolp_mirror_fetch() { ""; then _ppmf_rc=1; - rtl_log_msg "warning" "${MSG_pkgtool_pkg_mirror_fail}" "${_ppmf_pkg_name}"; + rtl_log_msg "warning" "${MSG_mirror_pkg_mirror_fail}" "${_ppmf_pkg_name}"; rtl_lconcat "${_ppmf_rpkgs_failed}" "${_ppmf_pkg_name}"; else rtl_fetch_clean_dlcache \ @@ -371,27 +375,27 @@ pkgtoolp_mirror_fetch() { then if [ "${_ppmf_mirror_dname_git:+1}" != 1 ]; then - _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_pkgtool_pkg_skip_git_mirror}" "${_ppmf_pkg_name}"; + _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_mirror_pkg_skip_git_mirror}" "${_ppmf_pkg_name}"; elif rtl_get_var_unsafe \$_ppmf_pkg_mirrors_git -u "PKG_${_ppmf_pkg_name_real}_MIRRORS_GIT"\ && [ "${_ppmf_pkg_mirrors_git}" = "skip" ]; then - _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_pkgtool_pkg_skip_git_mirror_disabled}" "${_ppmf_pkg_name}"; + _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_mirror_pkg_skip_git_mirror_disabled}" "${_ppmf_pkg_name}"; elif [ "${_ppmf_pkg_name}" != "${_ppmf_pkg_name_real}" ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_git_mirroring_parent}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}" "${_ppmf_pkg_urls_git}"; + rtl_log_msg "mirror_pkg_git_mirroring_parent" "${MSG_mirror_pkg_git_mirroring_parent}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}" "${_ppmf_pkg_urls_git}"; if ! rtl_fileop ln_symbolic "${_ppmf_pkg_name_real}" "${_ppmf_mirror_dname_git}/${_ppmf_pkg_name}"; then _ppmf_rc=1; - rtl_log_msg "warning" "${MSG_pkgtool_pkg_link_fail}" \ + rtl_log_msg "warning" "${MSG_mirror_pkg_link_fail}" \ "${_ppmf_mirror_dname_git}/${_ppmf_pkg_name}" "${_ppmf_pkg_name}" "${_ppmf_pkg_name_real}"; rtl_lconcat "${_ppmf_rpkgs_failed}" "${_ppmf_pkg_name}"; fi; else - rtl_log_msg "info" "${MSG_pkgtool_pkg_git_mirroring}" "${_ppmf_pkg_name}" "${_ppmf_pkg_urls_git}"; + rtl_log_msg "mirror_pkg_git_mirroring" "${MSG_mirror_pkg_git_mirroring}" "${_ppmf_pkg_name}" "${_ppmf_pkg_urls_git}"; if ! rtl_fileop mkdir "${_ppmf_mirror_dname_git}/${_ppmf_pkg_name}"\ || ! rtl_fetch_mirror_urls_git "${DEFAULT_GIT_ARGS}" "${_ppmf_mirror_dname_git}/${_ppmf_pkg_name}" ${_ppmf_pkg_urls_git}; then _ppmf_rc=1; - rtl_log_msg "warning" "${MSG_pkgtool_pkg_mirror_fail}" "${_ppmf_pkg_name}"; + rtl_log_msg "warning" "${MSG_mirror_pkg_mirror_fail}" "${_ppmf_pkg_name}"; rtl_lconcat "${_ppmf_rpkgs_failed}" "${_ppmf_pkg_name}"; else rtl_fetch_clean_dlcache "${_ppmf_mirror_dname_git}" "${_ppmf_pkg_name}" "${_ppmf_pkg_fname}" "${_ppmf_pkg_urls_git}"; @@ -403,7 +407,7 @@ pkgtoolp_mirror_fetch() { if [ "${_ppmf_pkg_url:+1}" != 1 ]\ && [ "${_ppmf_pkg_sha256sum:+1}" != 1 ]\ && [ "${_ppmf_pkg_urls_git:+1}" != 1 ]; then - _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_pkgtool_pkg_skip_no_urls}" "${_ppmf_pkg_name}"; + _ppmf_rc=0; rtl_log_msg "verbose" "${MSG_mirror_pkg_skip_no_urls}" "${_ppmf_pkg_name}"; fi; fi; @@ -439,7 +443,7 @@ pkgtoolp_rdepends() { && [ "${_ppr_pkg_finished:+1}" != 1 ]\ && [ "${_ppr_pkg_rdepends_direct:+1}" != 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkg_deps_rev_none}" "${_ppr_pkg_name}"; + rtl_log_msg "info" "${MSG_rdepends_pkg_deps_rev_none}" "${_ppr_pkg_name}"; else for _ppr_pkg_name_rdepend in $(rtl_lsort \ ${_ppr_pkg_finished} \ @@ -457,11 +461,15 @@ pkgtoolp_rdepends() { done; if [ "${_ppr_pkg_rdepends:+1}" = 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkgs_deps_rev}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; + if [ "${_ppr_full_rdependsfl}" -eq 1 ]; then + rtl_log_msg "info" "${MSG_rdepends_pkgs_deps_rev_recurse}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; + else + rtl_log_msg "info" "${MSG_rdepends_pkgs_deps_rev}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; + fi; fi; if [ "${_ppr_pkg_disabled:+1}" = 1 ]; then - rtl_log_msg "info" "${MSG_pkgtool_pkgs_deps_rev_disabled}" "${_ppr_pkg_name}" "$(rtl_lsort "${_ppr_pkg_disabled}")"; + rtl_log_msg "info" "${MSG_rdepends_pkgs_deps_rev_disabled}" "${_ppr_pkg_name}" "$(rtl_lsort "${_ppr_pkg_disabled}")"; fi; fi; @@ -500,7 +508,7 @@ pkgtoolp_tarball() { fi; _ppt_tarball_fname="${_ppt_pkg_name_full}@${_ppt_hname}-${_ppt_date}.tbz2"; - rtl_log_msg "info" "${MSG_pkgtool_tarball_creating}" "${PKG_BASE_DIR}" "${_ppt_pkg_name}"; + rtl_log_msg "info" "${MSG_tarball_creating}" "${PKG_BASE_DIR}" "${_ppt_pkg_name}"; if ! tar -C "${BUILD_WORKDIR}" -cpf - \ "${PKG_BASE_DIR#${BUILD_WORKDIR%/}/}" \ @@ -510,7 +518,7 @@ pkgtoolp_tarball() { _ppt_rc=1; rtl_setrstatus "${_ppt_rstatus}" 'Error: failed to create compressed tarball of \`'"${PKG_BASE_DIR}'"' and \`'"${_ppt_pkg_name}"'_stderrout.log'"'"'.'; else - rtl_log_msg "info" "${MSG_pkgtool_tarball_created}" "${PKG_BASE_DIR}" "${_ppt_pkg_name}"; + rtl_log_msg "info" "${MSG_tarball_created}" "${PKG_BASE_DIR}" "${_ppt_pkg_name}"; fi; fi; |