summaryrefslogtreecommitdiffstats
path: root/bin/pupload.sh
blob: f0b872c175888a89ee18a1a996a979d94c138a18 (plain)
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
#!/bin/sh

set -e

case "$(basename ${0})" in
	p*)
		MODE="progress-linux"
		;;

	b*)
		MODE="bfh"
		;;
esac

if [ -z "${@}" ]
then
	echo "Usage: ${0} PACKAGE|\"PACKAGES\""
	exit 1
fi

if [ -n "${QUIET}" ]
then
	QUIET="--quiet"
fi

PACKAGES="$(echo ${@} | sed -e 's|/||g')"

for PACKAGE in ${PACKAGES}
do
	cd "${PACKAGE}"

	for ARCHITECTURE in source amd64 i386 arm64 armel armhf all
	do
		if [ -e "current_${ARCHITECTURE}" ]
		then
			cd "current_${ARCHITECTURE}"

			case "${MODE}" in
				progress-linux)
					padd.sh ${QUIET}
					;;

				bfh)
					badd.sh ${QUIET}
					;;
			esac

			cd ..
		fi
	done

	cd ..
done