-
Notifications
You must be signed in to change notification settings - Fork 5
/
2-update-info
executable file
·74 lines (60 loc) · 2.29 KB
/
2-update-info
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
71
72
73
74
#!/bin/bash
# Update information on UW's AFS
. release-common.sh
check_for_osg_koji
release_tools="list-package-updates"
for i in $release_tools;
do
check_for_and_add_command $i
if [[ $? -ne 0 ]];
then
echo "Release tool ($i) not present in PATH"
exit 1
fi
done
detect_rescue_file
if [[ ! -d /p/vdt/public/html/release-info/ && $DRY_RUN -eq 0 ]]; then
print_header "Not on UW's AFS..."
print_header "Enter username and machine name to use for scp (e.g. [email protected]):"
read rusermachine
else
# Make sure we have an AFS tokens
if ! tokens | grep -q Expires; then
echo No AFS token
exit 1
fi
fi
for branch in ${versions[@]}; do
read -ra dvers <<< $(osg_dvers $branch) # create array of dvers
for dver in ${dvers[@]}; do
release_repo=osg-$branch-$dver-release
print_header "Generating release notes for $release_repo"
if [ $DATA -ne 0 ]; then
data_rel=-$DATA # for writing data-specific release notes
data_option="--since " # option for list-package-updates for data releases
fi
pkg_prefix=$(ver_tag $branch)$data_rel
if [ -s move-to-$branch-release-$dver ]; then
# Update info
run_cmd "cp move-to-$branch-release-$dver $pkg_prefix-updated-$branch-$dver.txt"
run_cmd "osg-koji list-tagged --quiet --latest $release_repo | awk '{print \$1}' > $pkg_prefix-packages-$branch-$dver.txt"
run_cmd "xargs --arg-file $pkg_prefix-packages-$branch-$dver.txt osg-koji buildinfo | fgrep \"/mnt\" | xargs -n 1 basename | sort > $pkg_prefix-rpms-$branch$data_rel-$dver.txt"
echo
fi
done
done
# Copy release info files over to AFS
release_files=`awk '/\.txt$/ {printf "%s ", $NF}' $rescue_file`
print_header "Copying files over to UW's AFS"
if [ -d /p/vdt/public/html/release-info/ ]; then
run_cmd "cp $release_files /p/vdt/public/html/release-info/"
else
# run_cmd does not play nice with commands requiring user input. we don't
# need to keep track anyway since this is the last command
rsync -avz $release_files $rusermachine:/p/vdt/public/html/release-info/
fi
check_file_transfer_rc $?
# Don't remove rescue files if user is troubleshooting
if [ $DRY_RUN -eq 0 ]; then
cleanup_on_success
fi