Commit 9108ecbd authored by Cedric Roux's avatar Cedric Roux

Use diff files and 'patch' instead of copying full files.

parent a9256ded
#!/bin/bash
# in those arrays, each line is:
# <file> <sha1sum of file> <replacement file>
# <file> <sha1sum of file> <patch to apply to file>
RRC_Rel10=(
"SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h"
"SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff"
)
X2AP_Rel11_2=(
"X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h"
"NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c"
"constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c"
"X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff"
"NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
"constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
)
S1AP_Rel10_5=(
"NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c"
"constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c"
"NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
"constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
)
red_color="\x1b[31m"
green_color="\x1b[32m"
reset_color="\x1b[0m"
red_color="$(tput setaf 1)"
green_color="$(tput setaf 2)"
reset_color="$(tput sgr0)"
function error()
{
......@@ -46,21 +46,21 @@ function check_sha1()
fi
}
function copy_file()
function patch_file()
{
local file="$1"
local destination="$2"
local patch="$1"
local file="$2"
echo -e "$green_color""copy file $OPENAIR_DIR/cmake_targets/tools/$file to $destination""$reset_color"
echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
cp -f "$OPENAIR_DIR/cmake_targets/tools/$file" "$destination"
patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
if [ $? -ne 0 ]
then
error "copy of $file to $destination failed"
error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
fi
}
function patch()
function apply_patches()
{
local directory="$1"
local array=$2
......@@ -69,7 +69,7 @@ function patch()
local i
local file
local sha1
local replace
local patch
local item
for (( i = 0; i < $len; i += 3 ))
......@@ -77,9 +77,9 @@ function patch()
# special bash syntax to access the array
item=$array[$i]; file=${!item}
item=$array[$((i+1))]; sha1=${!item}
item=$array[$((i+2))]; replace=${!item}
item=$array[$((i+2))]; patch=${!item}
check_sha1 "$directory/$file" "$sha1"
copy_file "$replace" "$directory"
patch_file "$patch" "$directory/$file"
done
}
......@@ -91,7 +91,7 @@ function patch_rrc()
case "$version" in
Rel10 )
echo "patching RRC files release 10"
patch "$directory" RRC_Rel10 ${#RRC_Rel10[*]}
apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]}
;;
* )
error unknwon/unhandled RRC version \'"$version"\'
......@@ -107,7 +107,7 @@ function patch_x2ap()
case "$version" in
R11 )
echo "patching X2AP files release 11.2"
patch "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]}
apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]}
;;
* )
error unknwon/unhandled X2AP version \'"$version"\'
......@@ -123,7 +123,7 @@ function patch_s1ap()
case "$version" in
R10 )
echo "patching S1AP files release 10.5"
patch "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]}
apply_patches "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]}
;;
* )
error unknwon/unhandled S1AP version \'"$version"\'
......
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "fixed_grammar.asn"
* `asn1c -gen-PER`
*/
#ifndef _SystemInformation_r8_IEs_H_
#define _SystemInformation_r8_IEs_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include "SystemInformationBlockType2.h"
#include "SystemInformationBlockType3.h"
#include "SystemInformationBlockType4.h"
#include "SystemInformationBlockType5.h"
#include "SystemInformationBlockType6.h"
#include "SystemInformationBlockType7.h"
#include "SystemInformationBlockType8.h"
#include "SystemInformationBlockType9.h"
#include "SystemInformationBlockType10.h"
#include "SystemInformationBlockType11.h"
#include "SystemInformationBlockType12-r9.h"
#include "SystemInformationBlockType13-r9.h"
#include <constr_CHOICE.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR {
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING, /* No components present */
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11,
/* Extensions may appear below */
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920,
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920
} SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR;
/* Forward declarations */
struct SystemInformation_v8a0_IEs;
union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u {
SystemInformationBlockType2_t sib2;
SystemInformationBlockType3_t sib3;
SystemInformationBlockType4_t sib4;
SystemInformationBlockType5_t sib5;
SystemInformationBlockType6_t sib6;
SystemInformationBlockType7_t sib7;
SystemInformationBlockType8_t sib8;
SystemInformationBlockType9_t sib9;
SystemInformationBlockType10_t sib10;
SystemInformationBlockType11_t sib11;
/*
* This type is extensible,
* possible extensions are below.
*/
SystemInformationBlockType12_r9_t sib12_v920;
SystemInformationBlockType13_r9_t sib13_v920;
};
struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
};
/* SystemInformation-r8-IEs */
typedef struct SystemInformation_r8_IEs {
struct SystemInformation_r8_IEs__sib_TypeAndInfo {
A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} sib_TypeAndInfo;
struct SystemInformation_v8a0_IEs *nonCriticalExtension /* OPTIONAL */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SystemInformation_r8_IEs_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SystemInformation_r8_IEs;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "SystemInformation-v8a0-IEs.h"
#endif /* _SystemInformation_r8_IEs_H_ */
#include <asn_internal.h>
57,61d56
< /* SystemInformation-r8-IEs */
< typedef struct SystemInformation_r8_IEs {
< struct SystemInformation_r8_IEs__sib_TypeAndInfo {
< A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
< SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
79c74,78
< } choice;
---
> };
>
> struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
> SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
> union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
83c82,87
< } ) list;
---
> };
>
> /* SystemInformation-r8-IEs */
> typedef struct SystemInformation_r8_IEs {
> struct SystemInformation_r8_IEs__sib_TypeAndInfo {
> A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
282c282
< int dynamic = 0;
---
> //int dynamic = 0;
289c289
< dynamic = 1;
---
> //dynamic = 1;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
282c282
< int dynamic = 0;
---
> //int dynamic = 0;
289c289
< dynamic = 1;
---
> //dynamic = 1;
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "X2AP-IEs"
* found in "/roux/comments/openairinterface5g/openair2/X2AP/MESSAGES/ASN1/R11.2/X2AP-IEs.asn"
* `asn1c -gen-PER`
*/
#ifndef _X2ap_CriticalityDiagnostics_IE_List_H_
#define _X2ap_CriticalityDiagnostics_IE_List_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include "X2ap-Criticality.h"
#include "X2ap-ProtocolIE-ID.h"
#include "X2ap-TypeOfError.h"
#include <constr_SEQUENCE.h>
#include <constr_SEQUENCE_OF.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct X2ap_IE_Extensions;
struct X2ap_CriticalityDiagnostics_IE_List__Member {
X2ap_Criticality_t iECriticality;
X2ap_ProtocolIE_ID_t iE_ID;
X2ap_TypeOfError_t typeOfError;
struct X2ap_IE_Extensions *iE_Extensions /* OPTIONAL */;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
};
/* X2ap-CriticalityDiagnostics-IE-List */
typedef struct X2ap_CriticalityDiagnostics_IE_List {
A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member
) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} X2ap_CriticalityDiagnostics_IE_List_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_X2ap_CriticalityDiagnostics_IE_List;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "X2ap-IE-Extensions.h"
#endif /* _X2ap_CriticalityDiagnostics_IE_List_H_ */
#include <asn_internal.h>
29,31c29
< /* X2ap-CriticalityDiagnostics-IE-List */
< typedef struct X2ap_CriticalityDiagnostics_IE_List {
< A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member {
---
> struct X2ap_CriticalityDiagnostics_IE_List__Member {
43c41,46
< } ) list;
---
> };
>
> /* X2ap-CriticalityDiagnostics-IE-List */
> typedef struct X2ap_CriticalityDiagnostics_IE_List {
> A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member
> ) list;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment