diff --git a/libexec/mport.merge/mport.merge.c b/libexec/mport.merge/mport.merge.c index e23a86c..6c16c99 100644 --- a/libexec/mport.merge/mport.merge.c +++ b/libexec/mport.merge/mport.merge.c @@ -42,6 +42,8 @@ int main(int argc, char *argv[]) int ch, i; const char *outfile = NULL; const char **inputfiles; + mportInstance *mport; + if (argc == 1) usage(); @@ -63,6 +65,12 @@ int main(int argc, char *argv[]) if (outfile == NULL) usage(); + mport = mport_instance_new(); + if (mport_instance_init(mport, NULL) != MPORT_OK) { + warnx("%s", mport_err_string()); + exit(EXIT_FAILURE); + } + if ((inputfiles = (const char **)malloc((argc + 1) * sizeof(char **))) == NULL) err(EX_OSERR, "Couldn't allocate input array"); @@ -73,7 +81,7 @@ int main(int argc, char *argv[]) inputfiles[i] = NULL; - if (mport_merge_primative((const char **)inputfiles, outfile) != MPORT_OK) + if (mport_merge_primative(mport, (const char **)inputfiles, outfile) != MPORT_OK) errx(EX_SOFTWARE, "Could not merge package files: %s", mport_err_string()); free(inputfiles); diff --git a/libmport/Makefile b/libmport/Makefile index cf3a00a..af2a112 100644 --- a/libmport/Makefile +++ b/libmport/Makefile @@ -12,7 +12,7 @@ SRCS= asset.c bundle_write.c bundle_read.c plist.c create_primative.c db.c \ autoremove.c INCS= mport.h -CFLAGS+= -I${.CURDIR} -I/usr/include/private/ucl +CFLAGS+= -I${.CURDIR} -I/usr/include/private/ucl -DDEBUG SHLIB_MAJOR= 2 MAN= mport.3 diff --git a/libmport/merge_primative.c b/libmport/merge_primative.c index a096085..19310c9 100644 --- a/libmport/merge_primative.c +++ b/libmport/merge_primative.c @@ -66,7 +66,7 @@ static uint32_t SuperFastHash(const char *); * dependencies are correct, and that the packages are in an optimal order for installation. */ MPORT_PUBLIC_API int -mport_merge_primative(const char **filenames, const char *outfile) +mport_merge_primative(mportInstance *mport, const char **filenames, const char *outfile) { sqlite3 *db; mportBundleWrite *bundle; @@ -87,7 +87,7 @@ mport_merge_primative(const char **filenames, const char *outfile) DIAG("Building stub") /* this function merges the stub databases into one db. */ - if (build_stub_db(&db, tmpdir, dbfile, filenames, table) != MPORT_OK) + if (build_stub_db(mport, &db, tmpdir, dbfile, filenames, table) != MPORT_OK) RETURN_CURRENT_ERROR; DIAG("Stub complete: %s", dbfile) diff --git a/libmport/mport.h b/libmport/mport.h index d5183aa..059a805 100644 --- a/libmport/mport.h +++ b/libmport/mport.h @@ -220,7 +220,7 @@ void mport_createextras_free(mportCreateExtras *); int mport_create_primative(mportInstance *, mportAssetList *, mportPackageMeta *, mportCreateExtras *); /* Merge primative */ -int mport_merge_primative(const char **, const char *); +int mport_merge_primative(mportInstance *mport, const char **, const char *); /* Package installation */ int mport_install(mportInstance *, const char *, const char *, const char *, mportAutomatic); diff --git a/mport/mport.c b/mport/mport.c index c66bb99..6fc47f8 100644 --- a/mport/mport.c +++ b/mport/mport.c @@ -305,7 +305,7 @@ main(int argc, char *argv[]) { void usage(void) { show_version(NULL); - fprintf(stderr, "OS version is the installed system version and does not reflect config customization.\n") + fprintf(stderr, "OS version is the installed system version and does not reflect config customization.\n"); fprintf(stderr, "usage: mport args:\n"