-
Notifications
You must be signed in to change notification settings - Fork 16
/
needs_release.sh
executable file
·51 lines (45 loc) · 1.29 KB
/
needs_release.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
#!/bin/bash
TOOLS=$(dirname "$0")
BUILD_DIR=repo
echo "Cleaning up *.pyc files.."
find . -name '*.pyc' | xargs rm -f
if [ -z $1 ];
then
addons=$(ls -l | grep "^d" | gawk -F' ' '{print $8}')
else
addons=$1
fi
for addonFile in $addons ; do
dirname=$addonFile
if [ ! -f $addonFile/addon.xml ] ; then
#echo "$addonFile/addon.xml does not exist, skipping"
continue
fi
addon_id=$("$TOOLS/get_addon_attribute" "$addonFile/addon.xml" "id")
addon_version=$("$TOOLS/get_addon_attribute" "$addonFile/addon.xml" "version")
if [ -z "$addon_id" ] ; then
echo "Addon id not found!" >&2
exit 1
fi
if [ -z "$addon_version" ] ; then
echo "Addon id not found!" >&2
exit 2
fi
# generate current hash and check for saved values
md5=`echo $(find $addon_id -type f | xargs md5sum | md5sum | tr -d -)`
if [ ! -f hashes/$addon_id ];then
"$addon_id was never released!"
continue
fi
need=$(grep -c $md5 hashes/$addon_id)
if [ "$need" == "0" ]; then
echo "Addon $addon_id"
echo " needs release $needs"
target_dir="$BUILD_DIR/$addon_id"
package="$target_dir/$addon_id-$addon_version.zip"
if [ -e "$package" ] ; then
echo " needs version bump from $addon_version"
fi
fi
continue
done