Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Oct 16, 2022
1 parent aa34195 commit 193f495
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libmport/bundle_read_install_pkg.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ static int load_pkg_msg(mportInstance *mport, mportBundleRead *bundle, mportPack

static mportPackageMessage * pkg_message_from_ucl(mportInstance *mport, const ucl_object_t *obj, mportPackageMessage *msg);

static int copy_metafile(mportInstance *, mportBundleRead *, mportPackageMeta *, char *);

/**
* This is a wrapper for all bundle read install operations
*/
Expand Down Expand Up @@ -810,16 +812,16 @@ do_actual_install(mportInstance *mport, mportBundleRead *bundle, mportPackageMet


static int
copy_metafile(char *file)
copy_metafile(mportInstance *mport, mportBundleRead *bundle, mportPackageMeta *pkg, char *type)
{
char from[FILENAME_MAX];
char to[FILENAME_MAX];
char todir[FILENAME_MAX];

(void)snprintf(from, FILENAME_MAX, "%s/%s/%s-%s/%s", bundle->tmpdir, MPORT_STUB_INFRA_DIR, pkg->name, pkg->version, TYPE);
(void)snprintf(from, FILENAME_MAX, "%s/%s/%s-%s/%s", bundle->tmpdir, MPORT_STUB_INFRA_DIR, pkg->name, pkg->version, type);
if (mport_file_exists(from)) {
(void)snprintf(todir, FILENAME_MAX, "%s%s/%s-%s", mport->root, MPORT_INST_INFRA_DIR, pkg->name, pkg->version);
(void)snprintf(to, FILENAME_MAX, "%s%s/%s-%s/%s", mport->root, MPORT_INST_INFRA_DIR, pkg->name, pkg->version, TYPE);
(void)snprintf(to, FILENAME_MAX, "%s%s/%s-%s/%s", mport->root, MPORT_INST_INFRA_DIR, pkg->name, pkg->version, type);
if (mport_mkdir(todir) != MPORT_OK)
RETURN_CURRENT_ERROR;
if (mport_copy_file(from, to) != MPORT_OK)
Expand All @@ -844,10 +846,10 @@ static int
do_post_install(mportInstance *mport, mportBundleRead *bundle, mportPackageMeta *pkg)
{

copy_metafile(MPORT_MTREE_FILE);
copy_metafile(MPORT_INSTALL_FILE);
copy_metafile(MPORT_DEINSTALL_FILE);
copy_metafile(MPORT_MESSAGE_FILE);
copy_metafile(mport, bundle, pkg, MPORT_MTREE_FILE);
copy_metafile(mport, bundle, pkg, MPORT_INSTALL_FILE);
copy_metafile(mport, bundle, pkg, MPORT_DEINSTALL_FILE);
copy_metafile(mport, bundle, pkg, MPORT_MESSAGE_FILE);

if (run_postexec(mport, pkg) != MPORT_OK)
RETURN_CURRENT_ERROR;
Expand Down

0 comments on commit 193f495

Please sign in to comment.