-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathdo_release.sh
More file actions
executable file
·137 lines (105 loc) · 3.59 KB
/
do_release.sh
File metadata and controls
executable file
·137 lines (105 loc) · 3.59 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
#!/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 PortMaster/\*_flag \
-x '*.DS_Store'
if [[ "$1" == "stable" ]] || [ "$MAKE_INSTALL" = "Y" ]; then
echo "Creating Installers"
for arch in "aarch64" "x86_64"; do
export RUNTIME_ARCH="$arch"
if [ ! -f "runtimes.${RUNTIME_ARCH}.zip" ]; then
echo "Downloading Runtimes for $RUNTIME_ARCH."
tools/download_runtimes.sh
rm -fRv runtimes
fi
done
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
for arch in "aarch64" "x86_64"; do
export RUNTIME_ARCH="$arch"
if [ "$RUNTIME_ARCH" = "aarch64" ]; then
SCRIPT_NAME=""
else
SCRIPT_NAME=".${RUNTIME_ARCH}"
fi
cd pm_release
cp "../runtimes.${RUNTIME_ARCH}.zip" runtimes.zip
cd ..
makeself-2.5.0/makeself.sh --header "tools/makeself-header.sh" pm_release "Install.Full${SCRIPT_NAME}.PortMaster.sh" "PortMaster Full Installer" ./installer.sh
done
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,}