-
Notifications
You must be signed in to change notification settings - Fork 0
/
cspp-sounder-ql_packaging.sh
79 lines (66 loc) · 1.82 KB
/
cspp-sounder-ql_packaging.sh
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
75
76
77
78
79
#!/bin/bash
#
# Creates the CSPP Sounder Quicklook Package tarballs
#
# Usage:
#
# cspp-sounder-ql_packaging.sh <pkg_tree_dir> <version> <tarball_dir>
#
# where:
#
# pkg_tree_dir : Directory containing the package tree
# version : The desired package number
# tarball_dir : The desired directory to copy the tarballs to
#
# Copyright 2020, University of Wisconsin Regents.
# Licensed under the GNU GPLv3.
set -e
pkg_dir=$1
version=$2
tarball_location=$3
echo $pkg_dir
echo $version
echo $tarball_location
cur_dir=$PWD
echo "Current dir: "$cur_dir
pkg_dir_link=$pkg_dir-$version
echo "package dir link: "$pkg_dir_link
if [ -h $pkg_dir_link ];
then
echo "link "$pkg_dir_link" exists!";
else
echo "Creating link "$pkg_dir_link
ln -s $pkg_dir $pkg_dir_link
fi
echo "Creating the package tarball (sans ShellB3)"
rm -f cspp-sounder-ql-$version.tar*
tar cvhf \
cspp-sounder-ql-$version.tar \
--exclude=__pycache__ \
--exclude=*.pyc \
--exclude=.git* \
--exclude=oldstuff \
--exclude=ShellB3 \
--exclude=env \
--exclude=tag_version.sh \
--exclude=dummy_file \
--exclude=.vim \
$pkg_dir_link
echo "Including ShellB3 into cspp-sounder-ql-"$version".tar"
tar rf cspp-sounder-ql-$version.tar $pkg_dir_link/vendor/ShellB3
echo "Zipping cspp-sounder-ql-"$version".tar"
gzip cspp-sounder-ql-$version.tar
echo "Creating checksum cspp-sounder-ql-"$version".tar.gz.sha1"
sha1sum cspp-sounder-ql-$version.tar.gz >> cspp-sounder-ql-$version.tar.gz.sha1
tarball_dir=$tarball_location/cspp-sounder-ql-$version
if [ -d $tarball_dir ];
then
echo "Tarball directory "$tarball_dir" exists!";
else
echo "Creating tarball dir "$tarball_dir
mkdir $tarball_dir
fi
echo "Moving cspp-sounder-ql-"$version".tar.gz to "$tarball_dir
mv -f cspp-sounder-ql-$version.tar.gz* $tarball_dir
echo "Exiting..."
exit 0