From: Zbigniew Jędrzejewski-Szmek Date: Mon, 24 Apr 2017 23:28:05 +0000 (-0400) Subject: meson: add git-snapshot target X-Git-Tag: v234~286^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd6ab3df749172e0b85de00338b485d8f4e24fa1;p=thirdparty%2Fsystemd.git meson: add git-snapshot target The output is systemd-.tar.gz in source root. --- diff --git a/meson.build b/meson.build index 59318a9a5db..991836a9769 100644 --- a/meson.build +++ b/meson.build @@ -2321,3 +2321,22 @@ if git.found() 'git-contrib', command : [meson_git_contrib_sh]) endif + +if git.found() + git_head = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'rev-parse', 'HEAD']).stdout().strip() + git_head_short = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'rev-parse', '--short=7', 'HEAD']).stdout().strip() + + run_target( + 'git-snapshot', + command : ['git', 'archive', + '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(), + git_head_short), + '--prefix', 'systemd-@0@/'.format(git_head), + 'HEAD']) +endif