1 |
#!/bin/sh |
2 |
|
3 |
. /usr/share/mgatools/functions |
4 |
moveupdate_allowed_group=mga-qa |
5 |
|
6 |
dryrun=echo |
7 |
|
8 |
if ! isingroup "$allowed_group" |
9 |
then |
10 |
echo "You are not in group $allowed_group" |
11 |
exit 1 |
12 |
fi |
13 |
|
14 |
distrorelease="$1" |
15 |
section="$2" |
16 |
srcname="$3" |
17 |
if test -z $distrorelease || test -z $section || test -z $srcname |
18 |
then |
19 |
echo 'Missing argument' >&2 |
20 |
exit 1 |
21 |
fi |
22 |
|
23 |
for file in "$distribdir/$distrorelease/SRPMS/$section/updates_testing/"*.rpm |
24 |
do |
25 |
fname=$(rpm -qp --qf '%{NAME}' "$file") |
26 |
if [ a"$fname" = a"$srcname" ] |
27 |
then |
28 |
srcpkg=$(basename "$file") |
29 |
break |
30 |
fi |
31 |
done |
32 |
|
33 |
if [ -z $srcpkg ] |
34 |
then |
35 |
echo "The package $srcname could not be found in $distrorelease/$section/updates_testing repository." >&2 |
36 |
exit 2 |
37 |
fi |
38 |
|
39 |
function movepkg() |
40 |
{ |
41 |
srcdir="$1" |
42 |
destdir="$2" |
43 |
srcpkg="$3" |
44 |
output="$4" |
45 |
|
46 |
for file in "$srcdir/"*.rpm |
47 |
do |
48 |
fname=$(rpm -qp --qf '%{SOURCERPM}' "$file") |
49 |
if [ a"$fname" = a"$srcpkg" ] |
50 |
then |
51 |
$dryrun mv -v -f "$file" "$destdir" >> "$output" |
52 |
fi |
53 |
done |
54 |
} |
55 |
|
56 |
mailcontent=$(mktemp) |
57 |
for arch in $arches |
58 |
do |
59 |
movepkg "$distribdir/$distrorelease/$arch/media/$section/updates_testing" "$distribdir/$distrorelease/$arch/media/$section/updates/" "$srcpkg" "$mailcontent" |
60 |
movepkg "$distribdir/$distrorelease/$arch/media/debug/$section/updates_testing" "$distribdir/$distrorelease/$arch/media/debug/$section/updates/" "$srcpkg" "$mailcontent" |
61 |
done |
62 |
|
63 |
rm -f "$mailcontent" |
64 |
|