lib/pycriu: generate version.py

The version of CRIU is specified in the Makefile.versions file.
This patch generates '__varion__' value for the pycriu module.
This value can be used by crit to implement `--version`.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-04-25 16:20:41 +01:00 committed by Andrei Vagin
parent 59fcfa80d8
commit 8adefc90d2
3 changed files with 7 additions and 2 deletions

1
lib/py/.gitignore vendored
View file

@ -1,2 +1,3 @@
*_pb2.py
*.pyc
version.py

View file

@ -1,4 +1,4 @@
all-y += libpy-images rpc_pb2.py
all-y += libpy-images rpc_pb2.py version.py
$(obj)/images/Makefile: ;
$(obj)/images/%: .FORCE
@ -11,7 +11,10 @@ libpy-images:
rpc_pb2.py:
$(Q) protoc -I=images/ --python_out=$(obj) images/$(@:_pb2.py=.proto)
cleanup-y += $(addprefix $(obj)/,rpc_pb2.py *.pyc)
version.py:
$(Q) echo "__version__ = '${CRIU_VERSION}'" > $(obj)/$@
cleanup-y += $(addprefix $(obj)/,rpc_pb2.py *.pyc version.py)
clean-lib-py:
$(Q) $(MAKE) $(build)=$(obj)/images clean

View file

@ -1,3 +1,4 @@
from . import rpc_pb2 as rpc
from . import images
from .criu import *
from .version import __version__