Module: kamailio
Branch: 5.7
Commit: 04ef5978df1937a8b23f245edb5f51a0bf544cae
URL: 
https://github.com/kamailio/kamailio/commit/04ef5978df1937a8b23f245edb5f51a0bf544cae

Author: S-P Chan <shihping.c...@gmail.com>
Committer: S-P Chan <shihping.c...@gmail.com>
Date: 2023-10-07T09:37:10+08:00

pkg: add example script to create tarball with submodules instantiated

In preparation for packaging of tls_wolfssl, add an example script to
create source tarball with submodule code.

Cherry-pick from aed35ddb6a

---

Added: pkg/scripts/git-archive-all.sh

---

Diff:  
https://github.com/kamailio/kamailio/commit/04ef5978df1937a8b23f245edb5f51a0bf544cae.diff
Patch: 
https://github.com/kamailio/kamailio/commit/04ef5978df1937a8b23f245edb5f51a0bf544cae.patch

---

diff --git a/pkg/scripts/git-archive-all.sh b/pkg/scripts/git-archive-all.sh
new file mode 100755
index 00000000000..71bacc7d896
--- /dev/null
+++ b/pkg/scripts/git-archive-all.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# packaging script to include submodules
+# modified from: 
https://gist.github.com/arteymix/03702e3eb05c2c161a86b49d4626d21f
+# Usage: pkg/scripts/git-archive-all.sh kamailio-5.8.0 
../output/kamailio-5.8.0_src
+
+usage() {
+    echo Usage:  pkg/scripts/git-archive-all.sh kamailio-5.8.0 
../output/kamailio-5.8.0_src
+}
+
+if [ -z $1 ]; then
+    echo "You must specify a prefix name."
+    usage
+    exit 1
+fi
+
+if [ -z $2 ]; then
+    echo "You must specify a super-archive name."
+    usage
+    exit 1
+fi
+
+git archive --prefix "$1/" -o "$2.tar" HEAD
+git submodule foreach --recursive "git archive --prefix=$1/\$sm_path/ 
--output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/$2.tar \$sha1.tar 
&& rm \$sha1.tar"
+
+gzip "$2.tar"

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to