Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
utils-jbus: adding comments
[src/app-framework-main.git]
/
src
/
wgtpkg-installer.c
diff --git
a/src/wgtpkg-installer.c
b/src/wgtpkg-installer.c
index
e8568b8
..
ea08fce
100644
(file)
--- a/
src/wgtpkg-installer.c
+++ b/
src/wgtpkg-installer.c
@@
-1,6
+1,8
@@
/*
Copyright 2015 IoT.bzh
/*
Copyright 2015 IoT.bzh
+ author: José Bollo <jose.bollo@iot.bzh>
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@
-23,13
+25,17
@@
#include <unistd.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include <errno.h>
-#include <syslog.h>
#include <getopt.h>
#include <getopt.h>
+#include <libxml/tree.h>
+
#include "verbose.h"
#include "verbose.h"
-#include "wgtpkg.h"
+#include "wgtpkg-permissions.h"
+#include "wgtpkg-xmlsec.h"
+#include "wgt-info.h"
+#include "wgtpkg-install.h"
-static const char appname[] = "wgtpkg-install";
+static const char appname[] = "wgtpkg-install
er
";
static const char *root;
static int force;
static const char *root;
static int force;
@@
-61,9
+67,9
@@
static struct option options[] = {
int main(int ac, char **av)
{
int i;
int main(int ac, char **av)
{
int i;
-
char *wpath
;
+
struct wgt_info *ifo
;
-
openlog(appname, LOG_PERROR, LOG_AUTH
);
+
LOGAUTH(appname
);
xmlsec_init();
xmlsec_init();
@@
-90,35
+96,28
@@
int main(int ac, char **av)
grant_permission_list(optarg);
break;
case ':':
grant_permission_list(optarg);
break;
case ':':
-
syslog(LOG_ERR,
"missing argument value");
+
ERROR(
"missing argument value");
return 1;
default:
return 1;
default:
-
syslog(LOG_ERR,
"unrecognized option");
+
ERROR(
"unrecognized option");
return 1;
}
}
ac -= optind;
if (ac < 2) {
return 1;
}
}
ac -= optind;
if (ac < 2) {
-
syslog(LOG_ERR,
"arguments are missing");
+
ERROR(
"arguments are missing");
return 1;
}
return 1;
}
- /*
canonic names for file
s */
+ /*
install widget
s */
av += optind;
av += optind;
- for (i = 0 ; av[i] != NULL ; i++) {
- wpath = realpath(av[i], NULL);
- if (wpath == NULL) {
- syslog(LOG_ERR, "error while getting realpath of %dth widget: %s", i+1, av[i]);
- return 1;
- }
- av[i] = wpath;
- }
root = *av++;
root = *av++;
-
- /* install widgets */
- for ( ; *av ; av++)
- install_widget(*av, root, force);
+ for ( ; *av ; av++) {
+ ifo = install_widget(*av, root, force);
+ if (ifo)
+ wgt_info_unref(ifo);
+ }
return 0;
}
return 0;
}