summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-01-01 15:48:10 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-01-01 15:48:10 +0200
commit59d222d58c003f4eb564edcc1d01c5b40690938c (patch)
tree1010fc6fff4e752dc7a0dfc468f61a80efe92b09 /src/apk.c
parent0cc41ba4dc47561f8a2299b985be777c2befdb74 (diff)
downloadapk-tools-59d222d58c003f4eb564edcc1d01c5b40690938c.tar.gz
apk-tools-59d222d58c003f4eb564edcc1d01c5b40690938c.tar.bz2
apk-tools-59d222d58c003f4eb564edcc1d01c5b40690938c.tar.xz
apk-tools-59d222d58c003f4eb564edcc1d01c5b40690938c.zip
upgrade: perform upgrade of apk-tools first if available
Also re-exec's apk-tools to perform rest of the upgrade using the new apk-tools. This allows handling of new apk-tools features properly. Fixes #140.
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index 7663d4c..4b97be5 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -30,6 +30,8 @@
#include "apk_blob.h"
#include "apk_print.h"
+char **apk_argv;
+
static struct apk_option generic_options[] = {
{ 'h', "help", "Show generic help or applet specific help" },
{ 'p', "root", "Install packages to DIR",
@@ -245,6 +247,10 @@ int main(int argc, char **argv)
struct apk_database db;
struct apk_db_options dbopts;
+ apk_argv = malloc(sizeof(char*[argc+1]));
+ memcpy(apk_argv, argv, sizeof(char*[argc]));
+ apk_argv[argc] = NULL;
+
memset(&dbopts, 0, sizeof(dbopts));
list_init(&dbopts.repository_list);
apk_atom_init();