-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdacopy
executable file
·51 lines (43 loc) · 1.3 KB
/
dacopy
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
#!/bin/sh
# Usage: dacopy NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE
# Copy the source package from the old suffix to the new suffix, where
# a suffix is probably one of "", "-proposed", or "-development"
#
# This copies any source or binary package built from the source
# package PACKAGE
: ${DA_SCRIPTS_DIR="$(dirname "$0")"}
. "$DA_SCRIPTS_DIR"/debian-versions.sh
if [ "$#" -lt 3 ]; then
echo "Usage: dacopy NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE" >&2
exit 1
fi
if [ "$1" = "-bleeding" ] || [ "$2" = "-bleeding" ]; then
echo "You're not supposed to move or copy things to or from -bleeding."
if [ "${DA_SHOOT_SELF_IN_FOOT:-x}" != "yesplease" ]; then
echo "Exiting..."
exit 1
fi
echo -n "This is a terrible idea. Type 'y' to continue anyway: "
read answer
if [ "$answer" != "y" ]; then
echo "You have chosen wisely."
exit 1
fi
fi
case "${1}/${2}" in
/-proposed) ;;
/-development) ;;
-proposed/-development) ;;
*)
echo "WAIT. You are about to copy $3"
echo " FROM debathena$2 TO debathena$1,"
echo -n "which is probably backwards. Is that a good idea [yes/N]? "
read yn
if [ "$yn" != "yes" ]; then
echo "that's what I thought. Exiting."
exit 1
fi ;;
esac
for code in $DEBIAN_CODES; do
dareprepro copysrc "${code}${1}" "${code}${2}" "$3"
done