Compare commits

..

3 Commits

Author SHA1 Message Date
James Valleroy
32fd5048c1
debian: Print warning if version mismatch
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-07-27 09:01:58 -07:00
Sunil Mohan Adapa
370e3320b5
doc: Update man page with option --version
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-07-27 09:00:26 -07:00
James Valleroy
2200a83579
plinth: Add --version flag to print version and exit
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Drop string "version" from the output]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-07-27 08:59:50 -07:00
3 changed files with 23 additions and 0 deletions

9
debian/rules vendored
View File

@ -1,5 +1,7 @@
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
export DH_VERBOSE=1
export PYBUILD_DESTDIR=debian/tmp
export PYBUILD_SYSTEM=custom
@ -9,6 +11,8 @@ export PYBUILD_INSTALL_ARGS=make PYTHON={interpreter} DESTDIR={destdir} install
export PYBUILD_CLEAN_ARGS=make clean
export PYBUILD_TEST_ARGS=make PYTHON={interpreter} check-tests
FBX_VERSION := $(shell ./run --develop --version | awk 'NF{ print $$NF }')
%:
dh $@ --with python3 --buildsystem=pybuild
@ -19,6 +23,11 @@ override_dh_auto_install-indep:
# Ensure the list of dependencies is not empty.
test -s debian/freedombox.substvars || exit 1
# Check that FreedomBox version number is matching.
ifneq ($(FBX_VERSION),$(DEB_VERSION))
>&2 echo "WARNING: FreedomBox version $(FBX_VERSION) does not match package version $(DEB_VERSION)."
endif
override_dh_installsystemd:
# Do not enable or start any service other than FreedomBox service. Use
# of --tmpdir is a hack to workaround an issue with dh_installsystemd

View File

@ -152,6 +152,14 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--version</option></term>
<listitem>
<para>
Show the version of FreedomBox and exit.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -39,6 +39,8 @@ def parse_arguments():
help='list package dependencies for essential modules')
parser.add_argument('--list-apps', default=False, nargs='*',
help='list apps')
parser.add_argument('--version', action='store_true', default=None,
help='show version and exit')
return parser.parse_args()
@ -125,6 +127,10 @@ def main():
adapt_config(arguments)
if arguments.version:
print(f'FreedomBox {__version__}')
sys.exit(0)
if arguments.list_dependencies is not False:
log.default_level = 'ERROR'
module_loader.load_modules()