-
Notifications
You must be signed in to change notification settings - Fork 6
/
series_downloaded
executable file
·65 lines (56 loc) · 1.67 KB
/
series_downloaded
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# SPDX-Identifier: gpl-2.0-or-later
# Copyright (C) 2019, Red Hat, Inc.
#
# Licensed under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. You may obtain a copy of the
# license at
#
# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
source $(dirname $0)/series_db_lib.sh
START="0"
while [ "$1" != "" ]; do
if [ "$1" == "--start" ]; then
START="1"
elif [ "$1" == "--clear" ]; then
START="2"
else
break
fi
shift
done
if [ "$1" != "" ]; then
pw_instance="$1"
shift
fi
if [ "$1" != "" ]; then
series_id="$1"
shift
fi
if [ "X$pw_instance" == "X" -o "X$series_id" == "X" ]; then
echo "ERROR: Patchwork instance and series ID are unset."
echo "Please invoke as: $0 [--start] pw_instance series_id"
exit 1
fi
echo "ID: $series_id"
if ! series_id_exists "$pw_instance" "$series_id"; then
echo "ERROR: not found on instance $pw_instance"
exit 1
fi
if [ "$START" == "1" ]; then
echo "STATUS: starting"
series_id_set_downloading "$pw_instance" "$series_id"
elif [ "$START" == "2" ]; then
echo "STATUS: clear"
series_id_clear_downloaded "$pw_instance" "$series_id"
else
echo "STATUS: downloaded"
series_id_set_downloaded "$pw_instance" "$series_id"
fi