Skip to content

Commit

Permalink
fixup build
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Oct 17, 2021
1 parent 0ecf4bd commit 06bbef2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion libexec/mport.merge/mport.merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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");

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libmport/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions libmport/merge_primative.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libmport/mport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mport/mport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command> args:\n"
Expand Down

0 comments on commit 06bbef2

Please sign in to comment.