[PATCH] osmo-ttcn3-hacks[master]: Add generic link functions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Wed Dec 13 12:41:26 UTC 2017


Review at  https://gerrit.osmocom.org/5315

Add generic link functions

* add function for link generation
* add functions to symlink specific libraries

The main differences with existing gen_links() routines:
* properly shift arguments to avoid making directory symlink alongside
  with files symlink
* additional debug output
* automated generation of .gitignore entries for linked files

Change-Id: I2aaab05ebe19e5f18c03806069197be0e1304a0b
---
A generic.sh
1 file changed, 50 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/5315/1

diff --git a/generic.sh b/generic.sh
new file mode 100644
index 0000000..c084602
--- /dev/null
+++ b/generic.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# Generic function for properly linking necessary dependencies
+# and several examples of linking particular libraries which use it.
+# To avoid cluttering git status, the per-test .gitignore is updated automatically
+# If additional files are required from particular library than manual adjustements
+# might be necessary
+
+set -e
+
+gen_links() {
+    DIR=$1
+    shift
+    FILES=$*
+    echo "Files to link from $DIR:"
+    echo $FILES
+    echo ""
+    for f in $FILES; do
+	echo "Linking $f"
+	ln -sf $DIR/$f $f
+	echo "$f" >> .gitignore
+    done
+    echo "Linking done, cleaning up .gitignore..."
+    awk '!seen[$0]++' .gitignore > tmp.gitignore
+    mv tmp.gitignore .gitignore
+}
+
+link_TCCUsefulFunctions() {
+    gen_links $1/titan.Libraries.TCCUsefulFunctions/src "TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCInterface.cc TCCInterface_ip.h"
+}
+
+link_IPL4asp() {
+    gen_links $1/titan.TestPorts.IPL4asp/src "IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh"
+}
+
+link_SocketAPI() {
+    gen_links $1/titan.TestPorts.Common_Components.Socket-API/src "Socket_API_Definitions.ttcn"
+}
+
+link_UNIX_DOMAIN_SOCKETasp() {
+    gen_links $1/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src "UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn"
+}
+
+link_MobileL3_v13() {
+    gen_links $1/titan.ProtocolModules.MobileL3_v13.4.0/src "MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn SS_DataTypes.asn SS_EncDec.cc SS_Errors.asn SS_Operations.asn SS_PDU_Defs.asn SS_Protocol.asn SS_Types.ttcn"
+}
+
+link_library() {
+    gen_links "../library" "General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn"
+}

-- 
To view, visit https://gerrit.osmocom.org/5315
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2aaab05ebe19e5f18c03806069197be0e1304a0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list