-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch.sh
executable file
·316 lines (224 loc) · 33.6 KB
/
patch.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
#!/bin/bash
refactor() {
sed -i'.original.diff' "s,$2,$3,g" $1
}
check=0
for arg in "$@"
do
case "$arg" in
-check) check=1
;;
esac
done
# Extract the commit title
title=$(sed '4q;d' $1)
title=${title##*]}
# Extract the openHAB commit reference
commit=$(sed '1q;d' $1)
commit=${commit:5}
commit=${commit:0:40}
# author
author=$(sed '2q;d' $1)
author=${author:5}
# date
commitDate=$(sed '3q;d' $1)
commitDate=${commitDate:5}
# Create a new branch
if [ $check == 0 ]
then
echo
echo
echo This script will import a patch file from openHAB and migrate it to OpenSmartHouse.
echo Since this will refactor some bundles, and other changes may have been made to OpenSmartHouse, there may be errors or merge rejections.
echo You are therfore encouraged to use the "-check" option before performing the patch. This will show any errors or warnings before
echo actually performing the patch.
echo
read -p "Do you wish to continue with the patch? [y/n] " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
# git checkout -b $commit
fi
# Preserve the original file
cp $1 $1.tmp
# Patch specific classes that have moved package
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/StateDescriptionServiceImpl.java" "bundles/org.opensmarthouse.core.type/src/main/java/org/openhab/core/types/internal/StateDescriptionServiceImpl.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/service/StateDescriptionServiceImplTest.java" "bundles/org.opensmarthouse.core.type/src/test/java/org/openhab/core/types/internal/StateDescriptionServiceImplTest.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/BundleResolverImpl.java" "bundles/org.opensmarthouse.core.common/src/main/java/org/openhab/core/internal/common/osgi/BundleResolverImpl.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/types/util/UnitUtils.java" "bundles/org.opensmarthouse.core.library.unit/src/main/java/org/openhab/core/types/util/UnitUtils.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/types/util/UnitUtilsTest.java" "bundles/org.opensmarthouse.core.library.unit/src/test/java/org/openhab/core/types/util/UnitUtilsTest.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/items/ManagedItemProvider.java" "bundles/org.opensmarthouse.core.item.core/src/main/java/org/openhab/core/internal/items/StorageItemProvider.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/CoreItemFactory.java" "bundles/org.opensmarthouse.core.item.core/src/main/java/org/openhab/core/internal/items/CoreItemFactory.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/CoreItemFactoryTest.java" "bundles/org.opensmarthouse.core.item.core/src/test/java/org/openhab/core/internal/items/CoreItemFactoryTest.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/types/ArithmeticGroupFunction.java" "bundles/org.opensmarthouse.core.item.core/src/main/java/org/openhab/core/items/ArithmeticGroupFunction.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/types/DateTimeGroupFunction.java" "bundles/org.opensmarthouse.core.item.core/src/main/java/org/openhab/core/items/DateTimeGroupFunction.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/types/QuantityTypeArithmeticGroupFunction.java" "bundles/org.opensmarthouse.core.item.cpore/src/main/java/org/openhab/core/items/QuantityTypeArithmeticGroupFunction.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/types/ArithmeticGroupFunctionTest.java" "bundles/org.opensmarthouse.core.item.core/src/test/java/org/openhab/core/internal/items/function/ArithmeticGroupFunctionTest.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/types/DateTimeGroupFunctionTest.java" "bundles/org.opensmarthouse.core.item.core/src/test/java/org/openhab/core/internal/items/function/DateTimeGroupFunctionTest.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/types/QuantityTypeArithmeticGroupFunctionTest.java" "bundles/org.opensmarthouse.core.item.core/src/test/java/org/openhab/core/internal/items/function/QuantityTypeArithmeticGroupFunctionTest.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/dimension/VolumetricFlowRateTest.java" "bundles/org.opensmarthouse.core.library.unit/src/test/java/org/openhab/core/library/unit/VolumetricFlowRateTest.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java" "bundles/org.opensmarthouse.core.event.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java"
#refactor $1 "bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/events/LinkEventFactory.java" "bundles/org.opensmarthouse.core.thing.core/src/main/java/org/openhab/core/thing/internal/link/events/LinkEventFactory.java"
#refactor $1 "bundles/org.openhab.core.thing/src/test/java/org/openhab/core/thing/binding/builder/ChannelBuilderTest.java" "bundles/org.opensmarthouse.core.thing.core/src/test/java/org/openhab/core/thing/internal/builder/ChannelBuilderTest.java"
#refactor $1 "bundles/org.openhab.core.thing/src/test/java/org/openhab/core/thing/binding/builder/ThingBuilderTest.java" "bundles/org.opensmarthouse.core.thing.core/src/test/java/org/openhab/core/thing/internal/builder/ThingBuilderTest.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/types/CommandDescriptionBuilderTest.java" "bundles/org.opensmarthouse.core.type.core/src/test/java/org/openhab/core/types/CommandDescriptionBuilderTest.java"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/types/StateDescriptionFragmentBuilderTest.java" "bundles/org.opensmarthouse.core.type.core/src/test/java/org/openhab/core/types/StateDescriptionFragmentBuilderTest.java"
#refactor $1 "bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/core/internal/ConfigMapper.java" "bundles/org.opensmarthouse.core.config/src/main/java/org/openhab/core/config/core/ConfigMapper.java"
refactor $1 "bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/core/internal/net/NetworkConfigOptionProvider.java" "bundles/org.opensmarthouse.core.config.net/src/main/java/org/openhab/core/config/core/internal/net/NetworkConfigOptionProvider.java"
refactor $1 "bundles/org.openhab.core.id/src/main/java/org/openhab/core/id/internal/UUIDResource.java" "bundles/org.opensmarthouse.core.io.rest.id/src/main/java/org/openhab/core/id/internal/UUIDResource.java"
refactor $1 "bundles/org.openhab.core.io.transport.serial/src/main/java/org/openhab/core/io/transport/serial/internal/SerialPortRegistry.java" "bundles/org.opensmarthouse.core.io.transport.serial/src/main/java/org/openhab/core/io/transport/serial/internalSerialPortRegistryImpl.java"
refactor $1 "bundles/org.openhab.core.io.transport.serial/src/main/java/org/openhab/core/io/transport/serial/internal/SerialPortProvider.java" "bundles/org.opensmarthouse.core.io.transport.serial/src/main/java/org/openhab/core/io/transport/serial/SerialPortProvider.java"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/addon/AddonEventFactory.java" "bundles/org.opensmarthouse.core.extension/src/main/java/org/openhab/core/extension/ExtensionEventFactory.java"
refactor $1 "bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java" "bundles/org.opensmarthouse.core.ui.sitemap/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java"
refactor $1 "bundles/org.openhab.core.ui/src/test/java/org/openhab/core/ui/internal/items/ItemUIRegistryImplTest.java" "bundles/org.opensmarthouse.core.ui.sitemap/src/test/java/org/openhab/core/ui/internal/items/ItemUIRegistryImplTest.java"
# Patch and refactored bundles - migrating packages to new bundles
refactor $1 "bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/" "bundles/org.opensmarthouse.core.audio.core/src/main/java/org/openhab/core/audio/internal/"
refactor $1 "bundles/org.openhab.core.audio/src/test/java/org/openhab/core/audio/internal/" "bundles/org.opensmarthouse.core.audio.core/src/test/java/org/openhab/core/audio/internal/"
refactor $1 "bundles/org.openhab.core.audio/src/main/resources" "bundles/org.opensmarthouse.core.audio.core/src/main/resources"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/items" "bundles/org.opensmarthouse.core.item/src/main/java/org/openhab/core/items"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/items" "bundles/org.opensmarthouse.core.item/src/test/java/org/openhab/core/items"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/items" "bundles/org.opensmarthouse.core.item.core/src/main/java/org/openhab/core/internal/items"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/items" "bundles/org.opensmarthouse.core.item.core/src/test/java/org/openhab/core/internal/items"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/types" "bundles/org.opensmarthouse.core.type/src/main/java/org/openhab/core/types"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/types" "bundles/org.opensmarthouse.core.type/src/test/java/org/openhab/core/types"
refactor $1 "bundles/org.openhab.core.auth.oauth2client/src/main/java/org/openhab/core/auth/oauth2client/internal/" "bundles/org.opensmarthouse.core.auth.oauth2client.core/src/main/java/org/openhab/core/auth/oauth2client/internal/"
refactor $1 "bundles/org.openhab.core.auth.oauth2client/src/test/java/org/openhab/core/auth/oauth2client/internal/" "bundles/org.opensmarthouse.core.auth.oauth2client.core/src/test/java/org/openhab/core/auth/oauth2client/internal/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/auth/client/oauth2/" "bundles/org.opensmarthouse.core.auth.oauth2client/src/main/java/org/openhab/core/auth/client/oauth2/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/auth/client/oauth2/" "bundles/org.opensmarthouse.core.auth.oauth2client/src/test/java/org/openhab/core/auth/client/oauth2/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/auth/" "bundles/org.opensmarthouse.core.auth.core/src/main/java/org/openhab/core/internal/auth/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/auth/" "bundles/org.opensmarthouse.core.auth.core/src/test/java/org/openhab/core/internal/auth/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/auth/" "bundles/org.opensmarthouse.core.auth/src/main/java/org/openhab/core/auth/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/auth/" "bundles/org.opensmarthouse.core.auth/src/test/java/org/openhab/core/auth/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/storage/" "bundles/org.opensmarthouse.core.storage/src/main/java/org/openhab/core/storage/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/storage/" "bundles/org.opensmarthouse.core.storage/src/test/java/org/openhab/core/storage/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/common/registry/" "bundles/org.opensmarthouse.core.registry/src/main/java/org/openhab/core/common/registry/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/common/registry/" "bundles/org.opensmarthouse.core.registry/src/test/java/org/openhab/core/common/registry/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/common/" "bundles/org.opensmarthouse.core.common/src/main/java/org/openhab/core/common/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/common/" "bundles/org.opensmarthouse.core.common/src/test/java/org/openhab/core/common/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/common/" "bundles/org.opensmarthouse.core.common/src/main/java/org/openhab/core/internal/common/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/common/" "bundles/org.opensmarthouse.core.common/src/test/java/org/openhab/core/internal/common/"
# Config relocation
#refactor $1 "bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/core/internal/" "bundles/org.opensmarthouse.core.config.core/src/main/java/org/openhab/core/config/core/internal/"
#refactor $1 "bundles/org.openhab.core.config.core/src/test/java/org/openhab/core/config/core/internal/" "bundles/org.opensmarthouse.core.config.core/src/test/java/org/openhab/core/config/core/internal/"
refactor $1 "bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/core/" "bundles/org.opensmarthouse.core.config/src/main/java/org/openhab/core/config/core/"
refactor $1 "bundles/org.openhab.core.config.core/src/test/java/org/openhab/core/config/core/" "bundles/org.opensmarthouse.core.config/src/test/java/org/openhab/core/config/core/"
refactor $1 "bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/internal/net/" "bundles/org.opensmarthouse.core.config.net/src/main/java/org/openhab/core/config/internal/net/"
# Discovery
refactor $1 "bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/console/" "bundles/org.opensmarthouse.core.config.discovery.console/src/main/java/org/openhab/core/config/discovery/internal/console/"
#refactor $1 "bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/" "bundles/org.opensmarthouse.core.config.discovery.core/src/main/java/org/openhab/core/config/discovery/internal/"
#refactor $1 "bundles/org.openhab.core.config.discovery/src/test/java/org/openhab/core/config/discovery/internal/" "bundles/org.opensmarthouse.core.config.discovery.core/src/test/java/org/openhab/core/config/discovery/internal/"
#refactor $1 "bundles/org.openhab.core.config.discovery/src/main/resources/" "bundles/org.opensmarthouse.core.config.discovery.core/src/main/resources/"
# REST reolocations
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/binding/" "bundles/org.opensmarthouse.core.io.rest.binding/src/main/java/org/openhab/core/io/rest/core/internal/binding/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/binding/" "bundles/org.opensmarthouse.core.io.rest.binding/src/test/java/org/openhab/core/io/rest/core/internal/binding/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/channel/" "bundles/org.opensmarthouse.core.io.rest.channel/src/main/java/org/openhab/core/io/rest/core/internal/channel/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/channel/" "bundles/org.opensmarthouse.core.io.rest.channel/src/test/java/org/openhab/core/io/rest/core/internal/channel/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/config/" "bundles/org.opensmarthouse.core.io.rest.config/src/main/java/org/openhab/core/io/rest/core/config/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/config/" "bundles/org.opensmarthouse.core.io.rest.config/src/test/java/org/openhab/core/io/rest/core/config/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/config/" "bundles/org.opensmarthouse.core.io.rest.config/src/main/java/org/openhab/core/io/rest/core/internal/config/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/config/" "bundles/org.opensmarthouse.core.io.rest.config/src/test/java/org/openhab/core/io/rest/core/internal/config/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/discovery/" "bundles/org.opensmarthouse.core.io.rest.discovery/src/main/java/org/openhab/core/io/rest/core/internal/discovery/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/discovery/" "bundles/org.opensmarthouse.core.io.rest.discovery/src/test/java/org/openhab/core/io/rest/core/internal/discovery/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/extensions/" "bundles/org.opensmarthouse.core.io.rest.extension/src/main/java/org/openhab/core/io/rest/core/internal/extensions/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/extensions/" "bundles/org.opensmarthouse.core.io.rest.extension/src/test/java/org/openhab/core/io/rest/core/internal/extensions/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/link/" "bundles/org.opensmarthouse.core.io.rest.item/src/main/java/org/openhab/core/io/rest/core/internal/link/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/link/" "bundles/org.opensmarthouse.core.io.rest.item/src/test/java/org/openhab/core/io/rest/core/internal/link/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/item/" "bundles/org.opensmarthouse.core.io.rest.item/src/main/java/org/openhab/core/io/rest/core/item/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/item/" "bundles/org.opensmarthouse.core.io.rest.item/src/test/java/org/openhab/core/io/rest/core/item/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/item/" "bundles/org.opensmarthouse.core.io.rest.item/src/main/java/org/openhab/core/io/rest/core/internal/item/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/item/" "bundles/org.opensmarthouse.core.io.rest.item/src/test/java/org/openhab/core/io/rest/core/internal/item/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/service/" "bundles/org.opensmarthouse.core.io.rest.service/src/main/java/org/openhab/core/io/rest/core/service/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/service/" "bundles/org.opensmarthouse.core.io.rest.service/src/test/java/org/openhab/core/io/rest/core/service/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/service/" "bundles/org.opensmarthouse.core.io.rest.service/src/main/java/org/openhab/core/io/rest/core/internal/service/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/service/" "bundles/org.opensmarthouse.core.io.rest.service/src/test/java/org/openhab/core/io/rest/core/internal/service/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/persistence/" "bundles/org.opensmarthouse.core.io.rest.persistence/src/main/java/org/openhab/core/io/rest/core/persistence/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/persistence/" "bundles/org.opensmarthouse.core.io.rest.persistence/src/test/java/org/openhab/core/io/rest/core/persistence/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/persistence/" "bundles/org.opensmarthouse.core.io.rest.persistence/src/main/java/org/openhab/core/io/rest/core/internal/persistence/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/persistence/" "bundles/org.opensmarthouse.core.io.rest.persistence/src/test/java/org/openhab/core/io/rest/core/internal/persistence/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/thing/internal/console/" "bundles/org.opensmarthouse.core.io.rest.thing/src/main/java/org/openhab/core/thing/internal/console/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/thing/internal/console/" "bundles/org.opensmarthouse.core.io.rest.thing/src/test/java/org/openhab/core/thing/internal/console/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/thing/" "bundles/org.opensmarthouse.core.io.rest.thing/src/main/java/org/openhab/core/io/rest/core/thing/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/thing/" "bundles/org.opensmarthouse.core.io.rest.thing/src/test/java/org/openhab/core/io/rest/core/thing/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/thing/" "bundles/org.opensmarthouse.core.io.rest.thing/src/main/java/org/openhab/core/io/rest/core/internal/thing/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/test/java/org/openhab/core/io/rest/core/internal/thing/" "bundles/org.opensmarthouse.core.io.rest.thing/src/test/java/org/openhab/core/io/rest/core/internal/thing/"
refactor $1 "bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/console/" "bundles/org.opensmarthouse.core.thing.console/src/main/java/org/openhab/core/thing/internal/console/"
refactor $1 "bundles/org.openhab.core.thing/src/test/java/org/openhab/core/thing/internal/console/" "bundles/org.opensmarthouse.core.thing.console/src/test/java/org/openhab/core/thing/internal/console/"
#refactor $1 "bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/" "bundles/org.opensmarthouse.core.thing.core/src/main/java/org/openhab/core/thing/internal/"
#refactor $1 "bundles/org.openhab.core.thing/src/test/java/org/openhab/core/thing/internal/" "bundles/org.opensmarthouse.core.thing.core/src/test/java/org/openhab/core/thing/internal/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/i18n/" "bundles/org.opensmarthouse.core.i18n/src/main/java/org/openhab/core/i18n/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/i18n/" "bundles/org.opensmarthouse.core.i18n/src/test/java/org/openhab/core/i18n/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/i18n/" "bundles/org.opensmarthouse.core.i18n.core/src/main/java/org/openhab/core/internal/i18n/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/i18n/" "bundles/org.opensmarthouse.core.i18n.core/src/test/java/org/openhab/core/internal/i18n/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/events/" "bundles/org.opensmarthouse.core.event/src/main/java/org/openhab/core/events/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/events/" "bundles/org.opensmarthouse.core.event/src/test/java/org/openhab/core/events/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/" "bundles/org.opensmarthouse.core.event.core/src/main/java/org/openhab/core/events/system/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/events/system/" "bundles/org.opensmarthouse.core.event.core/src/test/java/org/openhab/core/events/system/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/" "bundles/org.opensmarthouse.core.event.core/src/main/java/org/openhab/core/internal/events/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/events/" "bundles/org.opensmarthouse.core.event.core/src/test/java/org/openhab/core/internal/events/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/extension/" "bundles/org.opensmarthouse.core.extension/src/main/java/org/openhab/core/extension/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/extension/" "bundles/org.opensmarthouse.core.extension/src/test/java/org/openhab/core/extension/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/service/" "bundles/org.opensmarthouse.core.service/src/main/java/org/openhab/core/service/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/service/" "bundles/org.opensmarthouse.core.service/src/test/java/org/openhab/core/service/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/" "bundles/org.opensmarthouse.core.service.core/src/main/java/org/openhab/core/internal/service/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/service/" "bundles/org.opensmarthouse.core.service.core/src/test/java/org/openhab/core/internal/service/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/net/" "bundles/org.opensmarthouse.core.net/src/main/java/org/openhab/core/net/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/net/" "bundles/org.opensmarthouse.core.net/src/test/java/org/openhab/core/net/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/types/util/" "bundles/org.opensmarthouse.core.library.unit/src/main/java/org/openhab/core/types/util/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/types/util/" "bundles/org.opensmarthouse.core.library.unit/src/test/java/org/openhab/core/types/util/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/" "bundles/org.opensmarthouse.core.library.unit/src/main/java/org/openhab/core/library/unit/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/unit/" "bundles/org.opensmarthouse.core.library.unit/src/test/java/org/openhab/core/library/unit/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/items/" "bundles/org.opensmarthouse.core.library.item/src/main/java/org/openhab/core/library/items/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/items/" "bundles/org.opensmarthouse.core.library.item/src/test/java/org/openhab/core/library/items/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/library/types/" "bundles/org.opensmarthouse.core.library.type/src/main/java/org/openhab/core/library/types/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/library/types/" "bundles/org.opensmarthouse.core.library.type/src/test/java/org/openhab/core/library/types/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/internal/scheduler/" "bundles/org.opensmarthouse.core.scheduler.core/src/main/java/org/openhab/core/internal/scheduler/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/internal/scheduler/" "bundles/org.opensmarthouse.core.scheduler.core/src/test/java/org/openhab/core/internal/scheduler/"
refactor $1 "bundles/org.openhab.core/src/main/java/org/openhab/core/util/" "bundles/org.opensmarthouse.core.util/src/main/java/org/openhab/core/util/"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/util/" "bundles/org.opensmarthouse.core.util/src/test/java/org/openhab/core/util/"
refactor $1 "bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/profile" "bundles/org.opensmarthouse.core.io.rest.item/src/main/java/org/openhab/core/io/rest/core/internal/profile"
refactor $1 "bundles/org.openhab.core/src/test/java/org/openhab/core/cache/" "bundles/org.opensmarthouse.core.cache/src/test/java/org/openhab/core/cache/"
refactor $1 "bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/" "bundles/org.opensmarthouse.core.voice.core/src/main/java/org/openhab/core/voice/internal/"
refactor $1 "bundles/org.openhab.core.voice/src/test/java/org/openhab/core/voice/internal/" "bundles/org.opensmarthouse.core.voice.core/src/test/java/org/openhab/core/voice/internal/"
refactor $1 "bundles/org.openhab.core.voice/src/main/resources" "bundles/org.opensmarthouse.core.voice.core/src/main/resources"
refactor $1 "bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/chart/" "bundles/org.opensmarthouse.core.ui.chart/src/main/java/org/openhab/core/ui/chart/"
refactor $1 "bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/chart/" "bundles/org.opensmarthouse.core.ui.chart/src/main/java/org/openhab/core/ui/internal/chart/"
refactor $1 "bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/proxy/" "bundles/org.opensmarthouse.core.ui.proxy/src/main/java/org/openhab/core/ui/internal/proxy/"
refactor $1 "bundles/org.openhab.core.ui/src/test/java/org/openhab/core/ui/internal/proxy/" "bundles/org.opensmarthouse.core.ui.proxy/src/test/java/org/openhab/core/ui/internal/proxy/"
refactor $1 "bundles/org.openhab.core.ui/src/test/java/org/openhab/core/ui/sitemap/" "bundles/org.opensmarthouse.core.ui.sitemap/src/test/java/org/openhab/core/ui/sitemap/"
# Catch-all. Must be last!
refactor $1 "itests/org.openhab.core" "itests/org.opensmarthouse.core"
refactor $1 "bundles/org.openhab.core" "bundles/org.opensmarthouse.core"
if [ $check == 1 ]
then
echo Only performing a git check - patch will not be applied
# Check if the commit will work
git apply --check $1
else
echo Applying patch
# Commit the changes
git apply --reject $1
fi
# Restore the original file
rm $1
rm $1.original.diff
mv $1.tmp $1
echo --- Patch Information ---
read -p "Automatically add files and create commit? [y/n]" prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
git status|grep -i "modified:\|added:\|deleted:"|grep -v .gitignore|grep -v patch.sh|tr -s '\t' ' '|cut -d ' ' -f 3|xargs git add
echo "Executing command: git commit --author \"$author\" --date \"$commitDate\" -s"
# get header from Subject to beginning of diff section, then remove '---' separator line and append OH commit id
sed -n "/^Subject: /,/---/p" $1 >> .git/commit-msg.txt
sed -i '$ d' .git/commit-msg.txt
echo "X-Backport-Id: $commit" >> .git/commit-msg.txt
git commit --author "$author" --date "$commitDate" -eF .git/commit-msg.txt -s && rm .git/commit-msg.txt
read -p "Remove $1? [y/n]" cleanup
if [[ $cleanup == "y" || $cleanup == "Y" || $cleanup == "yes" || $cleanup == "Yes" ]]; then
rm $1;
fi;
else
echo $title
echo $commit
fi;