Uploaded image for project: 'ejabberd development'
  1. ejabberd development
  2. EJAB-1520

ejabberd_update:get_current_version fail with precompiled ejabberd

    Details

      Description

      I downloaded the precompiled installer for linux and after install, configure, ... all works except module update via webadmin that crashes (exception error: no match of right hand side value false).

      In ejabberd_update:get_current_version Module:module_info returns an empty list for built-in beams (may it be because they are compiled without debug? it works with my custom modules)

      I managed to solve the issue changing

      get_current_version(Module) ->
          Attrs = Module:module_info(attributes),
          {value, {vsn, CurVsn}} = lists:keysearch(vsn, 1, Attrs),
          CurVsn.
      

      to

      get_current_version(Module) ->
          Attrs = Module:module_info(attributes),
          case lists:keysearch(vsn, 1, Attrs) of
              {value, {vsn, CurVsn}} -> CurVsn;
              _ -> unknown_version
          end.
      

        Expenses

          Activity

          Hide
          cromain@process-one.net Christophe Romain added a comment -

          installer uses stripped beams indeed, this make module_info unable to get vsn attribute.
          your patch proposal seems correct to me.

          Show
          cromain@process-one.net Christophe Romain added a comment - installer uses stripped beams indeed, this make module_info unable to get vsn attribute. your patch proposal seems correct to me.
          Hide
          badlop Badlop added a comment -

          Patch committed.

          Show
          badlop Badlop added a comment - Patch committed.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development