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.
      

        Activity

        Hide
        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
        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
        added a comment -

        Patch committed.

        Show
        Badlop
        added a comment - Patch committed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 17 weeks, 2 days ago

              Issue deployment