pre-inst/pre-inst.c
changeset 60 772ff096a326
parent 38 a29623b68ca2
child 80 671df13f1304
     1.1 --- a/pre-inst/pre-inst.c	Mon Jun 13 12:18:42 2016 +0100
     1.2 +++ b/pre-inst/pre-inst.c	Fri Jul 08 08:33:44 2016 +0100
     1.3 @@ -91,7 +91,7 @@
     1.4  {
     1.5      int retval;
     1.6      char *path=data;
     1.7 -    gchar *s;
     1.8 +    gchar *s,*uri;
     1.9      char *install[]={"plover-gtkui",NULL};
    1.10      GError *error=NULL;
    1.11      prefix=plover_pre_install_prefix();
    1.12 @@ -99,8 +99,10 @@
    1.13      plover_log_open(s);
    1.14      g_free(s);
    1.15      s=g_strconcat(prefix,"/var/lib/razor",NULL);
    1.16 -    razor_set_database_path(s);
    1.17 +    uri=razor_path_to_uri(s);
    1.18      g_free(s);
    1.19 +    razor_set_database_uri(uri);
    1.20 +    free(uri);
    1.21      if (verify_and_fix(prefix))
    1.22      {
    1.23  	free(path);
    1.24 @@ -192,14 +194,16 @@
    1.25  gboolean pre_uninstall(void)
    1.26  {
    1.27      gboolean success;
    1.28 -    gchar *s;
    1.29 +    gchar *s,*uri;
    1.30      GError *error=NULL;
    1.31      razor_set_lua_loader("posix",(void (*)())luaopen_posix);
    1.32      razor_set_lua_loader("whelk",(void (*)())luaopen_whelk);
    1.33      prefix=plover_pre_install_prefix();
    1.34      s=g_strconcat(prefix,"/var/lib/razor",NULL);
    1.35 -    razor_set_database_path(s);
    1.36 +    uri=razor_path_to_uri(s);
    1.37      g_free(s);
    1.38 +    razor_set_database_uri(uri);
    1.39 +    free(uri);
    1.40      success=plover_remove(NULL,&error);
    1.41      if (error)
    1.42      {