From 894b6022c497449d62642d65a3333333f005ace2 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 22 Jul 2017 13:26:57 -0400 Subject: `git mv lib/cmd/ src/` --- (limited to 'src') diff --git a/src/cmd/copy-suite.sh b/src/cmd/copy-suite.sh new file mode 100644 index 0000000..987fb45 --- /dev/null +++ b/src/cmd/copy-suite.sh @@ -0,0 +1,49 @@ +# pro-archman +# lib/cmd/copy-suite.sh +# "copy-suite" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use suite + +cmd_copy_suite_main() +{ + local src_suite="${1}" + local dst_suite="${2}" + local src_chan= + local src_dist= + local dst_chan= + local dst_dist= + + init + + src_chan="${src_suite%/*}" + src_dist="${src_suite##*/}" + if [ "x${src_chan}" = "x${src_suite}" ]; then + src_chan="${conf_incoming_channel}" + fi + dst_chan="${dst_suite%/*}" + dst_dist="${dst_suite##*/}" + if [ "x${dst_chan}" = "x${dst_suite}" ]; then + dst_chan="${conf_incoming_channel}" + fi + + copy_suite "${src_chan}" "${src_dist}" "${dst_chan}" "${dst_dist}" + + fini + + return 0 +} diff --git a/src/cmd/help.sh b/src/cmd/help.sh new file mode 100644 index 0000000..8b4cd58 --- /dev/null +++ b/src/cmd/help.sh @@ -0,0 +1,40 @@ +# pro-archman +# lib/cmd/help.sh +# "help" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +cmd_help_main() +{ + local cmd= + + if [ ${#} -eq 1 ]; then + cmd="${1}" + if is_cmd "${cmd}"; then + print_cmd_usage "${cmd}" + return 0 + fi + fi + + printf "$(get_msg 'cmd_help_head')\n\n" "${0}" + + printf "$(get_msg 'cmd_help_opts_head')\n" + print_opt_summaries + printf '\n' + + printf "$(get_msg 'cmd_help_summary_head')\n" + print_cmd_summaries +} diff --git a/src/cmd/include.sh b/src/cmd/include.sh new file mode 100644 index 0000000..4d279af --- /dev/null +++ b/src/cmd/include.sh @@ -0,0 +1,35 @@ +# pro-archman +# lib/cmd/include.sh +# "include" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use include + +cmd_include_main() +{ + local changes= + + init + + for changes in "${@}"; do + include_changes "${changes}" >/dev/null + done + + fini + + return 0 +} diff --git a/src/cmd/local.mk b/src/cmd/local.mk new file mode 100644 index 0000000..2c32d5b --- /dev/null +++ b/src/cmd/local.mk @@ -0,0 +1,8 @@ +pkgdatacmd_sources = \ + %reldir%/help.sh \ + %reldir%/version.sh \ + %reldir%/include.sh \ + %reldir%/process-incoming.sh \ + %reldir%/remove.sh \ + %reldir%/copy-suite.sh \ + %reldir%/remove-suite.sh diff --git a/src/cmd/process-incoming.sh b/src/cmd/process-incoming.sh new file mode 100644 index 0000000..1eb52ae --- /dev/null +++ b/src/cmd/process-incoming.sh @@ -0,0 +1,49 @@ +# pro-archman +# lib/cmd/generate-index.sh +# "generate-index" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use locale +use output +use include + +cmd_process_incoming_main() +{ + local changes= + local file= + + init + + info "$(get_msg 'cmd_process_incoming_processing')" + + for changes in "${conf_incoming_dir}/"*.changes; do + if [ ! -f "${changes}" ]; then + continue + fi + for file in $(include_changes "${changes}"); do + if [ ! -f "${file}" ]; then + continue + fi + rm -f "${file}" + done + rm -f "${changes}" + done + + fini + + return 0 +} diff --git a/src/cmd/remove-suite.sh b/src/cmd/remove-suite.sh new file mode 100644 index 0000000..5fc24ae --- /dev/null +++ b/src/cmd/remove-suite.sh @@ -0,0 +1,41 @@ +# pro-archman +# lib/cmd/remove-suite.sh +# "remove-suite" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use suite + +cmd_remove_suite_main() +{ + local suite="${1}" + local chan= + local dist= + + init + + chan="${suite%/*}" + dist="${suite##*/}" + if [ "x${chan}" = "x${suite}" ]; then + chan="${conf_incoming_channel}" + fi + + remove_suite "${chan}" "${dist}" + + fini + + return 0 +} diff --git a/src/cmd/remove.sh b/src/cmd/remove.sh new file mode 100644 index 0000000..30dffa6 --- /dev/null +++ b/src/cmd/remove.sh @@ -0,0 +1,42 @@ +# pro-archman +# lib/cmd/remove.sh +# "remove" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use remove + +cmd_remove_main() +{ + local suite="${1}" + local source="${2}" + local chan= + local dist= + + init + + chan="${suite%/*}" + dist="${suite##*/}" + if [ "x${chan}" = "x${suite}" ]; then + chan="${conf_incoming_channel}" + fi + + remove_source_from_suite "${chan}" "${dist}" "${source}" + + fini + + return 0 +} diff --git a/src/cmd/version.sh b/src/cmd/version.sh new file mode 100644 index 0000000..e89ccc8 --- /dev/null +++ b/src/cmd/version.sh @@ -0,0 +1,26 @@ +# pro-archman +# lib/cmd/version.sh +# "version" command +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +cmd_version_main() +{ + printf '%s %s\n' "${PACKAGE}" "${PACKAGE_VERSION}" + + printf "$(get_msg 'cmd_version_copyright')\n" \ + '2013' 'Patrick "P. J." McDermott' +} -- cgit v0.9.1