mirror of
https://github.com/weewx/weewx.git
synced 2026-04-20 17:46:58 -04:00
provide feedback if pre-compile fails
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
weewx (5.0.0rc3-4) unstable; urgency=low
|
||||
* fix for pre-compile fails
|
||||
-- Matthew Wall (weewx) <mwall@users.sourceforge.net> Wed, 10 Jan 2024 23:57:51 -0500
|
||||
weewx (5.0.0rc3-3) unstable; urgency=low
|
||||
* added output to postinst to aid failure diagnostics
|
||||
-- Matthew Wall (weewx) <mwall@users.sourceforge.net> Wed, 10 Jan 2024 20:24:04 -0500
|
||||
|
||||
@@ -231,6 +231,15 @@ merge_weewxconf() {
|
||||
fi
|
||||
}
|
||||
|
||||
# precompile the bytecode
|
||||
precompile() {
|
||||
rc=$(python3 -m compileall -q -x 'user' /usr/share/weewx)
|
||||
if [ "$rc" != "" ]; then
|
||||
echo "Pre-compile failed!"
|
||||
echo "$rc"
|
||||
fi
|
||||
}
|
||||
|
||||
# get the version number from the specified file, without the debian revisions
|
||||
get_conf_version() {
|
||||
v=$(grep '^version.*=' $1 | sed -e 's/\s*version\s*=\s*//' | sed -e 's/-.*//')
|
||||
@@ -425,12 +434,8 @@ case "$1" in
|
||||
setup_user_dir
|
||||
setup_database_dir
|
||||
setup_reporting_dir
|
||||
|
||||
# precompile the bytecode
|
||||
python3 -m compileall /usr/share/weewx > /dev/null
|
||||
|
||||
precompile
|
||||
set_permissions
|
||||
|
||||
enable_init $pid1
|
||||
start_weewx $pid1
|
||||
;;
|
||||
|
||||
@@ -148,7 +148,11 @@ fi
|
||||
|
||||
%post
|
||||
precompile() {
|
||||
%{python} -m compileall %{dst_code_dir} > /dev/null
|
||||
rc=$(%{python} -m compileall -q -x 'user' %{dst_code_dir})
|
||||
if [ "$rc" != "" ]; then
|
||||
echo "Pre-compile failed!"
|
||||
echo "$rc"
|
||||
fi
|
||||
}
|
||||
|
||||
# get the version number from the specified file, without the rpm revisions
|
||||
|
||||
Reference in New Issue
Block a user