don't change of directory anymore
[src/app-framework-main.git] / src / wgtpkg-info.c
index 1a7724b..7854b09 100644 (file)
@@ -105,51 +105,15 @@ int main(int ac, char **av)
        return 0;
 }
 
-static struct wgt *wgt_at_workdir()
-{
-       int rc, wfd;
-       struct wgt *wgt;
-
-       wfd = workdirfd();
-       if (wfd < 0)
-               return NULL;
-
-       wgt = wgt_create();
-       if (!wgt) {
-               syslog(LOG_ERR, "failed to allocate wgt");
-               close(wfd);
-               return NULL;
-       }
-
-       rc = wgt_connectat(wgt, wfd, NULL);
-       if (rc) {
-               syslog(LOG_ERR, "failed to connect wgt to workdir");
-               close(wfd);
-               wgt_unref(wgt);
-               return NULL;
-       }
-
-       return wgt;
-}
-
-
 static int check_and_show()
 {
-       struct wgt *wgt;
        struct wgt_info *ifo;
 
-       wgt = wgt_at_workdir();
-       if (!wgt)
-               return -1;
-
-       ifo = wgt_info_get(wgt, 1, 1, 1);
-       if (!ifo) {
-               wgt_unref(wgt);
+       ifo = wgt_info_createat(workdirfd, NULL, 1, 1, 1);
+       if (!ifo)
                return -1;
-       }
        wgt_info_dump(ifo, 1, "");
        wgt_info_unref(ifo);
-       wgt_unref(wgt);
        return 0;
 }
 
@@ -164,9 +128,6 @@ static void show(const char *wgtfile)
                return;
        }
 
-       if (enter_workdir(0))
-               goto error2;
-
        if (zread(wgtfile, 0))
                goto error2;