-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublp2
executable file
·70 lines (66 loc) · 1.39 KB
/
publp2
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
66
67
68
69
70
#optional 1 dist 2 version
#name=`cat debian/changelog | head -1 | grep -o ^[^\ ]*`
name=( `cat debian/control | grep "^Package" | grep -o [^\ ]*$ | xargs` )
if [ -z "${1}" ]; then
dist=`cat debian/changelog | head -1 | grep -Poe "[^ ]*(?=;)"`
else
dist=${1}
fi
if [ -z "${2}" ]; then
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
else
version=${2}
fi
if [ -z "${ppa}" ]; then
ppa=ppa
else
ppa=${ppa}
fi
echo ${dist} ${version} ${ppa}
i=1
for n in "${name[@]}"; do
echo ${n}
source ~/test/publparh
for var in "${arh[@]}"
do
echo ${var}
counter=0
AGAINST=
while true
do
sleep 1 #if there is a Published loop
OUTPUT=`python3 ~/test/lp.py ${ppa} ${dist} ${var} ${name} ${version} x | head -1`
if [ "${OUTPUT}" != "${AGAINST}" ]; then
counter=0
AGAINST=${OUTPUT}
fi
counter=$((counter+1))
echo ${counter} ${OUTPUT}
if [ -n "${no_wait}" ]; then break; fi
if [ "${OUTPUT}" = 'Published' ]; then
if [ -e ~/stopwaitingflag ]; then
rm ~/stopwaitingflag
fi
break
elif [ -e ~/stopwaitingflag ]; then
rm ~/stopwaitingflag
echo stopped
notify-send "stopped"
exit 1
fi
nr=$((counter/10))
while :; do
sleep 100
if [ ${nr} -eq 0 ]; then break; fi
nr=$((nr-1))
echo ${nr}
done
done
done
if [ -n "${terminator}" ]; then
if [ ${terminator} -eq ${i} ]; then
break
fi
fi
i=$((i+1))
done