From 6b03824781b7fe4d44e1243897386aa35a77aea2 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 23 Jun 2020 20:42:29 -0400 Subject: cmd/add-feed: New command --- (limited to 'src/cmd') diff --git a/src/cmd/add-feed.sh b/src/cmd/add-feed.sh new file mode 100644 index 0000000..bb9c80f --- /dev/null +++ b/src/cmd/add-feed.sh @@ -0,0 +1,65 @@ +# pro-archman +# src/cmd/add-feed.sh +# "add-feed" command +# +# Copyright (C) 2020 Patrick McDermott +# +# This file is part of the ProteanOS Archive Manager. +# +# The ProteanOS Archive Manager 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. +# +# The ProteanOS Archive Manager 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 the ProteanOS Archive Manager. If not, see +# . + +cmd_add_feed_main() +{ + local feed= + local chan= + local dist= + local arch= + local plat= + local sect= + + init + + for feed in "${@}"; do + case "${feed}" in + */*/*/*/*/*) + error 2 "$(get_msg 'cmd_add_feed_invalid')" \ + "${feed}" + ;; + */*/*/*/*) + ;; + *) + error 2 "$(get_msg 'cmd_add_feed_invalid')" \ + "${feed}" + ;; + esac + done + + for feed in "${@}"; do + IFS='/' read chan dist arch plat sect <<-EOF + ${feed} + EOF + feed_create "${chan}" "${dist}" "${arch}" "${plat}" "${sect}" + done + + fini + + return 0 +} + +cmd_add_feed_register() +{ + register_cmd 'add-feed' +} +__init cmd_add_feed_register diff --git a/src/cmd/local.mk b/src/cmd/local.mk index 860c117..d7263f5 100644 --- a/src/cmd/local.mk +++ b/src/cmd/local.mk @@ -6,4 +6,5 @@ pro_archman_SOURCES += \ %reldir%/remove.sh \ %reldir%/copy-suite.sh \ %reldir%/remove-suite.sh \ - %reldir%/sign.sh + %reldir%/sign.sh \ + %reldir%/add-feed.sh -- cgit v0.9.1