From dcf9e96aa3a3530b6f0e6afba8dc0c102b89dd51 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 02 Jul 2020 18:36:56 -0400 Subject: Prefix "static" vars with "_" --- (limited to 'src/cmd') diff --git a/src/cmd/build.sh b/src/cmd/build.sh index f768cba..13792b3 100644 --- a/src/cmd/build.sh +++ b/src/cmd/build.sh @@ -18,15 +18,15 @@ # along with the ProteanOS Development Kit. If not, see # . -cmd_build_root= -cmd_build_pkg_dir= -cmd_build_build_deps= +_cmd_build_root= +_cmd_build_pkg_dir= +_cmd_build_build_deps= _cmd_build_make_deps_pkg() { local pkg_dir= - pkg_dir="${cmd_build_root}$(session_dir)/builddeps" + pkg_dir="${_cmd_build_root}$(session_dir)/builddeps" mkdir -p -- "${pkg_dir}/control" "${pkg_dir}/data" printf '2.0\n' >"${pkg_dir}/debian-binary" cat >"${pkg_dir}/control/control" <<-EOF @@ -35,7 +35,7 @@ _cmd_build_make_deps_pkg() Version: 1.0 Architecture: all Platform: all - Depends: ${cmd_build_build_deps} + Depends: ${_cmd_build_build_deps} Description: Build dependencies metapackage generated by prokit EOF (cd -- "${pkg_dir}/data"; tar -czf ../data.tar.gz .) @@ -52,19 +52,19 @@ _cmd_build_fini() session_dir="$(session_dir)" - if [ "x${cmd_build_build_deps}" != 'x' ]; then + if [ "x${_cmd_build_build_deps}" != 'x' ]; then session_exec opkg --autoremove remove \ prokit-builddeps-$(session_id) - rm -f -- "${cmd_build_root}${session_dir}/builddeps.opk" + rm -f -- "${_cmd_build_root}${session_dir}/builddeps.opk" # Hack to avoid this code branch if the function is called again # in response to a signal. - cmd_build_build_deps='' + _cmd_build_build_deps='' fi - for f in "${cmd_build_root}${session_dir}/"*; do + for f in "${_cmd_build_root}${session_dir}/"*; do [ -e "${f}" ] || continue [ "x${f##*/}" = 'xwd' ] && continue - mv "${f}" "${cmd_build_pkg_dir}/.." + mv "${f}" "${_cmd_build_pkg_dir}/.." done } @@ -95,7 +95,7 @@ cmd_build_main() fi fi - cmd_build_root="${root}" + _cmd_build_root="${root}" opkbuild_optstring="$(cat -- "${root}/usr/share/opkbuild/optstring")" arch="$(cat -- "${root}/etc/proteanos_arch")" @@ -108,15 +108,15 @@ cmd_build_main() done first_arg=true - cmd_build_pkg_dir='' + _cmd_build_pkg_dir='' for arg in "${@}"; do if ${first_arg}; then set -- first_arg=false else - set -- "${@}" "${cmd_build_pkg_dir}" + set -- "${@}" "${_cmd_build_pkg_dir}" fi - cmd_build_pkg_dir="${arg}" + _cmd_build_pkg_dir="${arg}" done if ! profile_detect "${root}"; then @@ -124,18 +124,18 @@ cmd_build_main() return 2 fi - if ! [ -d "${cmd_build_pkg_dir}" ]; then - error "$(get_msg 'cmd_build_not_a_dir')" "${cmd_build_pkg_dir}" + if ! [ -d "${_cmd_build_pkg_dir}" ]; then + error "$(get_msg 'cmd_build_not_a_dir')" "${_cmd_build_pkg_dir}" [ "x${dev}" != 'x' ] && block_umount "${root}" return 2 fi - if ! package_init "${cmd_build_pkg_dir}"; then + if ! package_init "${_cmd_build_pkg_dir}"; then [ "x${dev}" != 'x' ] && block_umount "${root}" return 2 fi package_set_substvars "${arch}" "${plat}" - if ! session_begin "${root}" "${cmd_build_pkg_dir}" false; then + if ! session_begin "${root}" "${_cmd_build_pkg_dir}" false; then _cmd_build_fini [ "x${dev}" != 'x' ] && block_umount "${root}" return 2 @@ -143,8 +143,8 @@ cmd_build_main() es=0 - cmd_build_build_deps="$(package_get_build_deps "${arch}" "${plat}")" - if [ "x${cmd_build_build_deps}" != 'x' ]; then + _cmd_build_build_deps="$(package_get_build_deps "${arch}" "${plat}")" + if [ "x${_cmd_build_build_deps}" != 'x' ]; then _cmd_build_make_deps_pkg if session_exec opkg -a "${arch}" print-architecture \ 1>/dev/null 2>&1; then diff --git a/src/cmd/opkg.sh b/src/cmd/opkg.sh index 6a21f5f..20b5c72 100644 --- a/src/cmd/opkg.sh +++ b/src/cmd/opkg.sh @@ -18,16 +18,16 @@ # along with the ProteanOS Development Kit. If not, see # . -cmd_opkg_opks= +_cmd_opkg_opks= _cmd_opkg_fini() { - case "${cmd_opkg_opks}" in + case "${_cmd_opkg_opks}" in *[!\ ]*) - rm -f -- ${cmd_opkg_opks} + rm -f -- ${_cmd_opkg_opks} # Hack to avoid this code branch if the function is # called again in response to a signal. - cmd_opkg_opks='' + _cmd_opkg_opks='' ;; esac } @@ -60,7 +60,7 @@ cmd_opkg_main() first_arg=true install_cmd=false - cmd_opkg_opks='' + _cmd_opkg_opks='' for arg in "${@}"; do if ${first_arg}; then set -- @@ -75,8 +75,8 @@ cmd_opkg_main() fi rand new_fname="/tmp/prokit.${rand_x}.opk" - cmd_opkg_opks="$(printf '%s %s\n' \ - "${cmd_opkg_opks}" \ + _cmd_opkg_opks="$(printf '%s %s\n' \ + "${_cmd_opkg_opks}" \ "${root}${new_fname}")" cp -- "${arg}" "${root}${new_fname}" set -- "${@}" "${new_fname}" -- cgit v0.9.1