3 # Compare release contents with golden list to ensure release correctness
6 echo 1>&2 "usage: $0 <SIPEAdiumPlugin zip file>"
10 # examine release archive
11 echo "Checking release archive '$1'..."
12 files
=$
(set -o pipefail
; unzip -l "$1" |
13 grep SIPEAdiumPlugin.AdiumLibpurplePlugin
/ |
14 awk '{ print $4, $1 }' |
16 if [[ $?
-ne 0 ]]; then
17 echo 1>&2 "ERROR: can't analyze release archive '$1'!"
21 # the following files *MUST* be in the release archive
22 declare -A golden_list
24 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Info.plist
]=1
25 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/MacOS
/SIPEAdiumPlugin
]=1
26 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Resources
/English.lproj
/DCPurpleSIPEJoinChatView.nib
]=1
27 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Resources
/English.lproj
/InfoPlist.
strings]=1
28 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Resources
/ESSIPEAccountView.nib
]=1
29 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Resources
/PurpleDefaultsSIPE.plist
]=1
30 [SIPEAdiumPlugin.AdiumLibpurplePlugin
/Contents
/Resources
/sipe.png
]=1
34 # compare against golden list
35 # @TODO: is there a better way to feed in file list?
36 while read file size
; do
37 if [[ -z "${golden_list[${file}]}" ]]; then
39 elif [[ "${size}" -eq 0 ]]; then
40 echo 1>&2 "ERROR: file '${file}' is empty!"
42 unset golden_list
[${file}]
50 if [[ -n "${new_files[@]}" ]]; then
51 echo 1>&2 "Release archive contains superfluous files:"
52 for file in "${new_files[@]}"; do
53 echo -e 1>&2 "\t${file}"
57 if [[ ${#golden_list[@]} -ne 0 ]]; then
58 echo 1>&2 "Release archive is missing the following files:"
59 for file in "${!golden_list[@]}"; do
60 echo -e 1>&2 "\t${file}"
64 if [[ $status -eq 0 ]]; then
65 echo "Release archive is OK!"
67 echo "Release archive is NOT OK!"