Skip to content

Commit b3fdd95

Browse files
committed
# 0.11.3 (2016-08-24)
* (PArns) fix upgrade of adapters * (bluefox) update "_design/xyz" by upgrade
1 parent 6aebe43 commit b3fdd95

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# 0.11.3 (2016-08-23)
1+
# 0.11.3 (2016-08-24)
22
* (PArns) fix upgrade of adapters
3+
* (bluefox) update "_design/xyz" by upgrade
34

45
# 0.11.2 (2016-08-13)
56
* (bluefox) fix upgrade of adapters

io-package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"controller": true,
77
"title": "ioBroker.js-controller",
88
"news": {
9+
"0.11.3": {
10+
"en": "fix upgrade of adapters\nupdate _design/xyz by upgrade",
11+
"de": "Fixe upgrade von Adaptern\nUpdate die Objekte _design/xyz bei Upgrade",
12+
"ru": "Исправлено обновление драйверов\n_design/xyz объекты обновляются при upgrade"
13+
},
914
"0.11.2": {
1015
"en": "fix upgrade of adapters",
1116
"de": "fix upgrade of adapters",

lib/setup/setupUpload.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,12 @@ function Upload(options) {
413413
obj.common.installedVersion = iopack.common.version;
414414

415415
var hostname = tools.getHostName();
416-
var cntr = 0;
417416

418417
objects.setObject('system.adapter.' + name, obj, function () {
419418
// Update all instances of this host
420419
objects.getObjectView('system', 'instance', {startkey: 'system.adapter.' + name + '.', endkey: 'system.adapter.' + name + '.\u9999'}, null, function (err, res) {
420+
var cntr = 0;
421+
421422
if (res) {
422423
for (var i = 0; i < res.rows.length; i++) {
423424
if (res.rows[i].value.common.host === hostname) {
@@ -445,6 +446,19 @@ function Upload(options) {
445446
}
446447
}
447448
}
449+
450+
// updates "_design/system" and co
451+
if (iopack.objects && typeof iopack.objects === 'object') {
452+
for (var _id in iopack.objects) {
453+
if (!iopack.objects.hasOwnProperty(_id)) continue;
454+
cntr++;
455+
objects.setObject(iopack.objects[_id]._id, iopack.objects[_id], function (err) {
456+
if (err) console.error('Cannot update object: ' + err);
457+
if (!--cntr && callback) callback(name);
458+
});
459+
}
460+
}
461+
448462
if (!cntr && callback) callback(name);
449463
});
450464
});

0 commit comments

Comments
 (0)