forked from PortsMaster/PortMaster-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo_release.sh
More file actions
executable file
·145 lines (113 loc) · 3.89 KB
/
Copy pathdo_release.sh
File metadata and controls
executable file
·145 lines (113 loc) · 3.89 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
#
# SPDX-License-Identifier: MIT
#
# Directory where .pot file is located
POT_DIR="PortMaster/pylibs/locales"
POT_FILES=("messages" "themes")
cp PortMaster/pugwash{,.bak}
python3 tools/pm_release.py $*
awk -F"'" '/PORTMASTER_VERSION = / {print $2}' PortMaster/pugwash > PortMaster/version
cp PortMaster/version version
rm -vf PortMaster.zip
find . -iname '.DS_Store' -or -iname '._*' -delete -print
# for name in $(find . -iname '__pycache__');
# do
# rm -fRv "$name"
# done
for lang_dir in $POT_DIR/* ; do
LANG_CODE=$(basename "$lang_dir")
if [[ "${LANG_CODE}" != "." ]] && [[ "${LANG_CODE}" != ".." ]] && [ -d "$lang_dir" ]; then
# echo "${LANG_CODE}:"
for POT_FILE in "${POT_FILES[@]}"; do
LANG_POT_FILE="$lang_dir/LC_MESSAGES/${POT_FILE}.pot"
LANG_PO_FILE="$lang_dir/LC_MESSAGES/${POT_FILE}.po"
LANG_MO_FILE="$lang_dir/LC_MESSAGES/${POT_FILE}.mo"
if [ -f "$LANG_POT_FILE" ]; then
mv -fv "$LANG_POT_FILE" "$LANG_PO_FILE"
fi
# Compile .po file into .mo file
# printf "msgfmt: "
msgfmt -v -o "${LANG_MO_FILE}" "${LANG_PO_FILE}"
# echo ""
done
fi
done
echo "Creating pylibs.zip"
cd PortMaster
rm -f pylibs.zip
zip -9r pylibs.zip exlibs/ pylibs/ \
-x \*__pycache__\*/\* \
-x \*.DS_Store \
-x ._\* \
-x \*NotoSans\*.ttf
cd ..
echo "Creating PortMaster.zip"
zip -9r PortMaster.zip PortMaster/ \
-x PortMaster/pylibs/\* \
-x PortMaster/exlibs/\* \
-x PortMaster/config/\* \
-x PortMaster/themes/\* \
-x PortMaster/libs/\*.squashfs \
-x PortMaster/libs/\*.squashfs.md5 \
-x PortMaster/pugwash.bak \
-x PortMaster/log.txt \
-x PortMaster/pugwash.txt \
-x PortMaster/harbourmaster.txt \
-x '*.DS_Store'
if [[ "$1" == "stable" ]] || [ "$MAKE_INSTALL" = "Y" ]; then
echo "Creating Installers"
if [ ! -f "runtimes.zip" ]; then
echo "Downloading Runtimes"
# Download the runtimes
mkdir -p runtimes
cd runtimes
for runtime_url in $(curl -s https://api.github.com/repos/PortsMaster/PortMaster-Runtime/releases/latest | grep browser_download_url | cut -d '"' -f 4); do
if [[ "$runtime_url" =~ /zulu11.*$ ]]; then
continue
fi
wget "$runtime_url"
done
# Validate them
for check_file in *.md5; do
runtime_file="${check_file/.md5/}"
if [[ $(md5sum "${runtime_file}" | cut -d ' ' -f 1) != $(cat "${check_file}" | cut -d ' ' -f 1) ]]; then
cd ..
rm -fRv runtimes
echo "Failed to validate runtime ${runtime_file}"
exit 255
fi
done
zip -9 ../runtimes.zip *
cd ..
rm -fRv runtimes
fi
if [ ! -d "makeself-2.5.0" ]; then
echo "Downloading makeself"
wget "https://github.com/megastep/makeself/releases/download/release-2.5.0/makeself-2.5.0.run"
chmod +x makeself-2.5.0.run
./makeself-2.5.0.run
fi
echo "Building Release"
mkdir -p pm_release
cd pm_release
cp ../PortMaster.zip .
cp ../tools/installer.sh .
cd ..
# Remove old installers
rm -f Install*PortMaster.sh
makeself-2.5.0/makeself.sh --header "tools/makeself-header.sh" pm_release "Install.PortMaster.sh" "PortMaster Installer" ./installer.sh
if [ -z "$NO_FULL_INSTALL" ]; then
cd pm_release
cp ../runtimes.zip .
cd ..
makeself-2.5.0/makeself.sh --header "tools/makeself-header.sh" pm_release "Install.Full.PortMaster.sh" "PortMaster Full Installer" ./installer.sh
fi
rm -fRv pm_release
fi
if [[ ! -f "version.json" ]]; then
wget "https://github.com/PortsMaster/PortMaster-GUI/releases/latest/download/version.json"
fi
python3 tools/pm_version.py $*
# Restore this file
mv PortMaster/pugwash{.bak,}