diff options
author | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2024-04-25 21:12:38 +0200 |
---|---|---|
committer | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2024-04-25 21:12:38 +0200 |
commit | e87e474c7f820c3ccb89ccec5b2eca68eb7a5256 (patch) | |
tree | e948fe66ad329b381080bc334b6de43d65b4e60e | |
parent | 9429b5475c3e0ef15a98b22ea6fddb59dd2af385 (diff) | |
download | midipix_build-e87e474c7f820c3ccb89ccec5b2eca68eb7a5256.tar.bz2 midipix_build-e87e474c7f820c3ccb89ccec5b2eca68eb7a5256.tar.xz |
Fix ./build.sh -r ***name and ./pkgtool.sh -r name.
-rw-r--r-- | etc/README.md | 5 | ||||
-rw-r--r-- | etc/pkgtool.msgs.en | 1 | ||||
-rw-r--r-- | etc/pkgtool.usage | 5 | ||||
-rwxr-xr-x | pkgtool.sh | 37 | ||||
-rw-r--r-- | subr.ex/ex_init.subr | 2 | ||||
-rw-r--r-- | subr.ex/ex_pkg.subr | 58 | ||||
-rw-r--r-- | subr.ex/ex_pkg_dispatch.subr | 24 |
7 files changed, 65 insertions, 67 deletions
diff --git a/etc/README.md b/etc/README.md index 38206285..5d16ed47 100644 --- a/etc/README.md +++ b/etc/README.md @@ -962,7 +962,7 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[ ## 4.6. ``pkgtool.sh`` ``` -usage: ./pkgtool.sh [-a nt32|nt64] [-b debug|release] [-e|-f|-i|-m <dname> -M <dname>|-p|-r|-R|-t] +usage: ./pkgtool.sh [-a nt32|nt64] [-b debug|release] [-e|-f|-i|-m <dname> -M <dname>|-p|-r|-t] [--theme theme] [-v] [<variable name>=<variable override>[ ..]] name[,name..] @@ -976,8 +976,7 @@ usage: ./pkgtool.sh [-a nt32|nt64] [-b debug|release] [-e|-f|-i|-m <dname> -M <d Specify "" or '' as <dname> to default to the defaults in ${HOME}/pkgtool.vars, if present. -p <log_fname> Profile last build. - -r List reverse dependencies of single named package. - -R List recursive reverse dependencies of single named package. + -r List recursive reverse dependencies of single named package. -t Produce tarball of package build root directory and build log file for the purpose of distribution given build failure. -v Increase verbosity. diff --git a/etc/pkgtool.msgs.en b/etc/pkgtool.msgs.en index 1fe000f0..05331ab6 100644 --- a/etc/pkgtool.msgs.en +++ b/etc/pkgtool.msgs.en @@ -24,7 +24,6 @@ MSG_mirror_pkg_skip_no_urls="1;Package \`%s' has neither archive nor Git URL(s), 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'."; diff --git a/etc/pkgtool.usage b/etc/pkgtool.usage index 7fc7e77b..a07f8e47 100644 --- a/etc/pkgtool.usage +++ b/etc/pkgtool.usage @@ -1,4 +1,4 @@ -[97musage[90m: [33m./[93mpkgtool.sh [90m[[33m-[93ma nt32[90m|[93mnt64[90m] [[33m-[93mb [93mdebug[90m|[93mrelease[90m] [[33m-[93me[90m|[33m-[93mf[90m|[33m-[93mi[90m|[33m-[93mm [90m<[93mdname[90m> [33m-[93mM [90m<[93mdname[90m>|[33m-[93mp[90m|[33m-[93mr[90m|[33m-[93mR[90m|[33m-[93mt[90m][0m +[97musage[90m: [33m./[93mpkgtool.sh [90m[[33m-[93ma nt32[90m|[93mnt64[90m] [[33m-[93mb [93mdebug[90m|[93mrelease[90m] [[33m-[93me[90m|[33m-[93mf[90m|[33m-[93mi[90m|[33m-[93mm [90m<[93mdname[90m> [33m-[93mM [90m<[93mdname[90m>|[33m-[93mp[90m|[33m-[93mr[90m|[33m-[93mt[90m][0m [90m[[93m--theme theme[90m] [90m[[33m-[93mv[90m][0m [90m[<[93mvariable name[90m>[93m=[90m<[93mvariable override[90m>[ ..]] [93mname[90m[,[93mname[90m..][0m @@ -12,8 +12,7 @@ [96mSpecify "" or '' as <dname> to default to the defaults in[0m [93m${HOME}/pkgtool.vars[96m, if present.[0m [33m-[93mp [90m<[93mlog_fname[90m>[0m [96mProfile last build.[0m - [33m-[93mr [96mList reverse dependencies of single named package.[0m - [33m-[93mR [96mList recursive reverse dependencies of single named package.[0m + [33m-[93mr [96mList recursive reverse dependencies of single named package.[0m [33m-[93mt [96mProduce tarball of package build root directory and build log[0m [96mfile for the purpose of distribution given build failure.[0m [33m-[93mv [96mIncrease verbosity.[0m @@ -56,24 +56,22 @@ pkgtoolp_init_args() { + ${ARG_MIRROR:-0} + ${ARG_PROFILE:-0} + ${ARG_RDEPENDS:-0} - + ${ARG_RDEPENDS_FULL:-0} + ${ARG_TARBALL:-0}))" -gt 1 ]; then cat etc/pkgtool.usage; _ppia_rc=1; - rtl_setrstatus "${_ppia_rstatus}" 'only one of -e, -f, -i, -m and/or -M, -p, -r, -R, -s, or -t must be specified.'; + rtl_setrstatus "${_ppia_rstatus}" 'only one of -e, -f, -i, -m and/or -M, -p, -r, -s, or -t must be specified.'; elif [ "$((${ARG_INFO:-0} + ${ARG_EDIT:-0} + ${ARG_FILES:-0} + ${ARG_MIRROR:-0} + ${ARG_PROFILE:-0} + ${ARG_RDEPENDS:-0} - + ${ARG_RDEPENDS_FULL:-0} + ${ARG_TARBALL:-0}))" -eq 0 ]; then cat etc/pkgtool.usage; _ppia_rc=1; - rtl_setrstatus "${_ppia_rstatus}" 'one of -e, -f, -i, -m and/or -M, -p, -r, -R, -s, or -t must be specified.'; + rtl_setrstatus "${_ppia_rstatus}" 'one of -e, -f, -i, -m and/or -M, -p, -r, -s, or -t must be specified.'; else _ppia_rc=0; export TMP="${BUILD_WORKDIR}" TMPDIR="${BUILD_WORKDIR}"; @@ -93,8 +91,8 @@ pkgtoolp_init_getopts_fn() { : ${ARCH:="nt64"}; : ${BUILD_KIND:="debug"}; - ARG_INFO=0; ARG_EDIT=0; ARG_MIRROR=0; ARG_RDEPENDS=0; - ARG_RDEPENDS_FULL=0; ARG_TARBALL=0; ARG_VERBOSE=0; + ARG_INFO=0; ARG_EDIT=0; ARG_MIRROR=0; + ARG_RDEPENDS=0; ARG_TARBALL=0; ARG_VERBOSE=0; ;; longopt) @@ -148,7 +146,6 @@ pkgtoolp_init_getopts_fn() { fi; _ppigf_shiftfl=2; ;; r) ARG_RDEPENDS=1; _ppigf_shiftfl=1; ;; - R) ARG_RDEPENDS_FULL=1; _ppigf_shiftfl=1; ;; t) ARG_TARBALL=1; _ppigf_shiftfl=1; ;; v) ARG_VERBOSE=1; _ppigf_shiftfl=1; ;; *) cat etc/pkgtool.usage; exit 1; ;; @@ -619,9 +616,9 @@ pkgtoolp_profile() { return "${_ppp_rc}"; }; # }}} -# {{{ pkgtoolp_rdepends($_rstatus, $_pkg_name, $_full_rdependsfl) +# {{{ pkgtoolp_rdepends($_rstatus, $_pkg_name) pkgtoolp_rdepends() { - local _ppr_rstatus="${1}" _ppr_pkg_name="${2}" _ppr_full_rdependsfl="${3}" \ + local _ppr_rstatus="${1}" _ppr_pkg_name="${2}" \ _ppr_depends="" _ppr_group_name="" _ppr_groups="" _ppr_groups_noauto="" \ _ppr_pkg_depends="" _ppr_pkg_disabled="" _ppr_pkg_finished="" \ _ppr_pkg_name_rdepend="" _ppr_pkg_names="" _ppr_pkg_rdepends="" \ @@ -640,7 +637,8 @@ pkgtoolp_rdepends() { \$_ppr_pkg_disabled \$_ppr_pkg_finished \ \$_ppr_pkg_rdepends_direct \ "${_ppr_group_name}" "${_ppr_pkg_names}" \ - "${_ppr_pkg_name}" 1 "${BUILD_WORKDIR}"; + "${_ppr_pkg_name}" 1 "${BUILD_WORKDIR}" \ + "norecurse"; then _ppr_rc=1; rtl_setrstatus "${_ppr_rstatus}" 'Error: failed to unfold reverse dependency-expanded package name list for \`'"${_ppr_pkg_name}'"'.'; @@ -654,23 +652,19 @@ pkgtoolp_rdepends() { ${_ppr_pkg_finished} \ ${_ppr_pkg_rdepends_direct}); do - rtl_lconcat \$_ppr_pkg_rdepends "${_ppr_pkg_name_rdepend}"; - - if [ "${_ppr_full_rdependsfl}" -eq 1 ]; then - rtl_get_var_unsafe \$_ppr_depends -u "PKG_"${_ppr_pkg_name}"_DEPENDS"; + if rtl_get_var_unsafe \$_ppr_depends -u "PKG_"${_ppr_pkg_name_rdepend}"_DEPENDS"\ + && [ "${_ppr_depends:+1}" = 1 ]; then if rtl_lunfold_dependsV 'PKG_${_rld_name}_DEPENDS' \$_ppr_pkg_depends ${_ppr_depends}\ + && rtl_lfilter \$_ppr_pkg_depends "${_ppr_pkg_name}"\ && [ "${_ppr_pkg_depends:+1}" = 1 ]; then - rtl_lconcat \$_ppr_pkg_rdepends "[33m${_ppr_pkg_depends}[93m"; + rtl_lconcat \$_ppr_pkg_rdepends "[33m$(rtl_uniq "$(rtl_lsortV ${_ppr_pkg_depends})")[93m"; fi; fi; + rtl_lconcat \$_ppr_pkg_rdepends "${_ppr_pkg_name_rdepend}"; done; if [ "${_ppr_pkg_rdepends:+1}" = 1 ]; then - if [ "${_ppr_full_rdependsfl}" -eq 1 ]; then - rtl_log_msgV "info" "${MSG_rdepends_pkgs_deps_rev_recurse}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; - else - rtl_log_msgV "info" "${MSG_rdepends_pkgs_deps_rev}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; - fi; + rtl_log_msgV "info" "${MSG_rdepends_pkgs_deps_rev_recurse}" "${_ppr_pkg_name}" "${_ppr_pkg_rdepends}"; fi; if [ "${_ppr_pkg_disabled:+1}" = 1 ]; then @@ -746,8 +740,7 @@ pkgtool() { "${ARG_INFO:-0}") pkgtoolp_info \$_status "${PKGTOOL_PKG_NAME}"; ;; "${ARG_MIRROR:-0}") pkgtoolp_mirror \$_status "${ARG_MIRROR_DNAME}" "${ARG_MIRROR_DNAME_GIT}"; ;; "${ARG_PROFILE:-0}") pkgtoolp_profile \$_status "${ARG_PROFILE_LOG_FNAME}"; ;; - "${ARG_RDEPENDS:-0}") pkgtoolp_rdepends \$_status "${PKGTOOL_PKG_NAME}" 0; ;; - "${ARG_RDEPENDS_FULL:-0}") pkgtoolp_rdepends \$_status "${PKGTOOL_PKG_NAME}" 1; ;; + "${ARG_RDEPENDS:-0}") pkgtoolp_rdepends \$_status "${PKGTOOL_PKG_NAME}"; ;; "${ARG_TARBALL:-0}") pkgtoolp_tarball \$_status "${PKGTOOL_PKG_NAME}"; ;; esac; _rc="${?}"; fi; diff --git a/subr.ex/ex_init.subr b/subr.ex/ex_init.subr index e9b4d3f4..5dc4f857 100644 --- a/subr.ex/ex_init.subr +++ b/subr.ex/ex_init.subr @@ -321,7 +321,7 @@ ex_init_files() { # # ex_init_logging() - initialise build logging # @_rstatus: out reference to variable of status string on failure -# @_rverbose_tags: in reference toout variable of -V argument value +# @_rverbose_tags: in reference to out variable of -V argument value # @_verbose: -[vV] argument value # # Returns: zero (0) on success, non-zero (>0) on failure diff --git a/subr.ex/ex_pkg.subr b/subr.ex/ex_pkg.subr index a14ac215..d706d235 100644 --- a/subr.ex/ex_pkg.subr +++ b/subr.ex/ex_pkg.subr @@ -382,8 +382,8 @@ ex_pkg_register_group() { # # ex_pkg_unfold_depends() - unfold list of package names into dependency-expanded set of complete, disabled, finished, and outstanding package names -# @_rdisabled: in reference toout variable of disabled packages -# @_rfinished: in reference toout variable of finished packages +# @_rdisabled: in reference to out variable of disabled packages +# @_rfinished: in reference to out variable of finished packages # @_rnames: out reference to variable of package names # @_checkfl: enable (1) or inhibit (0) dependency expansion # @_forcefl: enable (1) or inhibit (0) forcibly rebuilding finished packages @@ -467,24 +467,25 @@ ex_pkg_unfold_depends() { # # ex_pkg_unfold_rdepends() - unfold list of package names into reverse dependency-expanded set of complete, disabled, finished, and outstanding package names -# @_rdisabled: in reference toout variable of disabled packages -# @_rfinished: in reference toout variable of finished packages +# @_rdisabled: in reference to out variable of disabled packages +# @_rfinished: in reference to out variable of finished packages # @_rnames: out reference to variable of package names # @_group_name: build group name # @_pkg_names: list of package names # @_restart: optional whitespace-separated list of package names to rebuild # @_test_finished: only exclude disabled packages (0,) split finished packages # @_workdir: pathname to build-specific temporary directory +# @_recursefl: resolve recursively ("recurse") or non-recursively ("norecurse") # # Returns: zero (0) on success, non-zero (>0) on failure. # ex_pkg_unfold_rdepends() { local _epur_rdisabled="${1#\$}" _epur_rfinished="${2#\$}" _epur_rnames="${3#\$}" \ _epur_group_name="${4}" _epur_pkg_names="${5}" _epur_restart="${6}" \ - _epur_test_finished="${7}" _epur_workdir="${8}" \ + _epur_test_finished="${7}" _epur_workdir="${8}" _epur_recursefl="${9}" \ _epur_depends="" _epur_disabled=0 _epur_force=0 _epur_pkg_depends="" \ _epur_pkg_name="" _epur_pkg_names_new="" _epur_pkg_name_depend="" \ - _epur_pkg_rdepends=""; + _epur_pkg_name_rdepend="" _epur_pkg_rdepends=""; for _epur_pkg_name_depend in ${_epur_restart}; do for _epur_pkg_name in ${_epur_pkg_names}; do @@ -496,25 +497,32 @@ ex_pkg_unfold_rdepends() { && [ "${_epur_pkg_depends:+1}" = 1 ]\ && rtl_lmatch \$_epur_pkg_depends "${_epur_pkg_name_depend}"; then - if rtl_get_var_unsafe \$_epur_disabled -u "PKG_${_epur_pkg_name}_DISABLED"\ - && [ "${_epur_disabled}" = 1 ]; - then - rtl_lconcat "${_epur_rdisabled}" "${_epur_pkg_name}"; - - elif [ "${_epur_test_finished}" -eq 1 ]\ - && ex_pkg_state_test2 "${_epur_workdir}" "${_epur_pkg_name}" finish\ - && rtl_get_var_unsafe \$_epur_force -u "${_epur_group_name}_FORCE"\ - && [ "${_epur_force}" != 1 ]; - then - rtl_lconcat "${_epur_rfinished}" "${_epur_pkg_name}"; - - elif [ "${_epur_test_finished:-1}" -eq 0 ]\ - || ! ex_pkg_state_test2 "${_epur_workdir}" "${_epur_pkg_name}" finish\ - || ( rtl_get_var_unsafe \$_epur_force -u "${_epur_group_name}_FORCE"\ - && [ "${_epur_force}" = 1 ] ); - then - rtl_lconcat \$_epur_pkg_names_new "${_epur_pkg_name}"; - fi; + case "${_epur_recursefl}" in + recurse) _epur_pkg_rdepends="${_epur_pkg_name} ${_epur_pkg_depends}"; ;; + norecurse) _epur_pkg_rdepends="${_epur_pkg_name}"; ;; + esac; + + for _epur_pkg_name_rdepend in ${_epur_pkg_rdepends}; do + if rtl_get_var_unsafe \$_epur_disabled -u "PKG_${_epur_pkg_name_rdepend}_DISABLED"\ + && [ "${_epur_disabled}" = 1 ]; + then + rtl_lconcat "${_epur_rdisabled}" "${_epur_pkg_name_rdepend}"; + + elif [ "${_epur_test_finished}" -eq 1 ]\ + && ex_pkg_state_test2 "${_epur_workdir}" "${_epur_pkg_name_rdepend}" finish\ + && rtl_get_var_unsafe \$_epur_force -u "${_epur_group_name}_FORCE"\ + && [ "${_epur_force}" != 1 ]; + then + rtl_lconcat "${_epur_rfinished}" "${_epur_pkg_name_rdepend}"; + + elif [ "${_epur_test_finished:-1}" -eq 0 ]\ + || ! ex_pkg_state_test2 "${_epur_workdir}" "${_epur_pkg_name_rdepend}" finish\ + || ( rtl_get_var_unsafe \$_epur_force -u "${_epur_group_name}_FORCE"\ + && [ "${_epur_force}" = 1 ] ); + then + rtl_lconcat \$_epur_pkg_names_new "${_epur_pkg_name_rdepend}"; + fi; + done; fi; done; done; diff --git a/subr.ex/ex_pkg_dispatch.subr b/subr.ex/ex_pkg_dispatch.subr index 83f36656..19818e97 100644 --- a/subr.ex/ex_pkg_dispatch.subr +++ b/subr.ex/ex_pkg_dispatch.subr @@ -64,7 +64,7 @@ exp_pkg_dispatch_expand_packages() { "${_epdep_rdisabled}" "${_epdep_rfinished}" \ "${_epdep_rnames}" "${_epdep_group_name}" \ "${_epdep_pkg_names}" "${_epdep_restart}" 1 \ - "${_epdep_workdir}"; + "${_epdep_workdir}" "recurse"; fi; fi; @@ -77,16 +77,16 @@ exp_pkg_dispatch_expand_packages() { # # exp_pkg_dispatch_group() - dispatch a single build group -# @_rdispatch_count: in reference toout variable of dispatcher count -# @_rdispatch_count_cur: in reference toout variable of current dispatcher count +# @_rdispatch_count: in reference to out variable of dispatcher count +# @_rdispatch_count_cur: in reference to out variable of current dispatcher count # @_dispatch_count_max: maximum dispatcher count # @_dispatch_group_cur: current group # @_dispatch_group_max: maximum group -# @_rdispatch_njobs: in reference toout variable of dispatcher count -# @_rdispatch_wait: in reference toout variable of package names in a wait state +# @_rdispatch_njobs: in reference to out variable of dispatcher count +# @_rdispatch_wait: in reference to out variable of package names in a wait state # @_rpkg_disabled: in reference to variable of list of disabled packages -# @_rpkg_finished: in reference toout variable of list of finished packages -# @_rpkg_names: in reference toout variable of list of package names +# @_rpkg_finished: in reference to out variable of list of finished packages +# @_rpkg_names: in reference to out variable of list of package names # @_build_steps_default: list of default build steps # @_build_vars_default: list of default build variables # @_checkfl: enable (1) or inhibit (0) dependency expansion @@ -213,16 +213,16 @@ exp_pkg_dispatch_group() { # # exp_pkg_dispatch_packages() - dispatch set of packages -# @_rdispatch_count: in reference toout variable of dispatcher count +# @_rdispatch_count: in reference to out variable of dispatcher count # @_dispatch_count_cur: current dispatcher count # @_dispatch_count_max: maximum dispatcher count # @_dispatch_group_cur: current group # @_dispatch_group_max: maximum group -# @_rdispatch_njobs: in reference toout variable of dispatcher count -# @_rdispatch_wait: in reference toout variable of package names in a wait state +# @_rdispatch_njobs: in reference to out variable of dispatcher count +# @_rdispatch_wait: in reference to out variable of package names in a wait state # @_rpkg_disabled: in reference to variable of list of disabled packages -# @_rpkg_finished: in reference toout variable of list of finished packages -# @_rpkg_names: in reference toout variable of list of package names +# @_rpkg_finished: in reference to out variable of list of finished packages +# @_rpkg_names: in reference to out variable of list of package names # @_build_steps_default: list of default build steps # @_build_vars_default: list of default build variables # @_checkfl: enable (1) or inhibit (0) dependency expansion |