/
ssucli.cpp
715 lines (608 loc) · 21.9 KB
1
/**
2
* @file ssucli.cpp
3
4
5
6
7
8
* @copyright 2012 Jolla Ltd.
* @author Bernd Wachter <bernd.wachter@jollamobile.com>
* @date 2012
*/
#include <QCoreApplication>
9
10
#include <termios.h>
11
#include <unistd.h>
12
13
14
#include "libssu/ssudeviceinfo.h"
#include "libssu/ssurepomanager.h"
15
16
#include "libssu/ssucoreconfig_p.h"
#include "libssu/ssuvariables_p.h"
17
18
#include <QDebug>
19
20
#include "ssucli.h"
21
22
SsuCli::SsuCli(): QObject(){
23
24
25
26
connect(this,SIGNAL(done()),
QCoreApplication::instance(),SLOT(quit()), Qt::DirectConnection);
connect(&ssu, SIGNAL(done()),
this, SLOT(handleResponse()));
27
28
29
30
31
32
ssuProxy = new SsuProxy("org.nemo.ssu", "/org/nemo/ssu", QDBusConnection::systemBus(), 0);
connect(ssuProxy, SIGNAL(done()),
this, SLOT(handleDBusResponse()));
33
state = Idle;
34
35
}
36
SsuCli::~SsuCli(){
37
38
39
ssuProxy->quit();
}
40
void SsuCli::handleResponse(){
41
42
43
44
45
QTextStream qout(stdout);
if (ssu.error()){
qout << "Last operation failed: \n" << ssu.lastError() << endl;
QCoreApplication::exit(1);
46
47
48
49
50
51
} else {
qout << "Operation successful (direct)" << endl;
QCoreApplication::exit(0);
}
}
52
void SsuCli::handleDBusResponse(){
53
54
55
56
57
QTextStream qout(stdout);
if (ssuProxy->error()){
qout << "Last operation failed: \n" << ssuProxy->lastError() << endl;
QCoreApplication::exit(1);
58
59
60
61
62
63
} else {
qout << "Operation successful" << endl;
QCoreApplication::exit(0);
}
}
64
void SsuCli::optDomain(QStringList opt){
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
QTextStream qout(stdout);
if (opt.count() == 3 && opt.at(2) == "-s"){
qout << ssu.domain();
state = Idle;
} else if (opt.count() == 3){
qout << "Changing domain from " << ssu.domain()
<< " to " << opt.at(2) << endl;
ssu.setDomain(opt.at(2));
state = Idle;
} else if (opt.count() == 2) {
qout << "Device domain is currently: " << ssu.domain() << endl;
state = Idle;
}
}
81
82
void SsuCli::optFlavour(QStringList opt){
83
QTextStream qout(stdout);
84
QTextStream qerr(stderr);
85
86
87
88
89
if (opt.count() == 3 && opt.at(2) == "-s"){
qout << ssu.flavour();
state = Idle;
} else if (opt.count() == 3){
90
qout << "Changing flavour from " << ssu.flavour()
91
<< " to " << opt.at(2) << endl;
92
93
94
95
96
97
98
99
100
101
102
QDBusPendingReply<> reply = ssuProxy->setFlavour(opt.at(2));
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
ssu.setFlavour(opt.at(2));
SsuRepoManager repoManager;
repoManager.update();
uidWarning();
}
103
104
105
state = Idle;
} else if (opt.count() == 2) {
106
qout << "Device flavour is currently: " << ssu.flavour() << endl;
107
108
109
state = Idle;
}
}
110
111
void SsuCli::optMode(QStringList opt){
112
QTextStream qout(stdout);
113
QTextStream qerr(stderr);
114
115
116
117
// TODO: allow setting meaningful names instead of numbers
if (opt.count() == 2){
118
119
120
121
122
123
124
125
126
127
128
QStringList modeList;
int deviceMode = ssu.deviceMode();
if ((deviceMode & Ssu::DisableRepoManager) == Ssu::DisableRepoManager)
modeList.append("DisableRepoManager");
if ((deviceMode & Ssu::RndMode) == Ssu::RndMode)
modeList.append("RndMode");
if ((deviceMode & Ssu::ReleaseMode) == Ssu::ReleaseMode)
modeList.append("ReleaseMode");
if ((deviceMode & Ssu::LenientMode) == Ssu::LenientMode)
modeList.append("LenientMode");
129
130
if ((deviceMode & Ssu::UpdateMode) == Ssu::UpdateMode)
modeList.append("UpdateMode");
131
132
133
134
135
136
137
138
qout << "Device mode is: " << ssu.deviceMode()
<< " (" << modeList.join(" | ") << ")" << endl;
if ((deviceMode & Ssu::RndMode) == Ssu::RndMode &&
(deviceMode & Ssu::ReleaseMode) == Ssu::ReleaseMode)
qout << "Both Release and RnD mode set, device is in RnD mode" << endl;
139
140
141
state = Idle;
} else if (opt.count() == 3 && opt.at(2) == "-s"){
qout << ssu.deviceMode();
142
143
144
145
state = Idle;
} else if (opt.count() == 3){
qout << "Setting device mode from " << ssu.deviceMode()
<< " to " << opt.at(2) << endl;
146
147
148
149
150
QDBusPendingReply<> reply = ssuProxy->setDeviceMode(opt.at(2).toInt());
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
151
ssu.setDeviceMode(Ssu::DeviceModeFlags(opt.at(2).toInt()));
152
153
154
155
156
SsuRepoManager repoManager;
repoManager.update();
uidWarning();
}
157
158
159
state = Idle;
}
160
161
}
162
void SsuCli::optModel(QStringList opt){
163
QTextStream qout(stdout);
164
QTextStream qerr(stderr);
165
166
167
168
169
170
171
172
173
174
175
SsuDeviceInfo deviceInfo;
if (opt.count() == 3 && opt.at(2) == "-s"){
qout << deviceInfo.deviceModel();
state = Idle;
} else if (opt.count() == 2){
qout << "Device model is: " << deviceInfo.deviceModel() << endl;
state = Idle;
}
}
176
void SsuCli::optModifyRepo(enum Actions action, QStringList opt){
177
178
SsuRepoManager repoManager;
QTextStream qout(stdout);
179
QTextStream qerr(stderr);
180
181
if (opt.count() == 3){
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
QDBusPendingReply<> reply = ssuProxy->modifyRepo(action, opt.at(2));
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
switch(action){
case Add:
repoManager.add(opt.at(2));
repoManager.update();
uidWarning();
break;
case Remove:
repoManager.remove(opt.at(2));
repoManager.update();
uidWarning();
break;
case Disable:
repoManager.disable(opt.at(2));
repoManager.update();
uidWarning();
break;
case Enable:
repoManager.enable(opt.at(2));
repoManager.update();
uidWarning();
break;
}
209
210
}
} else if (opt.count() == 4 && action == Add){
211
212
213
214
215
216
217
218
219
220
221
222
223
QString url, repo;
if (opt.at(2).indexOf(QRegExp("[a-z]*://", Qt::CaseInsensitive)) == 0){
url = opt.at(2);
repo = opt.at(3);
} else if (opt.at(3).indexOf(QRegExp("[a-z]*://", Qt::CaseInsensitive)) == 0){
url = opt.at(3);
repo = opt.at(2);
} else {
qerr << "Invalid parameters for 'ssu ar': URL required." << endl;
return;
}
224
225
226
227
228
229
230
231
QDBusPendingReply<> reply = ssuProxy->addRepo(repo, url);
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
repoManager.add(repo, url);
repoManager.update();
uidWarning();
}
232
}
233
234
}
235
void SsuCli::optRegister(QStringList opt){
236
237
238
239
240
241
242
/*
* register a new device
*/
QString username, password;
QTextStream qin(stdin);
QTextStream qout(stdout);
243
QTextStream qerr(stderr);
244
SsuCoreConfig *ssuSettings = SsuCoreConfig::instance();
245
246
247
struct termios termNew, termOld;
248
249
qout << "Username: " << flush;
username = qin.readLine();
250
251
252
253
254
tcgetattr(STDIN_FILENO, &termNew);
termOld = termNew;
termNew.c_lflag &= ~ECHO;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &termNew) == -1)
255
qout << "WARNING: Unable to disable echo on your terminal, password will echo!" << endl;
256
257
258
qout << "Password: " << flush;
password = qin.readLine();
259
qout << endl;
260
261
262
tcsetattr(STDIN_FILENO, TCSANOW, &termOld);
263
264
265
if (opt.count() == 3 && opt.at(2) == "-h")
ssuSettings->setValue("repository-url-variables/user", username);
266
267
268
269
270
271
272
273
QDBusPendingReply<> reply = ssuProxy->registerDevice(username, password);
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
qerr << reply.error().message() << endl;
ssu.sendRegistration(username, password);
}
274
275
276
state = Busy;
}
277
void SsuCli::optRelease(QStringList opt){
278
QTextStream qout(stdout);
279
QTextStream qerr(stderr);
280
281
282
283
284
285
286
287
if (opt.count() == 3){
if (opt.at(2) == "-r"){
qout << "Device release (RnD) is currently: " << ssu.release(true) << endl;
state = Idle;
} else {
qout << "Changing release from " << ssu.release()
<< " to " << opt.at(2) << endl;
288
qout << "Your device is now in release mode!" << endl;
289
290
291
292
293
294
295
296
297
298
299
QDBusPendingReply<> reply = ssuProxy->setRelease(opt.at(2), false);
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
ssu.setRelease(opt.at(2));
SsuRepoManager repoManager;
repoManager.update();
uidWarning();
}
300
301
302
303
304
305
306
307
308
state = Idle;
}
} else if (opt.count() == 2) {
qout << "Device release is currently: " << ssu.release() << endl;
state = Idle;
} else if (opt.count() == 4 && opt.at(2) == "-r"){
qout << "Changing release (RnD) from " << ssu.release(true)
<< " to " << opt.at(3) << endl;
309
qout << "Your device is now in RnD mode!" << endl;
310
311
312
313
314
315
316
317
318
319
320
QDBusPendingReply<> reply = ssuProxy->setRelease(opt.at(3), true);
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
ssu.setRelease(opt.at(3), true);
SsuRepoManager repoManager;
repoManager.update();
uidWarning();
}
321
322
323
324
325
state = Idle;
}
}
326
void SsuCli::optRepos(QStringList opt){
327
QTextStream qout(stdout);
328
329
SsuRepoManager repoManager;
SsuDeviceInfo deviceInfo;
330
331
QHash<QString, QString> repoParameters, repoOverride;
QString device="";
332
bool rndRepo = false;
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
int micMode=0, flagStart = 0;
if ((ssu.deviceMode() & Ssu::RndMode) == Ssu::RndMode)
rndRepo = true;
if (opt.count() >= 3 && opt.at(2) == "-m"){
micMode = 1;
// TODO: read the default mic override variables from some config
/*
repoOverride.insert("release", "@RELEASE@");
repoOverride.insert("rndRelease", "@RNDRELEASE@");
repoOverride.insert("flavour", "@FLAVOUR@");
repoOverride.insert("arch", "@ARCH@");
*/
}
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
if (opt.count() >= 3 + micMode){
// first argument is flag
if (opt.at(2 + micMode).contains("=")){
flagStart = 2 + micMode;
} else if (!opt.at(2 + micMode).contains("=") &&
opt.count() == 3 + micMode) {
// first (and only) argument is device)
device = opt.at(2 + micMode);
} else if(!opt.at(2 + micMode).contains("=") &&
opt.count() > 3 + micMode &&
opt.at(3 + micMode).contains("=")){
// first argument is device, second flag
device = opt.at(2 + micMode);
flagStart = 3 + micMode;
} else {
state = UserError;
return;
}
}
368
369
370
371
372
373
374
375
376
377
378
379
if (flagStart != 0){
for (int i=flagStart; i<opt.count(); i++){
if (opt.at(i).count("=") != 1){
qout << "Invalid flag: " << opt.at(i) << endl;
state = Idle;
return;
}
QStringList split = opt.at(i).split("=");
repoOverride.insert(split.at(0), split.at(1));
}
}
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
if (repoOverride.contains("rnd")){
if (repoOverride.value("rnd") == "true")
rndRepo = true;
else if (repoOverride.value("rnd") == "false")
rndRepo = false;
}
if (device != ""){
deviceInfo.setDeviceModel(device);
repoOverride.insert("model", device);
}
// TODO: rnd mode override needs to be implemented
QStringList repos;
// micMode? handle it and return, as it's a lot simpler than full mode
if (micMode){
398
repos = repoManager.repos(rndRepo, deviceInfo, Ssu::BoardFilter);
399
foreach (const QString &repo, repos){
400
401
402
403
404
405
406
407
QString repoName = repo;
if (repo.endsWith("-debuginfo")){
repoName = repo.left(repo.size() - 10);
repoParameters.insert("debugSplit", "debug");
} else if (repoParameters.value("debugSplit") == "debug")
repoParameters.remove("debugSplit");
QString repoUrl = ssu.repoUrl(repoName, rndRepo, repoParameters, repoOverride);
408
409
410
411
412
413
414
415
416
417
qout << "repo --name=" << repo << "-"
<< (rndRepo ? repoOverride.value("rndRelease")
: repoOverride.value("release"))
<< " --baseurl=" << repoUrl << endl;
}
state = Idle;
return;
}
if (device.isEmpty())
418
repos = repoManager.repos(rndRepo, deviceInfo, Ssu::BoardFilterUserBlacklist);
419
420
else {
qout << "Printing repository configuration for '" << device << "'" << endl << endl;
421
repos = repoManager.repos(rndRepo, deviceInfo, Ssu::BoardFilter);
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
}
SsuCoreConfig *ssuSettings = SsuCoreConfig::instance();
qout << "Enabled repositories (global): " << endl;
for (int i=0; i<=3; i++){
// for each repository, print repo and resolve url
int longestField = 0;
foreach (const QString &repo, repos)
if (repo.length() > longestField)
longestField = repo.length();
qout.setFieldAlignment(QTextStream::AlignLeft);
foreach (const QString &repo, repos){
437
438
439
440
441
442
443
444
QString repoName = repo;
if (repo.endsWith("-debuginfo")){
repoName = repo.left(repo.size() - 10);
repoParameters.insert("debugSplit", "debug");
} else if (repoParameters.value("debugSplit") == "debug")
repoParameters.remove("debugSplit");
QString repoUrl = ssu.repoUrl(repoName, rndRepo, repoParameters, repoOverride);
445
446
447
448
449
450
451
452
qout << " - " << qSetFieldWidth(longestField) << repo << qSetFieldWidth(0) << " ... " << repoUrl << endl;
}
if (i==0){
if (device != ""){
repos.clear();
continue;
}
453
repos = repoManager.repos(rndRepo, deviceInfo, Ssu::UserFilter);
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
qout << endl << "Enabled repositories (user): " << endl;
} else if (i==1){
repos = deviceInfo.disabledRepos();
if (device.isEmpty())
qout << endl << "Disabled repositories (global, might be overridden by user config): " << endl;
else
qout << endl << "Disabled repositories (global): " << endl;
} else if (i==2) {
repos.clear();
if (device != "")
continue;
if (ssuSettings->contains("disabled-repos"))
repos.append(ssuSettings->value("disabled-repos").toStringList());
qout << endl << "Disabled repositories (user): " << endl;
}
469
470
471
}
state = Idle;
472
473
}
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
void SsuCli::optSet(QStringList opt){
QTextStream qout(stdout);
SsuVariables var;
SsuCoreConfig *settings = SsuCoreConfig::instance();
QHash<QString, QString> storageHash;
// set repository specific variable
if (opt.count() == 5 && opt.at(2) == "-r"){
settings->setValue("repository-url-variables/" + opt.at(3), opt.at(4));
// clear repo specific variable
} else if (opt.count() == 4 && opt.at(2) == "-r"){
settings->remove("repository-url-variables/" + opt.at(3));
// list repo specific variables
} else if (opt.count() == 3 && opt.at(2) == "-r"){
qout << "Repository specific variables:" << endl << endl;
var.variableSection(settings, "repository-url-variables", &storageHash);
// set global variable
} else if (opt.count() == 4){
settings->setValue("global-variables/" + opt.at(2), opt.at(3));
// clear global variable
} else if (opt.count() == 3){
settings->remove("global-variables/" + opt.at(2));
// list global variables
} else if (opt.count() == 2){
qout << "Global variables:" << endl << endl;
var.variableSection(settings, "global-variables", &storageHash);
}
settings->sync();
if (!storageHash.isEmpty()){
QHash<QString, QString>::const_iterator i = storageHash.constBegin();
while (i != storageHash.constEnd()){
qout << i.key() << "=" << i.value() << endl;
i++;
}
}
state = Idle;
}
515
void SsuCli::optStatus(QStringList opt){
516
QTextStream qout(stdout);
517
QTextStream qerr(stderr);
518
SsuDeviceInfo deviceInfo;
519
520
521
522
/*
* print device information and registration status
*/
523
524
525
526
527
528
529
530
531
532
533
QString deviceUid;
QDBusPendingReply<QString> reply = ssuProxy->deviceUid();
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus unavailable, UUID not necessarily connected to reality." << endl;
deviceUid = deviceInfo.deviceUid();
} else
deviceUid = reply.value();
534
535
qout << "Device registration status: "
<< (ssu.isRegistered() ? "registered" : "not registered") << endl;
536
537
538
qout << "Device model: " << deviceInfo.displayName(Ssu::DeviceModel) << " ("
<< deviceInfo.deviceModel() << " / "
<< deviceInfo.displayName(Ssu::DeviceDesignation) << ")" << endl;
539
540
if (deviceInfo.deviceVariant() != "")
qout << "Device variant: " << deviceInfo.deviceVariant() << endl;
541
qout << "Device UID: " << deviceUid << endl;
542
543
544
545
if ((ssu.deviceMode() & Ssu::RndMode) == Ssu::RndMode)
qout << "Release (rnd): " << ssu.release(true) << " (" << ssu.flavour() << ")" << endl;
else
qout << "Release: " << ssu.release() << endl;
546
qout << "Domain: " << ssu.domain() << endl;
547
548
}
549
void SsuCli::optUpdateCredentials(QStringList opt){
550
551
552
553
554
QTextStream qout(stdout);
/*
* update the credentials
* optional argument: -f
*/
555
556
557
558
bool force=false;
if (opt.count() == 3 && opt.at(2) == "-f")
force=true;
559
560
if (!ssu.isRegistered()){
qout << "Device is not registered, can't update credentials" << endl;
561
state = Idle;
562
QCoreApplication::exit(1);
563
} else {
564
ssu.updateCredentials(force);
565
566
567
state = Busy;
}
}
568
569
void SsuCli::optUpdateRepos(QStringList opt){
570
571
572
573
574
575
576
577
578
579
QTextStream qerr(stdout);
QDBusPendingReply<> reply = ssuProxy->updateRepos();
reply.waitForFinished();
if (reply.isError()){
qerr << "DBus call failed, falling back to libssu" << endl;
SsuRepoManager repoManager;
repoManager.update();
uidWarning();
}
580
581
}
582
void SsuCli::run(){
583
QTextStream qout(stdout);
584
QTextStream qerr(stderr);
585
586
587
QStringList arguments = QCoreApplication::arguments();
588
589
590
591
SsuCoreConfig *ssuSettings = SsuCoreConfig::instance();
if (!ssuSettings->isWritable())
qerr << "WARNING: ssu.ini does not seem to be writable. Setting values might not work." << endl;
592
593
594
595
596
// make sure there's a first argument to parse
if (arguments.count() < 2){
usage();
return;
}
597
598
599
600
601
602
struct {
const char *longopt; // long option name
const char *shortopt; // option shortcut name
int minargs; // minimum number of required args
int maxargs; // -1 for "function will handle max args"
603
void (SsuCli::*handler)(QStringList opt); // handler function
604
605
} handlers[] = {
// functions accepting no additional arguments
606
607
"status", "s", 0, 0, &SsuCli::optStatus,
"updaterepos", "ur", 0, 0, &SsuCli::optUpdateRepos,
608
609
// functions requiring at least one argument
610
611
612
613
"addrepo", "ar", 1, 2, &SsuCli::optAddRepo,
"removerepo", "rr", 1, 1, &SsuCli::optRemoveRepo,
"enablerepo", "er", 1, 1, &SsuCli::optEnableRepo,
"disablerepo", "dr", 1, 1, &SsuCli::optDisableRepo,
614
615
616
// functions accepting 0 or more arguments
// those need to set state to Idle on success
617
618
619
620
621
622
623
624
"register", "r", 0, -1, &SsuCli::optRegister,
"repos", "lr", 0, -1, &SsuCli::optRepos,
"flavour", "fl", 0, -1, &SsuCli::optFlavour,
"mode", "m", 0, -1, &SsuCli::optMode,
"model", "mo", 0, -1, &SsuCli::optModel,
"release", "re", 0, -1, &SsuCli::optRelease,
"update", "up", 0, -1, &SsuCli::optUpdateCredentials,
"domain", "do", 0, -1, &SsuCli::optDomain,
625
"set", "set", 0, -1, &SsuCli::optSet,
626
627
628
};
bool found = false;
629
int argc = arguments.count() - 2;
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
for (int i=0; i<sizeof(handlers)/sizeof(handlers[0]); i++) {
if ((arguments.at(1) != handlers[i].longopt) &&
(arguments.at(1) != handlers[i].shortopt)) {
continue;
}
if (argc < handlers[i].minargs) {
usage(QString("%1: Too few arguments").arg(handlers[i].longopt));
return;
}
if (handlers[i].maxargs != -1 && argc > handlers[i].maxargs) {
usage(QString("%1: Too many arguments").arg(handlers[i].longopt));
return;
}
// Call option handler
(this->*(handlers[i].handler))(arguments);
found = true;
break;
}
if (!found)
655
state = UserError;
656
657
658
659
660
661
// functions that need to wait for a response from ssu should set a flag so
// we can do default exit catchall here
if (state == Idle)
QCoreApplication::exit(0);
else if (state == UserError)
662
663
664
usage();
}
665
void SsuCli::uidWarning(QString message){
666
667
668
669
670
671
672
673
674
if (message.isEmpty())
message = "Run 'ssu ur' as root to recreate repository files";
if (geteuid() != 0){
QTextStream qout(stderr);
qout << "You're not root. " << message << endl;
}
}
675
void SsuCli::usage(QString message){
676
QTextStream qout(stderr);
677
678
679
680
681
682
683
684
qout << "\nUsage: ssu <command> [-command-options] [arguments]" << endl
<< endl
<< "Repository management:" << endl
<< "\tupdaterepos, ur \tupdate repository files" << endl
<< "\trepos, lr \tlist configured repositories" << endl
<< "\t [-m] \tformat output suitable for kickstart" << endl
<< "\t [device] \tuse repos for 'device'" << endl
<< "\t [flags] \tadditional flags" << endl
685
<< "\t rnd=<true|false> \tset rnd or release mode (default: take from host)" << endl
686
687
688
689
690
691
692
<< "\taddrepo, ar <repo> \tadd this repository" << endl
<< "\t [url] \tspecify URL, if not configured" << endl
<< "\tremoverepo, rr <repo> \tremove this repository from configuration" << endl
<< "\tenablerepo, er <repo> \tenable this repository" << endl
<< "\tdisablerepo, dr <repo> \tdisable this repository" << endl
<< endl
<< "Configuration management:" << endl
693
694
695
696
697
698
699
700
701
<< "\tflavour, fl \tdisplay flavour used (RnD only)" << endl
<< "\t [newflavour] \tset new flavour" << endl
<< "\trelease, re \tdisplay release used" << endl
<< "\t [-r] \tuse RnD release" << endl
<< "\t [newrelease] \tset new (RnD)release" << endl
<< "\tset \tdisplay global variables" << endl
<< "\t [-r] \toperate on repository only variables" << endl
<< "\t <variable> \tdisplay value of <variable>" << endl
<< "\t <variable> <value> \tset value of <variable> to <value>" << endl
702
703
704
705
<< endl
<< "Device management:" << endl
<< "\tstatus, s \tprint registration status and device information" << endl
<< "\tregister, r \tregister this device" << endl
706
<< "\t [-h] \tconfigure user for OBS home" << endl
707
708
<< "\tupdate, up \tupdate repository credentials" << endl
<< "\t [-f] \tforce update" << endl
709
<< "\tmodel, mo \tprint name of device model (like N9)" << endl
710
<< endl;
711
712
if (!message.isEmpty())
qout << message << endl;
713
qout.flush();
714
715
QCoreApplication::exit(1);
}