From 487633143d4cce230def9089ea4d8e8781bb7efe Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp@canonical.com>
Date: Mon, 12 Feb 2018 16:19:29 +0100
Subject: [PATCH] shared: Add Pack function

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
---
 shared/util.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/shared/util.go b/shared/util.go
index f18daaa..f93c6c7 100644
--- a/shared/util.go
+++ b/shared/util.go
@@ -84,3 +84,8 @@ func VerifyFile(signedFile, signatureFile string, keys []string, keyserver strin
 
 	return true, nil
 }
+
+// Pack creates an xz-compressed tarball.
+func Pack(filename, path string, args ...string) error {
+	return RunCommand("tar", append([]string{"-cJf", filename, "-C", path}, args...)...)
+}