[CRIU] [PATCH] make: Add snapshot target

Andrey Vagin avagin at virtuozzo.com
Fri Oct 6 20:39:54 MSK 2017


On Thu, Oct 05, 2017 at 07:30:50PM +0300, Cyrill Gorcunov wrote:
> From: Cyrill Gorcunov <gorcunov at virtuozzo.com>
> 
> Sometimes for debug sake we need to build criu from source,
> and setting up git on the target machine is not an option,
> or due to network slow connection it takes too much time
> to upload the whole history. just pack current HEAD into
> a tarball.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
> ---
>  Makefile | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 796cad874da2..0a465473fc72 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -310,6 +310,14 @@ tar-name := $(shell echo $(head-name) | sed -e 's/^v//g')
>  dist tar: criu-$(tar-name).tar.bz2 ;
>  .PHONY: dist tar
>  
> +ifeq ($(filter-out snapshot,$(MAKECMDGOALS)),)
> +snapshot-prefix := $(shell git describe --always --long)
> +snapshot-file := criu-$(snapshot-prefix).tar.bz2
> +endif
> +snapshot:

snapshot usually has another meaning when we are talking about criu, I
vote to rename this target to "tarball ".

> +	git archive --format tar --prefix 'criu-$(snapshot-prefix)/' HEAD | bzip2 > $(snapshot-file)
> +.PHONY: snapshot
> +
>  TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -path './test/zdtm/lib/*' \)
>  tags:
>  	$(call msg-gen, $@)
> @@ -356,6 +364,7 @@ TAGS_FILES_REGEXP := . -name '*.[hcS]' ! -path './.*' \( ! -path './test/*' -o -
>  	@echo '      install         - Install CRIU (see INSTALL.md)'
>  	@echo '      uninstall       - Uninstall CRIU'
>  	@echo '      dist            - Create a source tarball'
> +	@echo '      snapshot        - Create a source tarball for current HEAD'
>  	@echo '      clean           - Clean most, but leave enough to navigate'
>  	@echo '      mrproper        - Delete all compiled/generated files'
>  	@echo '      tags            - Generate tags file (ctags)'
> -- 
> 2.7.5
> 


More information about the CRIU mailing list