-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathmerge_memcached_and_ep_engine.sh
executable file
·197 lines (171 loc) · 6.25 KB
/
merge_memcached_and_ep_engine.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#!/bin/bash
# Copyright 2017-Present Couchbase, Inc.
#
# Use of this software is governed by the Business Source License included in
# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that
# file, in accordance with the Business Source License, use of this software
# will be governed by the Apache License, Version 2.0, included in the file
# licenses/APL2.txt.
set -e
set -x
mc_URL=git://github.com/couchbase/memcached
ep_URL=git://github.com/couchbase/ep-engine
# Start with the memcached repo - the layout /mostly/ matches the final result we want.
git clone $mc_URL .
git checkout master
# Rename the memcached tags to add a '_mc' suffix.
git for-each-ref --shell --format="ref=%(refname:strip=2)" refs/tags/ |
while read entry
do
eval "$entry"
git tag ${ref}_mc ${ref}
git tag -d ${ref}
done
# Add ep-engine as a remote, then check that out and move files to
# where we want them post-merge.
git remote add -f ep_engine $ep_URL
git fetch --tags ep_engine
git checkout -b ep_master ep_engine/master
mkdir -p engines/ep
git mv -k .[a-z]* * engines/ep/
git commit -m "Move ep-engine to engines/ep"
# Rename the ep-engine tags to add a '_ep' suffix.
git for-each-ref --shell --format="ref=%(refname:strip=2)" refs/tags/ |
while read entry
do
eval "$entry"
if [[ $ref != *_mc ]]; then
git tag ${ref}_ep ${ref}
git tag -d ${ref}
fi
done
# Flip back to "main" master, and merge ep_master
git checkout master
git merge --allow-unrelated-histories ep_master <<EOF
=== Merge ep_engine/master into kv_engine ===
EOF
# Now apply the patches we need post-merge:
git am <<'EOF'
From 986c378c3d45189fdeea8bdacb3a635cde8a8b94 Mon Sep 17 00:00:00 2001
From: Dave Rigby <[email protected]>
Date: Mon, 15 May 2017 17:05:35 +0100
Subject: [PATCH] MB-22602: Update auditd file paths for kv_engine
Now memcached & ep-engine are in a unified repo named 'kv_engine',
update paths for auditd to the new location.
Change-Id: Ice4f453af3101194bb0b6b728b2e6585ea474f9b
---
auditd/etc/kv_commit_validation_module_descriptors.json | 8 ++++----
auditd/etc/module_descriptors.json | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/auditd/etc/kv_commit_validation_module_descriptors.json b/auditd/etc/kv_commit_validation_module_descriptors.json
index bc9227b..a441fd7 100644
--- a/auditd/etc/kv_commit_validation_module_descriptors.json
+++ b/auditd/etc/kv_commit_validation_module_descriptors.json
@@ -3,15 +3,15 @@
{
"auditd": {
"startid": 4096,
- "file": "memcached/auditd/etc/auditd_descriptor.json",
- "header": "memcached/auditd/auditd_audit_events.h"
+ "file": "kv_engine/auditd/etc/auditd_descriptor.json",
+ "header": "kv_engine/auditd/auditd_audit_events.h"
}
},
{
"memcached": {
"startid": 20480,
- "file": "memcached/etc/memcached_descriptor.json",
- "header": "memcached/memcached_audit_events.h"
+ "file": "kv_engine/etc/memcached_descriptor.json",
+ "header": "kv_engine/memcached_audit_events.h"
}
}
]
diff --git a/auditd/etc/module_descriptors.json b/auditd/etc/module_descriptors.json
index a50dc1c..3499707 100644
--- a/auditd/etc/module_descriptors.json
+++ b/auditd/etc/module_descriptors.json
@@ -3,8 +3,8 @@
{
"auditd" : {
"startid" : 4096,
- "file" : "memcached/auditd/etc/auditd_descriptor.json",
- "header" : "memcached/auditd/auditd_audit_events.h"
+ "file" : "kv_engine/auditd/etc/auditd_descriptor.json",
+ "header" : "kv_engine/auditd/auditd_audit_events.h"
}
},
@@ -23,8 +23,8 @@
{
"memcached" : {
"startid" : 20480,
- "file" : "memcached/etc/memcached_descriptor.json",
- "header":"memcached/memcached_audit_events.h"
+ "file" : "kv_engine/etc/memcached_descriptor.json",
+ "header":"kv_engine/memcached_audit_events.h"
}
},
{
--
2.10.0
EOF
git am <<'EOF'
From 47191f54b71f7ab2da158b3709bd8d4e11a24d6c Mon Sep 17 00:00:00 2001
From: Dave Rigby <[email protected]>
Date: Mon, 15 May 2017 17:01:02 +0100
Subject: [PATCH] MB-22602: Add 'ep' as a subdir to engines/
---
engines/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/engines/CMakeLists.txt b/engines/CMakeLists.txt
index 523eb2b..48365e5 100644
--- a/engines/CMakeLists.txt
+++ b/engines/CMakeLists.txt
@@ -3,5 +3,6 @@ ADD_SUBDIRECTORY(utilities)
ADD_SUBDIRECTORY(crash_engine)
ADD_SUBDIRECTORY(default_engine)
+ADD_SUBDIRECTORY(ep)
ADD_SUBDIRECTORY(ewouldblock_engine)
ADD_SUBDIRECTORY(nobucket)
--
2.10.0
EOF
# TLM patch to use the new combined directory:
pushd ../tlm
git am --ignore-whitespace <<'EOF'
From a1d0a9836875a70e6f830e339a7a9029cc25bc26 Mon Sep 17 00:00:00 2001
From: Dave Rigby <[email protected]>
Date: Tue, 16 May 2017 11:37:31 +0100
Subject: [PATCH] MB-22602: Replace memcached,ep_engine subdirs with kv_engine
Replace the separate memcached & ep_engine subdirectories with the
newly-unified kv_engine subdir.
Change-Id: Ic87bc4d99f18e06f13bd62d4da370f38180e75f9
---
CMakeLists.txt | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f0c8e1..bdb2f98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,8 +196,7 @@ ENDIF (PHOSPHOR_DISABLE)
ADD_SUBDIRECTORY(platform)
ADD_SUBDIRECTORY(subjson)
-ADD_SUBDIRECTORY(memcached/include)
-ADD_SUBDIRECTORY(memcached)
+ADD_SUBDIRECTORY(kv_engine/include)
ADD_SUBDIRECTORY(couchstore)
IF (NOT COUCHBASE_KV_COMMIT_VALIDATION)
ADD_SUBDIRECTORY(forestdb)
@@ -206,7 +205,7 @@ IF (NOT COUCHBASE_KV_COMMIT_VALIDATION)
GET_FILENAME_COMPONENT (FORESTDB_LIBRARY_DIR "${_dir}" PATH)
SET (FORESTDB_TARGET forestdb)
ENDIF()
-ADD_SUBDIRECTORY(ep-engine)
+ADD_SUBDIRECTORY(kv_engine)
ADD_SUBDIRECTORY(sigar)
ADD_SUBDIRECTORY(moxi)
--
2.10.0
EOF
popd
cp -f ../tlm/CMakeLists.txt ..