summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-11 18:15:41 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-11 18:15:41 (EDT)
commitf79dea0f5e1b89488d73bfb0360e651b8d578e15 (patch)
tree682bacab015acd1175f57b7bcbc8b65e4cb02ba5 /src
parentd19eb991c6cf206dba7a9ecc0732c4ab5e7b4f85 (diff)
Consistently shift function arguments
Diffstat (limited to 'src')
-rw-r--r--src/cmd.sh4
-rw-r--r--src/cmd/copy-suite.sh1
-rw-r--r--src/cmd/help.sh1
-rw-r--r--src/cmd/remove-suite.sh1
-rw-r--r--src/cmd/remove.sh1
-rw-r--r--src/control.sh5
-rw-r--r--src/db.sh15
-rw-r--r--src/dir.sh3
-rw-r--r--src/garbage.sh1
-rw-r--r--src/include.sh2
-rw-r--r--src/index.sh2
-rw-r--r--src/locale.sh2
-rw-r--r--src/main.sh3
-rw-r--r--src/remove.sh2
-rw-r--r--src/suite.sh4
15 files changed, 41 insertions, 6 deletions
diff --git a/src/cmd.sh b/src/cmd.sh
index 2f13fb7..e7af8e3 100644
--- a/src/cmd.sh
+++ b/src/cmd.sh
@@ -89,6 +89,7 @@ print_cmd_summaries()
print_cmd_usage()
{
local cmd="${1}"
+ shift 1
local cmd_clean=
local usage=
@@ -103,6 +104,7 @@ print_cmd_usage()
is_cmd()
{
local cmd="${1}"
+ shift 1
case "${cmds}" in *" ${cmd} "*) return 0;; esac
return 1
@@ -111,8 +113,8 @@ is_cmd()
run_cmd()
{
local cmd="${1}"
+ shift 1
local cmd_clean=
- shift
cmd_clean="$(printf '%s' "${cmd}" | \
tr '[A-Z]' '[a-z]' | tr -C '[a-z0-9_]' '_')"
diff --git a/src/cmd/copy-suite.sh b/src/cmd/copy-suite.sh
index 2e4f3be..4ea66e5 100644
--- a/src/cmd/copy-suite.sh
+++ b/src/cmd/copy-suite.sh
@@ -24,6 +24,7 @@ cmd_copy_suite_main()
{
local src_suite="${1}"
local dst_suite="${2}"
+ shift 2
local src_chan=
local src_dist=
local dst_chan=
diff --git a/src/cmd/help.sh b/src/cmd/help.sh
index 7a940c4..a322fca 100644
--- a/src/cmd/help.sh
+++ b/src/cmd/help.sh
@@ -26,6 +26,7 @@ cmd_help_main()
if [ ${#} -eq 1 ]; then
cmd="${1}"
+ shift 1
if is_cmd "${cmd}"; then
print_cmd_usage "${cmd}"
return 0
diff --git a/src/cmd/remove-suite.sh b/src/cmd/remove-suite.sh
index 35bae16..9c709ba 100644
--- a/src/cmd/remove-suite.sh
+++ b/src/cmd/remove-suite.sh
@@ -23,6 +23,7 @@
cmd_remove_suite_main()
{
local suite="${1}"
+ shift 1
local chan=
local dist=
diff --git a/src/cmd/remove.sh b/src/cmd/remove.sh
index 64394c0..643aa10 100644
--- a/src/cmd/remove.sh
+++ b/src/cmd/remove.sh
@@ -24,6 +24,7 @@ cmd_remove_main()
{
local suite="${1}"
local source="${2}"
+ shift 2
local chan=
local dist=
diff --git a/src/control.sh b/src/control.sh
index 61f49a2..f7c4bcf 100644
--- a/src/control.sh
+++ b/src/control.sh
@@ -25,16 +25,17 @@ control_line_nr=
parse_control()
{
+ control_file="${1}"
local field_cb="${2}"
local req_fields="${3}"
local opt_fields="${4}"
+ shift 4
local all_fields=
local got_fields=
local line=
local name=
local value=
- control_file="${1}"
control_line_nr=0
req_fields="$(printf '%s\n' ${req_fields})"
@@ -117,8 +118,8 @@ parse_control()
parse_control_error()
{
local msgid="${1}"
- local file_info=
shift 1
+ local file_info=
if [ ${control_line_nr} -eq 0 ]; then
file_info="$(printf '%20s:' "${control_file}")"
diff --git a/src/db.sh b/src/db.sh
index 01bf437..703dca0 100644
--- a/src/db.sh
+++ b/src/db.sh
@@ -29,6 +29,7 @@ db_get_srcver()
local chan="${1}"
local dist="${2}"
local source="${3}"
+ shift 3
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -46,6 +47,7 @@ db_set_srcver()
local dist="${2}"
local source="${3}"
local srcver="${4}"
+ shift 4
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -61,6 +63,7 @@ db_del_srcver()
local chan="${1}"
local dist="${2}"
local source="${3}"
+ shift 3
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -83,6 +86,7 @@ db_get_binver()
local arch="${3}"
local plat="${4}"
local source="${5}"
+ shift 5
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -102,6 +106,7 @@ db_set_binver()
local plat="${4}"
local source="${5}"
local binver="${6}"
+ shift 6
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -119,6 +124,7 @@ db_del_binver()
local arch="${3}"
local plat="${4}"
local source="${5}"
+ shift 5
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -135,9 +141,8 @@ db_foreach_source()
local chan="${1}"
local dist="${2}"
local cb="${3}"
- local dir=
-
shift 3
+ local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
# For each hash:
@@ -164,6 +169,7 @@ db_get_archplats()
local chan="${1}"
local dist="${2}"
local source="${3}"
+ shift 3
local dir=
dir="${base_dir}/feeds/${chan}/${dist}/.db"
@@ -190,6 +196,7 @@ db_get_packages()
local plat="${2}"
local source="${3}"
local binver="${4}"
+ shift 4
local dir=
dir="${base_dir}/pool/$(hash_name "${source}")/${source}/.db"
@@ -210,6 +217,7 @@ db_add_package()
local size="${5}"
local sect="${6}"
local pkg="${7}"
+ shift 7
local dir=
dir="${base_dir}/pool/$(hash_name "${source}")/${source}/.db"
@@ -226,6 +234,7 @@ db_del_packages()
local plat="${2}"
local source="${3}"
local binver="${4}"
+ shift 4
local dir=
dir="${base_dir}/pool/$(hash_name "${source}")/${source}/.db"
@@ -245,6 +254,7 @@ db_inc_references()
local plat="${2}"
local source="${3}"
local binver="${4}"
+ shift 4
local dir=
local refs=
@@ -269,6 +279,7 @@ db_dec_references()
local plat="${2}"
local source="${3}"
local binver="${4}"
+ shift 4
local dir=
local refs=
diff --git a/src/dir.sh b/src/dir.sh
index bd0cb95..90a41a7 100644
--- a/src/dir.sh
+++ b/src/dir.sh
@@ -23,6 +23,7 @@
hash_name()
{
local name="${1}"
+ shift 1
local hash=
if [ "x${name}" != "x${name#lib?}" ]; then
@@ -40,6 +41,7 @@ hash_name()
dir_is_empty()
{
local dir="${1}"
+ shift 1
local ret=
local dirent=
@@ -64,6 +66,7 @@ dir_is_empty()
try_rmdir()
{
local dir="${1}"
+ shift 1
if ! dir_is_empty "${dir}"; then
return 1
diff --git a/src/garbage.sh b/src/garbage.sh
index b481ca4..2975b7a 100644
--- a/src/garbage.sh
+++ b/src/garbage.sh
@@ -76,6 +76,7 @@ collect_garbage()
mark_pool_garbage()
{
local file="${1}"
+ shift 1
local time=
info_v "$(get_msg 'marking_garbage_file')" "${file}"
diff --git a/src/include.sh b/src/include.sh
index 585f57c..b45b584 100644
--- a/src/include.sh
+++ b/src/include.sh
@@ -32,6 +32,7 @@ _include_files=
include_changes()
{
local changes="${1}"
+ shift 1
local chan=
local dist=
local source=
@@ -155,6 +156,7 @@ _include_changes_field()
{
local name="${1}"
local value="${2}"
+ shift 2
case "${name}" in
'Format')
diff --git a/src/index.sh b/src/index.sh
index bd27f79..6246f85 100644
--- a/src/index.sh
+++ b/src/index.sh
@@ -49,6 +49,7 @@ feed_add_package()
local pkg="${6}"
local size="${7}"
local file="${8}"
+ shift 8
local pkg_hash=
local feed_hash_idx=
local old_dir=
@@ -88,6 +89,7 @@ feed_remove_package()
local plat="${4}"
local sect="${5}"
local pkg="${6}"
+ shift 6
local pkg_hash=
local feed_hash_idx=
local old_dir=
diff --git a/src/locale.sh b/src/locale.sh
index 2e2b4ae..1437bb8 100644
--- a/src/locale.sh
+++ b/src/locale.sh
@@ -62,6 +62,7 @@ load_locale()
get_msg()
{
local msgid="${1}"
+ shift 1
eval "printf '%s' \"\${msg_${TEXTDOMAIN}_${msgid}}\""
@@ -72,6 +73,7 @@ _try_load_locale()
{
local localedir="${1}"
local locale="${2}"
+ shift 2
local ms=
for ms in "${localedir}/${locale}/LC_MESSAGES/${TEXTDOMAIN}.ms" \
diff --git a/src/main.sh b/src/main.sh
index f804243..ee45e0f 100644
--- a/src/main.sh
+++ b/src/main.sh
@@ -71,7 +71,7 @@ main()
exit 1
else
cmd="${1}"
- shift
+ shift 1
fi
run_cmd "${cmd}" "${@}"
@@ -176,6 +176,7 @@ unlock()
handle_sig()
{
local sig="${1}"
+ shift 1
unlock
diff --git a/src/remove.sh b/src/remove.sh
index 6669f16..a2d06a6 100644
--- a/src/remove.sh
+++ b/src/remove.sh
@@ -25,6 +25,7 @@ remove_source_from_suite()
local chan="${1}"
local dist="${2}"
local source="${3}"
+ shift 3
local arch=
local plat=
@@ -50,6 +51,7 @@ remove_packages_from_suite_archplat()
local arch="${3}"
local plat="${4}"
local source="${5}"
+ shift 5
local binver=
local refs=
local size=
diff --git a/src/suite.sh b/src/suite.sh
index 04c0285..f38c9ca 100644
--- a/src/suite.sh
+++ b/src/suite.sh
@@ -26,6 +26,7 @@ copy_suite()
local src_dist="${2}"
local dst_chan="${3}"
local dst_dist="${4}"
+ shift 4
info "$(get_msg 'suite_copying')" \
"${src_chan}" "${src_dist}" "${dst_chan}" "${dst_dist}"
@@ -40,6 +41,7 @@ remove_suite()
{
local chan="${1}"
local dist="${2}"
+ shift 2
info "$(get_msg 'suite_removing')" \
"${chan}" "${dist}"
@@ -54,6 +56,7 @@ _suite_copy_source()
local source="${3}"
local dst_chan="${4}"
local dst_dist="${5}"
+ shift 5
local srcver=
local arch=
local plat=
@@ -94,6 +97,7 @@ _suite_remove_source()
local chan="${1}"
local dist="${2}"
local source="${3}"
+ shift 3
remove_source_from_suite "${chan}" "${dist}" "${source}"
}